On Monday, 8 April 2019 21:58:44 UTC+2, Mosquito wrote: > Is there a way that I can automatically include the documentation of each > of these individual plugins when I build the entire framework? > > This portion of documentation provides details on how to utilize the > plugins. > > .. toctree:: > :maxdepth: 2 > > ../plugins/plugin1/docs/readme > ../plugins/plugin2/docs/readme > ../plugins/plugin3/docs/readme > > This isn't scale-able to a decent number of plugins. It's also error prone > (ie. I forget to add it, or a contributor forgets to add it). Is there a > way to say "build all of the documentation in all subdirectories of > "plugins" and properly link to them in the main project's docs? >
Yes, the toctree directive takes 'glob' as an option (docs <https://www.sphinx-doc.org/en/2.0/usage/restructuredtext/directives.html?highlight=glob#directive-toctree>), which enables matching files similarly to shell globbing patterns (single-asterisk matches until next folder, double-asterisk matches in any depth). You could use *for example*: - ../plugins/plugin*/docs/readme - ../plugins/*/docs/readme - ../plugins/**/docs/* Full example: .. toctree:: :maxdepth: 2 :glob: ../plugins/**/docs/readme HTH -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.
