creating Rdoc for a rails app

隐身守侯 提交于 2019-12-03 13:09:00

I added this to my Rakefile;

RDoc::Task.new :rdoc do |rdoc|
  rdoc.main = "README.rdoc"

  rdoc.rdoc_files.include("README.rdoc", "doc/*.rdoc", "app/**/*.rb", "lib/*.rb", "config/**/*.rb")
  #change above to fit needs

  rdoc.title = "App Documentation"
  rdoc.options << "--all" 
end

Then run;

rake rdoc

Check out the RDoc::Task docs for more http://rdoc.rubyforge.org/RDoc/Task.html

Admittedly I am on a rails 3 app, but I think this works the same.

You can use rake doc:app to generate documentation for the app.

Quoting from section 2.4 of Rails guides:

The doc: namespace has the tools to generate documentation for your app, API documentation, guides. Documentation can also be stripped which is mainly useful for slimming your codebase, like if you're writing a Rails application for an embedded platform.

rake doc:app generates documentation for your application in doc/app. rake doc:guides generates Rails guides in doc/guides. rake doc:rails generates API documentation for Rails in doc/api.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!