我正在使用 Ruby on Rails 3.0.7,我想安装和使用新的 RDoc 模板(而不是默认模板)来记录我的应用程序。
我想选择以下之一:
所以,
- 我在哪里可以获得上述模板之一?
- 我怎样才能安装它?
- 我应该在
.rake
文件中放入什么代码来使用所选模板生成文档?
简而言之,我是这方面的新手。
此时,在我的 Gemfile 中,我声明了以下内容:
gem "rdoc", "~> 3.6.1"
并运行bundle install
命令。
更新我@dmarkow
我安装了horo.rake
gem 并在我的文件中插入了以下代码
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)
@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
,我会得到与以下 UPDATE 相同的结果。
我必须做什么?我还需要保留gem "rdoc", "~> 3.6.1"
在我的 Gemfile 中吗?