A beautiful reStructuredText renderer for rich
Project Links
Meta
Author: Wasi Master
Classifiers
Programming Language
- Python
- Python :: 3
- Python :: 3.6
- Python :: 3.7
- 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
rich-rst
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 89 of the 98 documented docutils elements. See ELEMENTS.md for the full support matrix.
- 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, and sphinx_compat.
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, --hide-errors, and --save-html.
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.
2.0.0
Apr 02, 2026
2.0.0a7
Apr 05, 2026
2.0.0a6
Apr 04, 2026
2.0.0a4
Apr 03, 2026
2.0.0a3
Apr 03, 2026
2.0.0a2
Apr 03, 2026
2.0.0a1
Apr 03, 2026
1.3.2
Oct 14, 2025
1.3.1
Apr 30, 2024
1.3.0
Apr 25, 2024
1.2.0
Jan 26, 2024
1.1.7
Mar 08, 2022
1.1.6
Mar 08, 2022
1.1.5
Feb 10, 2022
1.1.4
Feb 10, 2022
1.1.3
Feb 08, 2022
1.1.2
Feb 07, 2022
1.1.0
Feb 07, 2022
1.0.1
Feb 06, 2022
1.0.0
Feb 06, 2022
1.0.0rc1
Feb 06, 2022
0.2.5
Feb 05, 2022
0.2.4
Nov 07, 2021
0.2.3
Oct 25, 2021
0.2.2
Oct 25, 2021
0.2.1
Oct 25, 2021
0.2.0
Oct 25, 2021
0.1.0
Sep 06, 2021