ChangingThePresent
The Few, The Proud, The Pradipta 416
CV

rdoc cheat sheet

bryan / 08.Feb.2008

draft

  =begin rdoc
  documentation
  =end
 def method
 end

OR 
 
 # documentation
 # documentation
 def method
 end

# documentation text blah blah
#    verbatim text because it is indented

 * bullet
 * bullet 
 or
 - bullet
 - bullet

 1. number 1 in list
 2. number 2 in list

 A. list item
 B. list item
 

 a. list item
 b. list item

   [list]   this is a list of definitions or terms or something

   list::   justified list with double colons
 
   list:: 
               i started here so the rest of this label will be indented the same

   = Level One Heading
   == Level Two Heading

 --- horizontal rule

 italics:         _word_  or text
 bold:	          *word* or text
 typewriter:	  +word+ or text
 \ will escape those

auto hyperlinked:
 MyClass
 my_class.rb
 def my_method; end;
 #my_method
 http:, mailto:, ftp:, www.
 link: (to local filesystem relative to --op)
 (urls to images are rendered as inline image tags)
 label[url] (uses label as hyperlink text)
 {multi word label}[url] (uses label as hyperlink text)

Documentation modifiers:

 # :yields: (params to block) 
 # :nodoc: (don't document)
 # :nodoc: all (don't documented all from here within scope)
 # :doc: (force something to be documented)
 # :notnew: (don't make a fake "new" method for initialize)
 #-- (start private, non-documented comment)
 #++ (stop private, non-documented comment)
 #:section:foo (start section called foo)
 #:call-seq: ?
 #:include:filename (include some file called filename here)
 #:title:text (set whole document title)
 #:enddoc: (stop documenting here)
 #:main:name
 #:stopdoc: / :startdoc: (start and stop documentation)

Sorry, comments are closed for this article.

back to top

micro theme by seaofclouds, and powered with Mephisto Hosting by hostingrails.com