How to create a nested list in reStructuredText?

I am trying to create a properly nested list using the following code (following Sphinx and docutils docs):

1. X a. U b. V c. W 2. Y 3. Z 

I expect this to lead to two OL , but instead I get the following output:

 <ol class="arabic simple"> <li>X</li> </ol> <blockquote> <div> <ol class="loweralpha simple"> <li>U</li> <li>V</li> <li>W</li> </ol> </div> </blockquote> <ol class="arabic simple" start="2"> <li>Y</li> <li>Z</li> </ol> 

What am I doing wrong? Is it impossible to get the following result?

 <ol class="arabic simple"> <li>X <ol class="loweralpha simple"> <li>U</li> <li>V</li> <li>W</li> </ol> </li> <li>Y</li> <li>Z</li> </ol> 
+55
markup restructuredtext python-sphinx
Apr 05 2018-11-11T00:
source share
2 answers

Make sure the nested list is indented at the same level as the text of the parent list, for example:

 1. X a. U b. V c. W 2. Y 3. Z 

Then you get the expected result.

+68
Apr 05 2018-11-11T00:
source share

If you want Sphinx to take care of the numbering for you, do it.

 #. X #. Y #. u #. v #. Z 
+16
Nov 15 '13 at 16:45
source share



All Articles