Assume I have the following rst file:
child_file.rst
=========
Chapter
=========
Sample text Sample text Sample text
----------
Section 1
----------
Sample text
****************
Section 1.1
****************
Sample text Sample text
----------
Section 2
----------
Sample text Sample text Sample text
The file is called into a sphinx toctree by another file, so:
parent_file.rst
.. toctree::
:maxdepth: 2
child_file.rst
Now, I do not want Section 1 to show up in the resulting toctree, but I do want Section 1.1 and Section 2 to be included. This means that I cannot just use the:titlesonly:
option for the ..toctree
directive.
I have seen similar questions for which the answer is to play around with :maxdepth:
, but I can't do that either since Section 2 is at the same depth as Section 1, and Section 1.1 is even deeper.
Are there any solutions?