| 1 |
Demonstration |
| 2 |
============= |
| 3 |
|
| 4 |
|
| 5 |
Some demos of how restructuredtext rendering looks. |
| 6 |
|
| 7 |
The demos are possible because rich has the feature to save console |
| 8 |
output to html files |
| 9 |
|
| 10 |
Demo Files |
| 11 |
---------- |
| 12 |
|
| 13 |
Console Output |
| 14 |
~~~~~~~~~~~~~~ |
| 15 |
|
| 16 |
- `directives.html <./directives.html>`__ |
| 17 |
- `introduction.html <./introduction.html>`__ |
| 18 |
- `rich_introduction.html <./rich_introduction.html>`__ |
| 19 |
- `roles.html <./roles.html>`__ |
| 20 |
- `specification.html <./specification.html>`__ |
| 21 |
|
| 22 |
Raw RST (Input) |
| 23 |
~~~~~~~~~~~~~~~ |
| 24 |
|
| 25 |
- `directives.rst <./directives.txt>`__ |
| 26 |
- `introduction.rst <./introduction.txt>`__ |
| 27 |
- `rich_introduction.rst <./rich_introduction.txt>`__ |
| 28 |
- `roles.rst <./roles.txt>`__ |
| 29 |
- `specification.rst <./specification.txt>`__ |
| 30 |
|
| 31 |
Parameters Used |
| 32 |
--------------- |
| 33 |
|
| 34 |
The following command was used the generate every file except ``rich_introduction.rst`` |
| 35 |
|
| 36 |
On Windows: |
| 37 |
|
| 38 |
.. code-block:: powershell |
| 39 |
|
| 40 |
rich_rst .\demo\filename.rst ^ |
| 41 |
--save-html .\demo\filename.html ^ |
| 42 |
--code-theme dracula ^ |
| 43 |
--default-lexer rst ^ |
| 44 |
--soft-wrap ^ |
| 45 |
--hide-errors |
| 46 |
|
| 47 |
On Linux/Mac |
| 48 |
|
| 49 |
.. code-block:: bash |
| 50 |
|
| 51 |
rich_rst ./demo/filename.rst \ |
| 52 |
--save-html ./demo/filename.html \ |
| 53 |
--code-theme dracula \ |
| 54 |
--default-lexer rst \ |
| 55 |
--soft-wrap \ |
| 56 |
--hide-errors |
| 57 |
|
| 58 |
.. note:: There are aliases available for those parameters |
| 59 |
|
| 60 |
For ``rich_introduction.rst``, The -dl parameter was set to python |
| 61 |
|
| 62 |
Sources |
| 63 |
------- |
| 64 |
|
| 65 |
Original HTML |
| 66 |
~~~~~~~~~~~~~ |
| 67 |
|
| 68 |
| ``directives.rst`` : |
| 69 |
https://docutils.sourceforge.io/docs/ref/rst/directives.html |
| 70 |
| ``specification.rst`` : |
| 71 |
https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html |
| 72 |
| ``introduction.rst`` : |
| 73 |
https://docutils.sourceforge.io/docs/ref/rst/introduction.html |
| 74 |
| ``mathematics.rst`` : |
| 75 |
https://docutils.sourceforge.io/docs/ref/rst/mathematics.html |
| 76 |
| ``roles.rst`` : |
| 77 |
https://docutils.sourceforge.io/docs/ref/rst/roles.html |
| 78 |
| ``rich_introduction.rst`` : |
| 79 |
https://rich.readthedocs.io/en/latest/introduction.html |
| 80 |
|
| 81 |
Original RST |
| 82 |
~~~~~~~~~~~~ |
| 83 |
|
| 84 |
| ``directives.rst`` : |
| 85 |
https://docutils.sourceforge.io/docs/ref/rst/directives.txt |
| 86 |
| ``specification.rst`` : |
| 87 |
https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.txt |
| 88 |
| ``introduction.rst`` : |
| 89 |
https://docutils.sourceforge.io/docs/ref/rst/introduction.txt |
| 90 |
| ``mathematics.rst`` : |
| 91 |
https://docutils.sourceforge.io/docs/ref/rst/mathematics.txt |
| 92 |
| ``roles.rst`` : https://docutils.sourceforge.io/docs/ref/rst/roles.txt |
| 93 |
| ``rich_introduction.rst`` : |
| 94 |
https://github.com/Textualize/rich/raw/master/docs/source/introduction.rst |
| 95 |
|