A Python library that provides a beautiful reStructuredText renderer, integrating with the `rich` library to display reStructuredText documents with syntax highlighting and rich formatting directly in the terminal. It's currently at version 1.3.2 and maintains an active release cadence with regular updates and bug fixes.
pip install rich-rstVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import `RestructuredText` from `rich_rst` and use it with `rich.print` to render a reStructuredText string directly to your terminal with rich formatting.
Upgrade `rich-rst` to the latest version (`pip install --upgrade rich-rst`) to ensure compatibility with recent `docutils` versions.
Upgrade to `rich-rst` version 1.3.0 or newer to mitigate `optparse` deprecation warnings from `docutils`.
Simplify complex reStructuredText structures if rendering fidelity in the terminal is critical, or be prepared for minor visual discrepancies in highly advanced documents.
pip install rich-rst
from rich_rst import RestructuredText from rich.console import Console console = Console() rst_content = "Hello *World*!" rst_renderer = RestructuredText(rst_content) console.print(rst_renderer)
from rich_rst import RestructuredText # ... then use RestructuredText to render your content