0

I want to separate my files hierarchy from my document hierarchy, I want to have four sections of the same level in different files, two in the same file and two in separated files, at the end i want the toctree refer to them in the same level.

main.rst

main
====


section 1
---------
something


section 2
---------
something


.. toctree::

    section3
    section4

section3.rst

section 3
---------
something

section4.rst

section 4
---------
something

With this code i have this result:

enter image description here

And this

enter image description here

But i want it to be in the same level, i want this result:

enter image description here

And this

enter image description here

In my case, the two first sections are small but the other are too long and i want them to be on their own file (and also in their own page when browsing so include is not a solution for me) and conserve the document hierarchy when browsing.

Thanks :D

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Nazime Lakehal
  • 1,542
  • 1
  • 11
  • 15

1 Answers1

0

try put a _ref tag before the toctree in main.rst

.. _ref-section3:
.. toctree::
   section3

.. _ref-section4:
.. toctree::
   section4