# rich-rst
[![Documentation Status](https://readthedocs.org/projects/rich-rst/badge/?version=latest)](https://rich-rst.readthedocs.io/en/latest/?badge=latest)
Allows [rich](https://rich.readthedocs.io/en/latest/introduction.html) to print a [reStructuredText](https://docutils.sourceforge.io/rst.html) document in a rich format similar to [`rich.Markdown`](https://rich.readthedocs.io/en/latest/reference/markdown.html).
## Features
75 supported reStructuredText elements. For a list see [ELEMENTS.md](https://github.com/wasi-master/rich-rst/blob/main/ELEMENTS.md)
## Command line interface
Show the contents of readme.rst
```sh
python -m rich_rst readme.rst
```
Get from stdin
```sh
python -m rich_rst -
```
For more help see `python -m rich_rst --help`
## Usage
> Note: There are some aliases: RST, reST, ReStructuredText, reStructuredText, RestructuredText
```python
from rich_rst import RestructuredText
from rich import print
print(RestructuredText("This is a **test** document"))
```
![Demo of the usage](https://i.imgur.com/Nz6tc25.png "Demo of the usage")
## Advanced usage
```python
from rich_rst import RestructuredText
from rich import print
# Documentation for discord.py: https://pypi.org/project/discord.py
docs = "discord.py\n==========\n\n.. image:: https://discord.com/api/guilds/336642139381301249/embed.png\n :target: https://discord.gg/r3sSKJJ\n :alt: Discord server invite\n.. image:: https://img.shields.io/pypi/v/discord.py.svg\n :target: https://pypi.python.org/pypi/discord.py\n :alt: PyPI version info\n.. image:: https://img.shields.io/pypi/pyversions/discord.py.svg\n :target: https://pypi.python.org/pypi/discord.py\n :alt: PyPI supported Python versions\n\nA modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.\n\nKey Features\n-------------\n\n- Modern Pythonic API using ``async`` and ``await``.\n- Proper rate limit handling.\n- 100% coverage of the supported Discord API.\n- Optimised in both speed and memory.\n\nInstalling\n----------\n\n**Python 3.5.3 or higher is required**\n\nTo install the library without full voice support, you can just run the following command:\n\n.. code:: sh\n\n # Linux/macOS\n python3 -m pip install -U discord.py\n\n # Windows\n py -3 -m pip install -U discord.py\n\nOtherwise to get voice support you should run the following command:\n\n.. code:: sh\n\n # Linux/macOS\n python3 -m pip install -U \"discord.py[voice]\"\n\n # Windows\n py -3 -m pip install -U discord.py[voice]\n\n\nTo install the development version, do the following:\n\n.. code:: sh\n\n $ git clone https://github.com/Rapptz/discord.py\n $ cd discord.py\n $ python3 -m pip install -U .[voice]\n\n\nOptional Packages\n~~~~~~~~~~~~~~~~~~\n\n* PyNaCl (for voice support)\n\nPlease note that on Linux installing voice you must install the following packages via your favourite package manager (e.g. ``apt``, ``dnf``, etc) before running the above commands:\n\n* libffi-dev (or ``libffi-devel`` on some systems)\n* python-dev (e.g. ``python3.6-dev`` for Python 3.6)\n\nQuick Example\n--------------\n\n.. code:: py\n\n import discord\n\n class MyClient(discord.Client):\n async def on_ready(self):\n print('Logged on as', self.user)\n\n async def on_message(self, message):\n # don't respond to ourselves\n if message.author == self.user:\n return\n\n if message.content == 'ping':\n await message.channel.send('pong')\n\n client = MyClient()\n client.run('token')\n\nBot Example\n~~~~~~~~~~~~~\n\n.. code:: py\n\n import discord\n from discord.ext import commands\n\n bot = commands.Bot(command_prefix='>')\n\n @bot.command()\n async def ping(ctx):\n await ctx.send('pong')\n\n bot.run('token')\n\nYou can find more examples in the examples directory.\n\nLinks\n------\n\n- `Documentation <https://discordpy.readthedocs.io/en/latest/index.html>`_\n- `Official Discord Server <https://discord.gg/r3sSKJJ>`_\n- `Discord API <https://discord.gg/discord-api>`_\n\n\n"
print(RestructuredText(docs, code_theme="dracula", show_errors=False))
```
[![Demo of the advanced usage](https://i.imgur.com/MbtqM33.png "Demo of the advanced usage, truncated")](https://i.imgur.com/MbtqM33.png)
## Changelog
A changelog can be found in [CHANGELOG.md](https://github.com/wasi-master/rich-rst/blob/main/CHANGELOG.md)
Raw data
{
"_id": null,
"home_page": "https://wasi-master.github.io/rich-rst",
"name": "rich-rst",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "richrst, restructuredtextrich restructuredtextrich-restructuredtextrich rstrich-rst",
"author": "Wasi Master",
"author_email": "arianmollik323@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b0/69/5514c3a87b5f10f09a34bb011bc0927bc12c596c8dae5915604e71abc386/rich_rst-1.3.1.tar.gz",
"platform": null,
"description": "# rich-rst\r\n\r\n[![Documentation Status](https://readthedocs.org/projects/rich-rst/badge/?version=latest)](https://rich-rst.readthedocs.io/en/latest/?badge=latest)\r\n\r\nAllows [rich](https://rich.readthedocs.io/en/latest/introduction.html) to print a [reStructuredText](https://docutils.sourceforge.io/rst.html) document in a rich format similar to [`rich.Markdown`](https://rich.readthedocs.io/en/latest/reference/markdown.html).\r\n\r\n## Features\r\n\r\n75 supported reStructuredText elements. For a list see [ELEMENTS.md](https://github.com/wasi-master/rich-rst/blob/main/ELEMENTS.md)\r\n\r\n## Command line interface\r\n\r\nShow the contents of readme.rst\r\n\r\n```sh\r\npython -m rich_rst readme.rst\r\n```\r\n\r\nGet from stdin\r\n\r\n```sh\r\npython -m rich_rst -\r\n```\r\n\r\nFor more help see `python -m rich_rst --help`\r\n\r\n## Usage\r\n\r\n> Note: There are some aliases: RST, reST, ReStructuredText, reStructuredText, RestructuredText\r\n\r\n```python\r\nfrom rich_rst import RestructuredText\r\nfrom rich import print\r\n\r\nprint(RestructuredText(\"This is a **test** document\"))\r\n```\r\n\r\n![Demo of the usage](https://i.imgur.com/Nz6tc25.png \"Demo of the usage\")\r\n\r\n## Advanced usage\r\n\r\n```python\r\nfrom rich_rst import RestructuredText\r\nfrom rich import print\r\n\r\n# Documentation for discord.py: https://pypi.org/project/discord.py\r\ndocs = \"discord.py\\n==========\\n\\n.. image:: https://discord.com/api/guilds/336642139381301249/embed.png\\n :target: https://discord.gg/r3sSKJJ\\n :alt: Discord server invite\\n.. image:: https://img.shields.io/pypi/v/discord.py.svg\\n :target: https://pypi.python.org/pypi/discord.py\\n :alt: PyPI version info\\n.. image:: https://img.shields.io/pypi/pyversions/discord.py.svg\\n :target: https://pypi.python.org/pypi/discord.py\\n :alt: PyPI supported Python versions\\n\\nA modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.\\n\\nKey Features\\n-------------\\n\\n- Modern Pythonic API using ``async`` and ``await``.\\n- Proper rate limit handling.\\n- 100% coverage of the supported Discord API.\\n- Optimised in both speed and memory.\\n\\nInstalling\\n----------\\n\\n**Python 3.5.3 or higher is required**\\n\\nTo install the library without full voice support, you can just run the following command:\\n\\n.. code:: sh\\n\\n # Linux/macOS\\n python3 -m pip install -U discord.py\\n\\n # Windows\\n py -3 -m pip install -U discord.py\\n\\nOtherwise to get voice support you should run the following command:\\n\\n.. code:: sh\\n\\n # Linux/macOS\\n python3 -m pip install -U \\\"discord.py[voice]\\\"\\n\\n # Windows\\n py -3 -m pip install -U discord.py[voice]\\n\\n\\nTo install the development version, do the following:\\n\\n.. code:: sh\\n\\n $ git clone https://github.com/Rapptz/discord.py\\n $ cd discord.py\\n $ python3 -m pip install -U .[voice]\\n\\n\\nOptional Packages\\n~~~~~~~~~~~~~~~~~~\\n\\n* PyNaCl (for voice support)\\n\\nPlease note that on Linux installing voice you must install the following packages via your favourite package manager (e.g. ``apt``, ``dnf``, etc) before running the above commands:\\n\\n* libffi-dev (or ``libffi-devel`` on some systems)\\n* python-dev (e.g. ``python3.6-dev`` for Python 3.6)\\n\\nQuick Example\\n--------------\\n\\n.. code:: py\\n\\n import discord\\n\\n class MyClient(discord.Client):\\n async def on_ready(self):\\n print('Logged on as', self.user)\\n\\n async def on_message(self, message):\\n # don't respond to ourselves\\n if message.author == self.user:\\n return\\n\\n if message.content == 'ping':\\n await message.channel.send('pong')\\n\\n client = MyClient()\\n client.run('token')\\n\\nBot Example\\n~~~~~~~~~~~~~\\n\\n.. code:: py\\n\\n import discord\\n from discord.ext import commands\\n\\n bot = commands.Bot(command_prefix='>')\\n\\n @bot.command()\\n async def ping(ctx):\\n await ctx.send('pong')\\n\\n bot.run('token')\\n\\nYou can find more examples in the examples directory.\\n\\nLinks\\n------\\n\\n- `Documentation <https://discordpy.readthedocs.io/en/latest/index.html>`_\\n- `Official Discord Server <https://discord.gg/r3sSKJJ>`_\\n- `Discord API <https://discord.gg/discord-api>`_\\n\\n\\n\"\r\n\r\nprint(RestructuredText(docs, code_theme=\"dracula\", show_errors=False))\r\n```\r\n\r\n[![Demo of the advanced usage](https://i.imgur.com/MbtqM33.png \"Demo of the advanced usage, truncated\")](https://i.imgur.com/MbtqM33.png)\r\n\r\n## Changelog\r\n\r\nA changelog can be found in [CHANGELOG.md](https://github.com/wasi-master/rich-rst/blob/main/CHANGELOG.md)\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A beautiful reStructuredText renderer for rich",
"version": "1.3.1",
"project_urls": {
"Bug Tracker": "https://github.com/wasi-master/rich-rst/issues",
"Documentation": "https://rich-rst.readthedocs.io/en/latest/",
"Homepage": "https://wasi-master.github.io/rich-rst",
"Say Thanks": "https://saythanks.io/to/wasi-master",
"Source": "https://github.com/wasi-master/rich-rst"
},
"split_keywords": [
"richrst",
" restructuredtextrich restructuredtextrich-restructuredtextrich rstrich-rst"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fdbccc4e3dbc5e7992398dcb7a8eda0cbcf4fb792a0cdb93f857b478bf3cf884",
"md5": "5684c5fd317276ccc48c803e613339c8",
"sha256": "498a74e3896507ab04492d326e794c3ef76e7cda078703aa592d1853d91098c1"
},
"downloads": -1,
"filename": "rich_rst-1.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5684c5fd317276ccc48c803e613339c8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 11621,
"upload_time": "2024-04-30T04:40:32",
"upload_time_iso_8601": "2024-04-30T04:40:32.619694Z",
"url": "https://files.pythonhosted.org/packages/fd/bc/cc4e3dbc5e7992398dcb7a8eda0cbcf4fb792a0cdb93f857b478bf3cf884/rich_rst-1.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b0695514c3a87b5f10f09a34bb011bc0927bc12c596c8dae5915604e71abc386",
"md5": "b4a3671ec49e89e0626fc46852014f30",
"sha256": "fad46e3ba42785ea8c1785e2ceaa56e0ffa32dbe5410dec432f37e4107c4f383"
},
"downloads": -1,
"filename": "rich_rst-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "b4a3671ec49e89e0626fc46852014f30",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 13839,
"upload_time": "2024-04-30T04:40:38",
"upload_time_iso_8601": "2024-04-30T04:40:38.125041Z",
"url": "https://files.pythonhosted.org/packages/b0/69/5514c3a87b5f10f09a34bb011bc0927bc12c596c8dae5915604e71abc386/rich_rst-1.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-30 04:40:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "wasi-master",
"github_project": "rich-rst",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rich-rst"
}