假設我們有兩個文本file1.rst和file2.rst他們的内容如下
file1.rst
file1 title1
============
這裡是段落内容
file1 title1.1
--------------
這裡是内容
file1 title1.2
--------------
這裡是内容
file2.rst
file2 title1
=============
這裡是段落内容
file2 title1.1
--------------
這裡是内容
file2 title1.1
--------------
這裡是内容
下面是index.rst内容
.. toctree::
:maxdepth: # 2表示在索引中添加各個檔案的2級标題
:numbered: # 如果有多個章節則可以進行編号
intro # 添加檔案,不需要寫字尾
:maxdepth: 1
:maxdepth: 2
:numbered:
參考文獻:
http://zh-sphinx-doc.readthedocs.io/en/latest/markup/toctree.html