Metadata-Version: 2.4 Name: rich-rst Version: 2.1.0 Summary: A beautiful reStructuredText renderer for rich Author-email: Wasi Master License-Expression: MIT Project-URL: Bug Tracker, https://github.com/wasi-master/rich-rst/issues Project-URL: Source, https://github.com/wasi-master/rich-rst Project-URL: Documentation, https://rich-rst.readthedocs.io/en/latest/ Project-URL: Say Thanks, https://saythanks.io/to/wasi-master Project-URL: Homepage, https://wasi-master.github.io/rich-rst Keywords: rich,rst,restructuredtext,terminal,docutils,renderer Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3.14 Classifier: Operating System :: OS Independent Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Natural Language :: English Description-Content-Type: text/markdown License-File: LICENSE License-File: rich_rst/_vendor/LICENSES.txt Requires-Dist: rich>=12.0.0 Requires-Dist: pygments>=2.0.0 Provides-Extra: docs Requires-Dist: docutils; extra == "docs" Requires-Dist: sphinx; extra == "docs" Requires-Dist: sphinx_copybutton; extra == "docs" Requires-Dist: sphinx_rtd_theme; extra == "docs" Provides-Extra: tests Requires-Dist: pytest; extra == "tests" Requires-Dist: pytest-cov; extra == "tests" Provides-Extra: dev Requires-Dist: ruff; extra == "dev" Requires-Dist: mypy; extra == "dev" Requires-Dist: pre-commit; extra == "dev" Dynamic: license-file

Logo

rich-rst

Documentation Status Tests Status CodeQL Status Codecov

Render [reStructuredText](https://docutils.sourceforge.io/rst.html) with [Rich](https://rich.readthedocs.io/en/latest/). 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 ```sh pip install rich-rst ``` ## Python API ```python 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: ```sh python -m rich_rst readme.rst ``` Render from standard input: ```sh python -m rich_rst - ``` View all available options: ```sh python -m rich_rst --help ``` Useful flags include ``--code-theme``, ``--show-line-numbers``, ``--guess-lexer``, ``--default-lexer``, ``--show-errors``, ``--admonition-style``, ``-S/--save-html``, ``--html-theme``, ``--list-html-themes``, ``--output``, ``--debug``, 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](ELEMENTS.md). ## Documentation - [Project documentation](https://rich-rst.readthedocs.io/en/latest/) - [Extension API guide](https://rich-rst.readthedocs.io/en/latest/extension_api.html) - [Source code](https://github.com/wasi-master/rich-rst) - [Issue tracker](https://github.com/wasi-master/rich-rst/issues) ## Changelog See [CHANGELOG.md](CHANGELOG.md).