0

I am generating the documentation of a python project using Sphinx / sphinx-autodoc / sphinx_rtd_theme. Recently, I added type hints to my project which forced me to update Sphinx to the latest version (6.1) to handle these correctly. Since I updated Sphinx, all classes/functions description generated by autodoc (autoclass and automethod) now shows up in the table of content and I do not want that.

I found that I could manually add :noindex: to each autoclass/automethod directive, which almost works but it looks like there's a strange behaviour when I add :noindex: to all classes under a page. Although class and method disappear, the class members suddenly appears in the table of content.

Can I tell Sphinx to simply not put anything generated by autodoc in the table of content?

See the problem here:

  1. Master branch : Generated with Sphinx 1.3. Table of content is good, by method signature is polluted by typehints
  2. Dev branch : Sphinx 6.1 . Typehint is handled properly, but table of content is polluted by autoclass/automethod elements.
mzjn
  • 48,958
  • 13
  • 128
  • 248

1 Answers1

0

I just figured that there's a new option to control this behavior that is enabled by default and was not present in my conf.py (because it was coming from a years old config.

I just had to set : toc_object_entries = False in conf.py