rich-rst 2.0.1


pip install rich-rst

  Latest version

Released: May 16, 2026


Meta
Author: Wasi Master

Classifiers

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Operating System
  • OS Independent

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

Natural Language
  • English

Logo

rich-rst

Documentation Status Tests Status CodeQL Status Codecov

Render reStructuredText with Rich. This package turns reST documents into Rich renderables so you can preview documentation, docstrings, and snippets directly in the terminal. Also includes a CLI.

Highlights

  • Supports all currently documented RST elements.
  • Handles common documentation features such as headings, lists, tables, links, images, code blocks, footnotes, and many Sphinx roles.
  • Provides both a Python API and a command-line interface.
  • Can also export rendered output to HTML from the CLI.

Installation

pip install rich-rst

Python API

from rich import print
from rich_rst import RestructuredText

document = """
rich-rst
========

This is a **test** document.

- Item one
- Item two

.. code-block:: python

   print("hello")
"""

print(RestructuredText(document))

The main constructor options are code_theme, show_line_numbers, show_errors, guess_lexer, default_lexer, sphinx_compat, and admonition_style.

Command Line Interface

Render a file:

python -m rich_rst readme.rst

Render from standard input:

python -m rich_rst -

View all available options:

python -m rich_rst --help

Useful flags include --code-theme, --show-line-numbers, --guess-lexer, --default-lexer, --show-errors, --admonition-style, --save-html, --html-theme, --list-html-themes, --output, and --version.

Compatibility

The renderer is designed for terminal output, so not every docutils feature can be represented visually. The current limitations and unsupported elements are documented in ELEMENTS.md.

Documentation

Changelog

See CHANGELOG.md.

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
rich (>=12.0.0)
pygments (>=2.0.0)