Skip to content
hvpaivaPublic

About

๐Ÿ“– A colorful Ruby documentation reader with syntax highlighting and shell completion.

Resources

Code of conduct

Contributing

Security policy

Stars

14 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

69 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

rich-ri

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 complete Object#then page: ri -f ansi on the left, rich-ri on the right, with highlighted Ruby method chains, strings, constants and symbols.

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.

Install and read

Requires Ruby 3.4 or later on Linux or macOS.

gem install rich-ri

Read a method:

rich-ri Array#map
rich-ri String#scan

RDoc, 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.

Find your way around

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 --help

In 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.

Choose your colors

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#map

Save preferences in ~/.config/rich-ri/config.yml:

theme: terminal
styles:
  method: cyan
  comment: bright_black

The configuration reference covers themes, individual styles, pager settings and environment variables. rich-ri --show-config prints your effective settings.

More

Questions and bug reports are welcome in GitHub issues. Released under the MIT license.

About

๐Ÿ“– A colorful Ruby documentation reader with syntax highlighting and shell completion.

Resources

Code of conduct

Contributing

Security policy

Stars

14 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages