0

I have some sphinx documentation inside my docs/ folder. There I have a typical structure of some handwritten and dynamically generated documentation from code (Python). I would like to have a very simple README.rst for people opening the repo. In that README.rst I would like to have the whole TOC displayed of the Sphinx documentation. It would look something like that:


About section etc.
==================

blah blah blah

For more check out the documentation

.. here the automatically imported TOC tree

How can I do that?

mzjn
  • 48,958
  • 13
  • 128
  • 248
John
  • 871
  • 2
  • 9
  • 20

1 Answers1

0

For a table of contents in Sphinx you should use toctree:

.. toctree::
   :maxdepth: 2

   doc1
   doc2
   etc..

And if you generate all docs, then it's nice to use "globbing" to include everything automatically:

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

   *

For more details look into the docs about toc


here's an example in cython docs

enter image description here

and here's an index.rst file enter image description here

0dminnimda
  • 1,242
  • 3
  • 12
  • 29
  • @John if this answer helped you or you like it, please do not forget to [vote up and mark the answer as a solution](https://stackoverflow.com/help/someone-answers), I would really appreciate it. – 0dminnimda Feb 26 '22 at 22:13