rich-rst


توضیحات

A beautiful reStructuredText renderer for rich
ویژگی مقدار
سیستم عامل OS Independent
نام فایل rich-rst-2.2.0
نام rich-rst
نسخه کتابخانه 2.2.0
نگهدارنده []
ایمیل نگهدارنده []
نویسنده -
ایمیل نویسنده Wasi Master <arianmollik323@gmail.com>
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/rich-rst/
مجوز -
<p align="center"> <a href="https://github.com/wasi-master/rich-rst"> <img src="https://raw.githubusercontent.com/wasi-master/rich-rst/main/logo.png" alt="Logo" width="200" height="200"> </a> <h1 align="center">rich-rst</h2> </p> <p align="center"> <a href="https://rich-rst.readthedocs.io/en/latest/?badge=latest"><img src="https://readthedocs.org/projects/rich-rst/badge/?version=latest" alt="Documentation Status"></a> <img src="https://img.shields.io/github/actions/workflow/status/wasi-master/rich-rst/tests.yaml?label=tests" alt="Tests Status"> <img src="https://img.shields.io/github/actions/workflow/status/wasi-master/rich-rst/codeql.yml?label=codeql" alt="CodeQL Status"> <img src="https://img.shields.io/codecov/c/github/wasi-master/rich-rst" alt="Codecov"> </p> 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`, `admonition_style`, and `allow_file_access`. Directives that read other files (`include`, `literalinclude`, and `raw`/`csv-table` with `:file:` or `:url:`) are disabled by default. Pass `allow_file_access=True` to enable them, but only for markup you trust. ## 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``, ``--allow-file-access``, ``--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).


نیازمندی

مقدار نام
- rich>=12.0.0
- pygments>=2.0.0
xtr docutils;
xtr sphinx;
xtr sphinx_copybutton;
xtr sphinx_rtd_theme;
xtr pytest;
xtr pytest-cov;
xtr ruff;
xtr mypy;
xtr pre-commit;


نحوه نصب


نصب پکیج whl rich-rst-2.2.0:

    pip install rich-rst.whl


نصب پکیج tar.gz rich-rst-2.2.0:

    pip install rich-rst.tar.gz