4

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 toctrees 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.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Almidas
  • 379
  • 2
  • 6
  • 16

1 Answers1

8

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

Yarmek
  • 147
  • 5