The structure of my project that I want to document is as follows:
/top
Index.rst
/a
toctree_a.rst (contains doc and doc2)
doc.rst
doc2.rst
/b
toctree_b.rst (contains doc4 and doc3)
doc3.rst
doc4.rst
I want to reference the toctree
s in the sub-directories (a and b) so that the project toctree
can see the 4 documents in the project tree.
I know how do do this when the documents are in one directory, but I don't know how to do this if I have them in a subdirectory. I am trying to keep the structure of my project intact without having to move all files into one directory. I have done some research, and found that .. include:: directive
may be the route to go, but I could not figure out how to use it properly.
you can tell your toctree in your index.rst to get the file from a sub-directory like so:
Contents:
.. toctree::
:maxdepth: 2
a/doc
a/doc2
b/doc3
b/doc4
That method works just like they would be in the same directory
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