Exclude current document sections from sphinx toctree

731 Views Asked by At

I have rst document like:

######
Title
######

.. toctree::
  :hidden:
  :titlesonly:

  subpage1
  subpage2
  subpage3

Section1
---------

Section2
---------

This results in toctree

 Title
  subpage1 title
  subpage2 title
  subpage3 title
  Section1
  Section2

Is there a way to remove the Section1 and Section2 from the toctree - I want in it, only what I explicitly stated

1

There are 1 best solutions below

3
Jeni On

It seems adding :titlesonly: to the parent document toctree directive achieved what I wanted.