LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

rdoc

Generate Ruby documentation from source code

TLDR

Generate documentation
$ rdoc [file.rb]
copy
Generate for directory
$ rdoc [lib/]
copy
Generate with title
$ rdoc --title "[Project Name]" [lib/]
copy
Output to directory
$ rdoc -o [doc/] [lib/]
copy
Show help for class
$ ri [Array]
copy

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
copy

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
copy

INSTALL

sudo apt install ruby
copy
sudo dnf install ruby
copy
sudo pacman -S ruby
copy
sudo apk add ruby-rdoc
copy
sudo zypper install ruby
copy
brew install ruby
copy
nix profile install nixpkgs#ruby
copy

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.

SEE ALSO

ri(1), yard(1), ruby(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid