Creating Rdoc for rails Application

I would like to create documentation for my rails project (2.3.8). When i tried

rake doc:rails rake doc:rerails 

It creates documentation for all classes, including standard ruby โ€‹โ€‹classes and all ruby โ€‹โ€‹files in the vendor directory (plugins, etc.).

How to create rdoc documentation only for ruby โ€‹โ€‹classes, files in the following directories

  • application folder (all models, controllers and views)
  • configuration folder
  • lib folder
+6
source share
2 answers

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 in a rails 3 application, but I think this works the same way.

+9
source

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

Quote from section 2.4 of the Rails guide :

The doc: namespace domain has tools for creating documentation for your application, API documentation, and a guide. The documentation can also be deleted, which is mainly useful for losing weight in your code base, for example, if you wrote a Rails application for the embedded platform.

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

+4
source

Source: https://habr.com/ru/post/896461/


All Articles