Okay, I'm using Sphinx Autosummary to generate documentation for some classes. There are three different types of classes and I want my sidebar to have three distinct sections, like if I was using the :caption: option in the toctree directive.
So I added separated my autosummary directive into three smaller directives, and I put a hidden toctree in between them like so:
Section 1
.. toctree::
:hidden:
:caption: Section 1
.. autosummary
:toctree: stubs
myclass
anotherclass
Section 2
.. toctree::
:hidden:
:caption: Section 2
.. autosummary::
:toctree:
thirdclass
yields a sidebar like:
myclass
anotherclass
thirdclass
This doesn't work. The hierarchy of my index.html is exactly how I want it to look, but the sidebar is missing my Captions, they don't show up. When I add a page like self
under any of these hidden toctrees, the caption shows up:
Section 1
.. toctree::
:hidden:
:caption: Section 1
self
.. autosummary
:toctree: stubs
myclass
anotherclass
Section 2
.. toctree::
:hidden:
:caption: Section 2
.. autosummary::
:toctree:
thirdclass
yields a sidebar like:
SECTION 1 (caption)
Documentation Home
myclass
anotherclass
thirdclass
This is what I was looking for, but I don't want to reference self
or whatever. I just want the captions. How do I do this?