Read Ruby documentation with highlighted code, clear headings and colored references. rich-ri wraps Ruby's RI reader and uses the documentation already installed for your Ruby and gems.
The same page in ri -f ansi and rich-ri, using the same terminal palette.
rich-ri adds Ruby syntax highlighting and keeps heading markers searchable.
Image details.
Requires Ruby 3.4 or later on Linux or macOS.
gem install rich-riRead a method:
rich-ri Array#map
rich-ri String#scanRDoc, which provides RI, is installed as a gem dependency. If a page is missing, see documentation sources.
Run rich-ri without a name for interactive lookup. Press Tab to discover
classes and methods; enter an empty line to leave. You can also
enable shell completion for Bash, Zsh or Fish,
and use ri as an alias.
Names follow RI conventions: Array#map is an instance method;
File::open is a class method. Class.method searches both kinds.
rich-ri Hash
rich-ri --all Array
rich-ri ruby:syntax/pattern_matching
rich-ri --helpIn less, use / to search, n for the next match and q to quit.
Search for ^=== to jump between level-three headings.
rich-ri --man opens the full manual.
The default colors follow your terminal palette. Ruby highlighting is built in; installing bat also highlights shell examples and other tagged languages.
rich-ri --theme=light Regexp
rich-ri --style='comment=bright_black' String#scan
rich-ri --no-color Array#mapSave preferences in ~/.config/rich-ri/config.yml:
theme: terminal
styles:
method: cyan
comment: bright_blackThe configuration reference covers themes, individual
styles, pager settings and environment variables. rich-ri --show-config prints
your effective settings.
- Reading documentation: lookup, pager navigation and your own project's docs.
- Shell completion and aliases.
- Troubleshooting and supported versions.
- Contributing: setup, tests and pull requests.
- Changelog and security policy.
Questions and bug reports are welcome in GitHub issues. Released under the MIT license.
