How to create a nested list in reStructuredText?

前端 未结 2 1192
时光说笑
时光说笑 2021-02-03 16:53

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
相关标签:
2条回答
  • 2021-02-03 16:56

    Make sure the nested list is indented to the same level as the text of the parent list (or three characters, whichever is greater), like this:

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

    Then you'll get the output you expected.

    0 讨论(0)
  • 2021-02-03 17:16

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

    #. X
    #. Y
    
       #. u 
       #. v 
    
    #. Z
    
    0 讨论(0)
提交回复
热议问题