好的,我正在使用Sphinx Autosummary为一些类生成文档。这里有三种不同类型的类,我希望我的侧边栏有三个不同的部分,就像我在使用toctree指令中的:caption:选项一样。
因此,我将我的autosummary指令分成了三个较小的指令,并在它们之间放置了一个隐藏的toctree,如下所示:
Section 1
.. toctree::
:hidden:
:caption: Section 1
.. autosummary
:toctree: stubs
myclass
anotherclass
Section 2
.. toctree::
:hidden:
:caption: Section 2
.. autosummary::
:toctree:
thirdclass
产生一个类似侧边栏的效果:
myclass
anotherclass
thirdclass
这不起作用。我的index.html的层次结构正是我想要的,但侧边栏缺少我的标题,它们没有显示出来。当我在任何这些隐藏的toctrees下添加一个像self
这样的页面时,标题就会显示出来:
Section 1
.. toctree::
:hidden:
:caption: Section 1
self
.. autosummary
:toctree: stubs
myclass
anotherclass
Section 2
.. toctree::
:hidden:
:caption: Section 2
.. autosummary::
:toctree:
thirdclass
产生一个类似于侧边栏的效果:
SECTION 1 (caption)
Documentation Home
myclass
anotherclass
thirdclass
这正是我在寻找的,但我不想引用self
或其他内容。我只想要字幕。如何实现?