Sphinx generates an index named genindex
when building a documentation and therefore forbids to use that name for a document. Now, how would I include a link to that index in a table of contents?
I've tried this:
.. toctree::
:maxdepth: 2
genindex
api
Indices and tables
==================
* :ref:`genindex`
While the last line does create a link to that index in the document, the build doesn't know the reference when creating the TOC:
WARNING: toctree contains reference to nonexisting document 'genindex'
genindex , modindex , search. These are used for the general index, the Python module index, and the search page, respectively. The general index is populated with entries from modules, all index-generating object descriptions, and from index directives.
toctree is a Sphinx-defined directive in which you explicitly list documents whose TOCs will be listed out.
Create a File genindex.rst
with the following Content:
Index
=====
In your index.rst
add:
.. toctree::
:hidden:
genindex
If you you also want to have the Link and Text "Index" on the Site and not only in the left Navigation then remove :hidden:
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