How to Generate Rdoc for (All Of) Rails

How do I generate RDOC for (all of) Rails?

The easiest I found was to just download them from railsapi.com and unpack the file into /Library/Ruby/Gems/1.8/doc/rails-2.3.3/rdoc/

creating Rdoc for a rails app

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.

How to rebuild rdoc for all the installed gems?


yard gems

or

sudo yard gems

should do the job. You may also want to use the --rebuild flag. If you want to run a local Yardoc server for your installed gems, then run

yard server -g

Get and install a new RDoc template

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

How can I install ri and rdoc files for gems afterwards?


# See the relevant help.
gem help rdoc

# Generate rdoc and ri for the "foo" gem.
gem rdoc --ri foo

# Generate rdoc for all installed gems.
gem rdoc --all


Related Topics



Leave a reply



Submit