Automatically add to toctree

14 views
Skip to first unread message

c.b...@posteo.jp

unread,
Jun 29, 2023, 11:18:42 AM6/29/23
to Sphinx users
Hello,

I have a working Sphinx project at
https://github.com/bit-team/backintime/tree/dev/common/doc-dev

When I want to add a new rst file (representing a new py file) I also
have to add the name of that file (without the rst extension) to a
"toctree". If not I do get "WARNING: document isn't included in any
toctree".

In my project the index.rst do "include" the modules.rst.
In that modules.rst all modules are listed explict:

.. toctree::
:maxdepth: 4

applicationinstance
askpass
backintime
bcolors
etcpp

It bothers me that I have to do this explicit. I often forget to do
this. Can't there be an auto-directive like this?

.. toctree::
:maxdepth: 4

[all_rst_files]

Thanks in advance
Christian Buhtz

Carl Gay

unread,
Jun 29, 2023, 12:40:29 PM6/29/23
to sphinx-users
I think the :glob: option for :toctree: may do what you need: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree
Reply all
Reply to author
Forward
0 new messages