reStructuredText Multilevel

不打扰是莪最后的温柔 提交于 2019-12-24 06:41:04

问题


How can I get such a structur with reStructuredText? Is it even possible?

1. Title
    1.1 Subtitle
         1.1.2 SubSubtitle
             1.1.2.1 SubSubtitle
    1.2 2ndSubtitle
         1.2.1 2ndSubSubtitle

回答1:


Did you look at the Sphinx documentation for nested lists? Your question should show that you made some effort, including what documentation you read, what you tried, what you expected, and what you observed.

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

* this is
* a list

  * with a nested list
  * and some subitems

* and here the parent list continues

Substitute #. for *.




回答2:


So I found the answer here:

Title
=====
   Subtitle
   --------
     ___________
     SubSubtitle
     ___________

        SubSubSubtitle 1
        ________________

        SubSubSubtitle 2
        ________________  

     _____________
     SubSubtitle 2
     _____________         

Title 2
=======

The Output would be (if numbered doctree):

1. Title
   1.1 Subtitle
       1.1.1 SubSubtitle
             1.1.1.1 SubSubSubtitle 1
             1.1.1.2 SubSubSubtitle 2
       1.1.2 SubSubtitle 2
2. Title 2

For more information check out: http://docutils.sourceforge.net/docs/user/rst/quickstart.html#sections



来源:https://stackoverflow.com/questions/44912601/restructuredtext-multilevel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!