如何更新 Raku 文档以供 p6doc 读取?

huangapple go评论56阅读模式
英文:

How to update Raku documentations which p6doc will read?

问题

在 macOS 上,我已经从 Homebrew 安装了 rakudo-star 2023.02。然后我尝试执行 zef install rakudoc,但由于测试失败而中止安装。看起来 rakudoc 的开发已经停滞了一段时间。因此我执行了 zef install p6doc,高兴地在终端窗口中阅读 Raku 文档,而无需离开终端窗口,只是发现 p6doc 使用的文档已经过时。

这些文档已经安装在 /usr/local/Cellar/rakudo-star/2023.02/share/perl6/site/doc 目录下。我前往 https://github.com/Raku/doc 获取了最新的文档目录,并用下载的文档目录替换了我的旧文档目录,然后使用 p6doc build 重新构建了 p6doc 的索引。但 p6doc 不会使用新文档,因此当我执行 p6doc Str 时,它会显示 No such type 'Str'

如何更新 p6doc 读取的文档为最新版本?非常感谢!

英文:

On mac, I have installed rakudo-star 2023.02 from Homebrew. Then I tried to zef install rakudoc, but it aborted installing due to test failures. It seems that the development of rakudoc had stalled for quite a while. So I zef install p6doc, and happily read raku documentations without bothering to leave terminal's window, just to find that the documents p6doc uses are out-of-date.

The docs have been installed in /usr/local/Cellar/rakudo-star/2023.02/share/perl6/site/doc. I went to https://github.com/Raku/doc to get the latest doc directory and replace my old doc directory with the downloaded one, then rebuilt p6doc's index with p6doc build. But p6doc won't use the new docs such that when I p6doc Str, it says No such type 'Str'.

How do I update the docs p6doc reads to the latest ones? Thanks a lot in advance.

答案1

得分: 5

p6doc已不再更新;rakudoc是命令行工具的当前版本。

我可以通过以下步骤(使用每个仓库的本地克隆)在命令行上阅读Str文档:

$ cd ~/sandbox
$ git clone git@github.com:Raku/rakudoc.git
$ git clone git@github.com:Raku/doc.git
$ cd rakudoc
$ zef install --deps-only .
$ RAKUDOC=~/sandbox/doc raku -I. bin/rakudoc -D -b # 正在索引 417...
$ RAKUDOC=~/sandbox/doc raku -I. bin/rakudoc -D Type/Str # TITLE class Str

截至目前,zef install rakudoc缺少一些HEAD上的bug修复。您可以从git克隆中运行zef install .来获取未发布的工作版本,并且我已经打开了一个问题以推动新版本发布。

看起来最大的区别是当前需要Type/Str

编辑

我们的环境变量指向了错误的文件夹,我已经发布了一个新版本,所以我们可以通过zef进行安装:

$ zef install rakudoc
$ cd ~/sandbox
$ git clone git@github.com:Raku/doc.git
$ RAKUDOC=~/sandbox/doc/doc rakudoc -D -b # 正在索引 417...
$ RAKUDOC=~/sandbox/doc/doc rakudoc -D Str # TITLE class Str
$ RAKUDOC=~/sandbox/doc/doc rakudoc -D .polymod # 所有 polymod 方法
英文:

p6doc is no longer current; rakudoc is the current incarnation of the command line tool.

I was able to read the Str docs on the command line, with the following steps (with a local clone of each repo):

$ cd ~/sandbox
$ git clone git@github.com:Raku/rakudoc.git
$ git clone git@github.com:Raku/doc.git
$ cd rakudoc
$ zef install --deps-only .
$ RAKUDOC=~/sandbox/doc raku -I. bin/rakudoc -D -b # Indexing 417...
$ RAKUDOC=~/sandbox/doc raku -I. bin/rakudoc -D Type/Str # TITLE class Str

zef install rakudoc as of right now is missing some bugfixes on HEAD. You could zef install . from a git clone to get the unreleased working version, and I've opened a ticket to get a new release moving.

Looks like the big difference is you currently need Type/Str.

EDIT:

We had the env var pointing at the wrong folder, and I've cut a new release, so we can install via zef:

$ zef install rakudoc
$ cd ~/sandbox
$ git clone git@github.com:Raku/doc.git
$ RAKUDOC=~/sandbox/doc/doc rakudoc -D -b # Indexing 417...
$ RAKUDOC=~/sandbox/doc/doc rakudoc -D Str # TITLE class Str
$ RAKUDOC=~/sandbox/doc/doc rakudoc -D .polymod #all polymod methods

huangapple
  • 本文由 发表于 2023年3月8日 14:48:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/75670079.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定