I want to do multiple versions of a documentation, which differ in the sections that are included. To achieve this I would usually use either the only directive or the ifconfig extension. However, I cannot use any of those in combination with the toctree directive.
What I basically want is something like this:
.. toctree::
:maxdepth: 2
intro
strings
datatypes
numeric
.. only:: university
complex
Is there a way to do that?
.. toctree is a Sphinx-defined directive in which you explicitly list documents whose TOCs will be listed out.
GEN has partnered with American City Business Journals to create the GEN Index, a regional ranking of equity-centered workplaces.
A directive (ref) is a generic block of explicit markup. Along with roles, it is one of the extension mechanisms of reST, and Sphinx makes heavy use of it. Docutils supports the following directives: Admonitions: attention, caution, danger, error, hint, important, note, tip, warning and the generic admonition.
A very simple solution is to maintain two separate index files under different names. You can specify which index file to use by default in conf.py
and override it for a special build using -D master_doc=alternate-index
on the sphinx-build
command line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With