I would like to present the output of a tree
command in a Restructured Text document. I am using this code:
.. code-block:: bash
project
├── demo.py
├── LICENCE.txt
├── processes
│ ├── area.py
│ └── bboxinout.py
├── pywps.cfg
├── requirements.txt
├── server.py
├── setup.py
├── static
├── templates
└── tests
Which is producing the following output:
I then tried to replace the tree
characters with unicode definitions, such as:
.. |hbar| unicode:: 01C0 ..
But the |hbar|
sequence is printed verbatim when used inside a code block.
Is there any other way to force these characters to be printed correctly?
RST is a powerful and straightforward markup language that, in combination with Sphinx, provides a wide range of facilities for intelligent and appealing documentation creation. It uses simple and implicit syntax to introduce a variety of content elements such as titles, code blocks, vertical lists, and many others.
reStructuredText (RST, ReST, or reST) is a file format for textual data used primarily in the Python programming language community for technical documentation.
In ReST, I use literal blocks to represent tree structures:
::
project
├── demo.py
├── LICENCE.txt
├── processes
│ ├── area.py
│ └── bboxinout.py
├── pywps.cfg
├── requirements.txt
├── server.py
├── setup.py
├── static
├── templates
└── tests
I hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With