获取并安装新的 RDoc 模板

发布于 2024-11-15 18:27:36 字数 2449 浏览 4 评论 0 原文

我正在使用 Ruby on Rails 3.0.7,我想安装并使用新的 RDoc 模板(而不是默认模板)来记录我的应用程序。

我想选择以下其中一项:

所以,

  1. 我在哪里可以获得上述模板之一吗?
  2. 我怎样才能安装它?
  3. 我应该在 .rake 文件中放入哪些代码才能使用所选模板生成文档?

简而言之,我是这方面的新手。


此时,我在 Gemfile 中声明了以下内容:

gem "rdoc", "~> 3.6.1"

并运行 bundle install 命令。


UPDATE I for @dmarkow

我安装了 horo gem 并将以下代码插入到我的 .rake 文件中

  RDoc::Task.new do |rdoc|
    rdoc.title    = "My Awesome docs"
    rdoc.rdoc_dir = 'doc'

    rdoc.options << '-f' << 'horo'
    rdoc.options << '--main' << 'README'
  end

如果我运行命令 rdoc -f horo --main README.rdoc *.rdoc lib ext 我得到这个:

file '*.rdoc' not found
file 'ext' not found
uh-oh! RDoc had a problem:

Directory doc already exists, but it looks like it isn't an RDoc directory.

Because RDoc doesn't want to risk destroying any of your existing files,
you'll need to specify a different output directory name (using the --op <dir>
option)

如果我运行命令 rake doc:app 我得到这个:

WARNING: Deprecated reference to top-level constant 'Task' found at: <my_application_projectfolder>/Rakefile:7:in `<top (required)>'
    Use --classic-namespace on rake command
    or 'require "rake/classic_namespace"' in Rakefile
rake aborted!
wrong number of arguments (0 for 2)

更新II for @dmarkow

我删除了 doc 目录:

如果我运行命令 rdoc -f horo --main README.rdoc *.rdoc lib ext 我得到了这个:

file '*.rdoc' not found
file 'ext' not found

No newer files.

Files:      0

Classes:    0 (0 undocumented)
Modules:    0 (0 undocumented)
Constants:  0 (0 undocumented)
Attributes: 0 (0 undocumented)
Methods:    0 (0 undocumented)

Total:      0 (0 undocumented)
  0.00% documented

在文档目录中它创建了一个 created.rid 文件。

如果我运行命令rake doc:app,我会得到与以下更新相同的结果。

我必须做什么?我仍然需要在 Gemfile 中保留 gem "rdoc", "~> 3.6.1" 吗?

I am using Ruby on Rails 3.0.7 and I would like to install and use a new RDoc template (instead of the default) in order to documenting my application.

I would like to choose one of following:

So,

  1. Where I can get one of the above templates?
  2. How can I install that?
  3. What code should I put in a .rake file to generate the documentation with the chosen template?

In few words, I am a newbie in this matters.


At this time in my Gemfile I have stated the following:

gem "rdoc", "~> 3.6.1"

and run the bundle install command.


UPDATE I for @dmarkow

I installed the horo gem and inserted the following code in a my .rake file

  RDoc::Task.new do |rdoc|
    rdoc.title    = "My Awesome docs"
    rdoc.rdoc_dir = 'doc'

    rdoc.options << '-f' << 'horo'
    rdoc.options << '--main' << 'README'
  end

If I run the command rdoc -f horo --main README.rdoc *.rdoc lib ext I get this:

file '*.rdoc' not found
file 'ext' not found
uh-oh! RDoc had a problem:

Directory doc already exists, but it looks like it isn't an RDoc directory.

Because RDoc doesn't want to risk destroying any of your existing files,
you'll need to specify a different output directory name (using the --op <dir>
option)

If I run the command rake doc:app I get this:

WARNING: Deprecated reference to top-level constant 'Task' found at: <my_application_projectfolder>/Rakefile:7:in `<top (required)>'
    Use --classic-namespace on rake command
    or 'require "rake/classic_namespace"' in Rakefile
rake aborted!
wrong number of arguments (0 for 2)

UPDATE II for @dmarkow

I removed the doc directory:

If I run the command rdoc -f horo --main README.rdoc *.rdoc lib ext I get this:

file '*.rdoc' not found
file 'ext' not found

No newer files.

Files:      0

Classes:    0 (0 undocumented)
Modules:    0 (0 undocumented)
Constants:  0 (0 undocumented)
Attributes: 0 (0 undocumented)
Methods:    0 (0 undocumented)

Total:      0 (0 undocumented)
  0.00% documented

In the documentation directory it creates a created.rid file.

If I run the command rake doc:app I get the same as in the following UPDATE.

What I have to do? I have still to keep the gem "rdoc", "~> 3.6.1" in my Gemfile?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

美煞众生 2024-11-22 18:27:36

我更喜欢汉娜,或者汉娜新风格。
Hanna 很好,但它是基于旧的 rdoc 版本。 Hanna-nouveau 基于原始 Hanna,但它适用于 rdoc 3(使用 rdoc 3.12 进行测试)。

看起来像 Hanna 示例

您可能会在 http://gems.rubypla.net/todonotes/0.1.0/

详细信息可以在 https://github.com/rdoc/hanna-nouveau自述文件包含有关安装和使用的信息。


更新 2014

Hanna-nouveau 不适用于 rdoc 4。

您可以做什么:安装旧的 rdoc 版本(我使用 3.12)。无需卸载最实际的版本。您可以根据以下情况调用 rdoc 版本:

rdoc _3.12_ -f hanna [...more options...]

使用 _3.12_ 加载 rdoc 版本 3.12。使用 -f hanna hanna-nouveau 。

I prefer Hanna, resp Hanna-nouveau.
Hanna was fine, but it is based on an old rdoc-version. Hanna-nouveau base on the original Hanna, but it works with rdoc 3 (tested with rdoc 3.12).

It looks like Example for Hanna

You may see another example in http://gems.rubypla.net/todonotes/0.1.0/

Details can be found at https://github.com/rdoc/hanna-nouveau. The Readme contains information about installation and usage.


Update 2014

Hanna-nouveau does not work with rdoc 4.

What you can do: Install an old rdoc-version (I use 3.12). There is no need to uninstall the most actual version. You can call rdoc version depending:

rdoc _3.12_ -f hanna [...more options...]

With _3.12_ the rdoc-version 3.12 is loaded. With -f hanna hanna-nouveau is used.

柠北森屋 2024-11-22 18:27:36

http://api.rubyonrails.org 使用的是“Horo”模板。您可以在这里找到它,以及使用它的说明(它是通过 gem 安装的):

https://github.com /tenderlove/horo

The one used at http://api.rubyonrails.org is the "Horo" template. You can find it here, along with instructions for using it (it's installed via a gem):

https://github.com/tenderlove/horo

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文