rich-rst

rich-rst is a reStructuredText renderer for the Rich library. It lets you render RST documents beautifully in the terminal, with full support for headings, code blocks, tables, admonitions, footnotes, and all rst elements. A kitchen sink style rendering reference can be viewed in Sphinx & RST Demo Gallery

Installation

Install the latest stable release from PyPI:

python -m pip install rich-rst

To install the development version directly from the main branch:

python -m pip install "git+https://github.com/wasi-master/rich-rst"

Note

On Linux and macOS you may need to use python3 instead of python. On Windows you can use py as a shorthand.

Quick start

Pass any RST string to RestructuredText and print it with Rich:

from rich import print
from rich_rst import RestructuredText

print(RestructuredText("Hello *World!*"))

For a full list of constructor parameters see the API reference.

Command-line interface

Render a file directly from the terminal:

python -m rich_rst README.rst

Read from standard input:

cat README.rst | python -m rich_rst -

Run python -m rich_rst --help for the full list of options.

Contributing

rich-rst is open source. The source code is hosted on GitHub. Bug reports and pull requests are welcome on the issue tracker.