将狮身人面像TOC分成小节和小标题

我有一个狮身人面像主文件,其中包括儿童文件如下:

.. toctree::
    :maxdepth: 2
    :numbered:

    doc1
    doc2
    doc3
    doc4
    doc5
    doc6 

我希望将TOC分成若干部分或小节,以便按以下方式呈现:

Part 1: Title of Part 1
   <doc1 TOC>
   <doc2 TOC>
Part 2: Title of Part 2
   <doc3 TOC>
   <doc4 TOC>
Part 3: Title of Part 3 
   <doc5 TOC>
   <doc6 TOC>

我目前的做法是创建伪子文档,列出其TOC中的实际文档,例如“part1.rst”将具有:

.. toctree::
    :maxdepth: 2
    :numbered:

    doc1
    doc2

然后在主文档中:

.. toctree::
    :maxdepth: 3
    :numbered:

    part1
    part2
    part3

这个问题是,当点击“part1”的链接时,你会被带到一个没有真正内容的页面(“part1.rst”)。

还有其他方法吗?

或者,有没有办法阻止“part1.rst”的条目生成页面链接?


一种选择是这样做的:

.. toctree::
    :maxdepth: 2
    :numbered:

    doc1
    doc2
    doc3

Subheading
-----------

.. toctree::
    :maxdepth: 2
    :numbered:

    doc4
    doc5
    doc6 
链接地址: http://www.djcxy.com/p/75505.html

上一篇: Divide Sphinx TOC into subsections with subheadings

下一篇: Intersphinx links to python 2 docs even with python 3 in intersphinx