Sphinx ignoring `toctree` options

1.5k Views Asked by At

I am new to Sphinx and I am trying to include a toctree in Sphinx but it seems to be completely ignoring my toctree options.

I have code as shown below:

.. toctree::
   :titlesonly:

  foo
  bar

This is also ignored:

.. toctree::
   :maxdepth: 1

  foo
  bar

With the resulting output looking something like this:

  • Foo
    • Foo1
      • Foo12
    • Foo2
  • Bar
    • Bar1
      • Bar12
    • Bar2

I am running make html to produce the HTML documents and I suppose it's possible I have a setting wrong in my conf.py file.

1

There are 1 best solutions below

1
On BEST ANSWER

Consistent indentation is important. Move the names of the toctree entries one column to the right, and it will work.

.. toctree::
   :maxdepth: 1

   foo
   bar