Skip to content Skip to sidebar Skip to footer

Collapse All :glob:-discovered Files Into One Toc Entry

I've got something like this: .. toctree:: :maxdepth: 2 :caption: Contents: :hidden: :glob: docs frontend backend tools/* I'd like all the documents found

Solution 1:

source/index.rst:

.. toctree::
   :maxdepth: 2:caption: Contents::glob:

   tools/_tools
   docs
   frontend
   backend
   tmp/*

Old source/tools/_tools.rst:

Notes on tools
**************

.. include:: black.rst
.. include:: docker.rst
.. include:: git_hooks.rst
.. include:: github_webhooks.rst
.. include:: mypy.rst
.. include:: pipm.rst
.. include:: poetry.rst
.. include:: sphinx.rst
.. include:: uvicorn.rst

New source/tools/_tools.rst:

Notes on tools
**************

.. toctree::
   :maxdepth: 2
   :glob:

   *

The new one renders exactly like the old one, and is more versatile an a lot cleaner.

Post a Comment for "Collapse All :glob:-discovered Files Into One Toc Entry"