rdoc
TLDR
Generate documentation
$ rdoc [file.rb]
Generate for directory$ rdoc [lib/]
Generate with title$ rdoc --title "[Project Name]" [lib/]
Output to directory$ rdoc -o [doc/] [lib/]
Show help for class$ ri [Array]
SYNOPSIS
rdoc [options] [files...]
DESCRIPTION
RDoc generates documentation from Ruby source files. It parses comments and code structure to create HTML documentation or ri data files.
PARAMETERS
-o, --output dir
Output directory.--title text
Documentation title.-f, --format format
Output format (html, ri).-m, --main file
Main page file.-x, --exclude pattern
Exclude files.-a, --all
Include all methods.
EXAMPLES
$ # Generate HTML docs
rdoc lib/
# With options
rdoc --title "My Gem" --main README.md lib/
# Generate ri data
rdoc -f ri lib/
# Exclude tests
rdoc -x test lib/
# View with ri
ri String#split
ri Array
rdoc lib/
# With options
rdoc --title "My Gem" --main README.md lib/
# Generate ri data
rdoc -f ri lib/
# Exclude tests
rdoc -x test lib/
# View with ri
ri String#split
ri Array
DOCUMENTATION FORMAT
$ # Main description of class
#
# == Usage
# obj = MyClass.new
#
# @param name [String] the name
# @return [Boolean] success status
class MyClass
# Method description
def my_method(name)
end
end
#
# == Usage
# obj = MyClass.new
#
# @param name [String] the name
# @return [Boolean] success status
class MyClass
# Method description
def my_method(name)
end
end
CAVEATS
Part of Ruby standard library. Alternative: YARD for enhanced features.
HISTORY
RDoc was created by Dave Thomas for Ruby documentation, included in Ruby since version 1.8.


