naveendaftari
naveendaftari

Reputation: 81

Showing indentations in Sphinx output

I am trying to build a restructuredText file such that sphinx renders a hierarchy structure in html. How can I build the RST format to implement a printout like the following:

This

   Is

      An 

   Example

       output

Upvotes: 1

Views: 1638

Answers (1)

Steve Piercy
Steve Piercy

Reputation: 15045

.. code-block:: text where you manually indent the text is one option. If it is a file hierarchy, I like using tree to create the ASCII art diagram.

Nested lists are another. Note the rules for nesting.

Nested lists are possible, but be aware that they must be separated from the parent list items by blank lines:

* This

  * Is

    * An 

  * Example

    * output

If you don't care for the bullets, you could use CSS to remove them.

Upvotes: 2

Related Questions