Overview¶
The idea is to have a web interface documenting crabgrass code so developers can more easily review/find/understand the code.
RDoc in 20 seconds¶
- Regular ruby comments are used to document methods, classes, etc. Simply precede the item you want to document with a comment.
# open the file def open ...
- The comment for a file is pulled from the first comment block.
# this is a file level # comment. # this comment is ignored. # this comment documents the open method. def open ...
- to hide a method from rdoc, do this:
# :nodoc: def open .... end
- optionally, a .document file specifies which files will be included in that folder (.rb and .rbw are automatically included)
- RDoc uses SimpleMarkup. The format for simple markup is here
RDoc resources¶
Docs¶
- http://rdoc.sourceforge.net/
Tips¶
Interesting Examples¶
Running RDoc¶
We should configure rdoc to run whenever there are changes checked in.
Here is the option list currently being used (to create this output):
rdoc --main README_RDOC --all --diagram --force-update --image-format png --inline-source --line-numbers --title 'Crabgrass Rdoc' --op doc/rdoc app lib mods test tools README_RDOC doc/ADMIN_README doc/GEMS_README doc/MULTILINGUAL_README doc/SPHINX_README
A preliminary attempt is up at faloona.net/brandon/crabgrass-rdoc/ |
|
wow, that is so super cool. how did you get the README to look formatted right. Did you have to change the markup to be rdoc? Can you post some examples of methods documented with rdoc? |
|
I’ve uploaded the two files i altered. The rest was just rdoc doing it’s magic (+ several command line options). If we want to retain the readability of the main README, we should create a copy for rdoc to use as the initial file displayed. To add item specific comments, simply precede the method/class/etc with a comment! (see attached app/controllers/account_controller.rb) For files, the first comment block is used. Comments after that, unless they directly precede a method or class, are ignored. |
|
nice!!! wow. |
|