0

I want to be able to set toctree documents one at a time in my document, then on the same document redisplay the toctree. Textually, my question is hard to understand, so just refer to my example.

This is my current document called project-structure.rst: project-structure.rst

This is what the code looks like: https://pastebin.com/dzWhZwzm

Briefly, this is what I do in the code:

Description of build folder...
.. toctree::
    :maxdepth: 3

Description of src folder...
.. toctree::
    :maxdepth: 3

Basically, I add 6 documents to the toctree with six toctree statements so I can comment about every document in the toctree.

I want to display the toctree of project-structure.rst at the very bottom of project-structure.rst once again at the bottom without having comments describing each document. Is there a way to do this? I would rather not do links because I still want to be able to show depth levels of the documents.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
JigsawCorp
  • 479
  • 2
  • 6
  • 15
  • I don't think there is anything stopping you from having a seventh `toctree` directive that includes all the documents. – mzjn Jun 04 '19 at 08:17
  • @mzjn Wouldn't that just add all the documents a second time? Hence, making my toctree twice as big as I want it to. – JigsawCorp Jun 04 '19 at 11:18
  • I thought that this was what you wanted. You wrote "I want to display the toctree... **once again** at the bottom". – mzjn Jun 04 '19 at 11:24
  • @mzjn I want to display it again, not add all the docs to it. Basically, I want to add 6 documents to my toctree one by one and display them one by one. Then, at the end, I want to display the whole toctree again. If I do an other toctree at the end with all documents, this is simply going to add the same 6 documents to my toctree structure. I don't want to change the structure of the tree, I simply want to display it without adding docs to it. – JigsawCorp Jun 04 '19 at 11:28
  • What do you mean by "display the whole toctree again"? At that point you have included six different toctrees with one document in each. There is no "whole" toctree that you can display "again". I probably don't understand the question at all. What exactly is the problem that you are trying to solve? – mzjn Jun 04 '19 at 11:34
  • @mzjn This is indeed a bizarre thing, but an example will help understand. Look at the picture I provided in my post, this is what it currently looks like. I add one by one a doc in the toctree and then give a description of that doc. What I am doing is making a project structure page where people can browse the source code structure and understand what each folder does with my comments. I comment every doc, because each doc represents one folder. What I want to do is once I have described each folder one by one, is to display the whole toctree at the end without being surrounded by comments. – JigsawCorp Jun 04 '19 at 11:49
  • @mzjn This is what I currently have, https://i.stack.imgur.com/oLrr3.png, each folder(which are the docs) is given a short description. I want to have this at the end of the same doc: https://imgur.com/a/bjILiLF. This second picture is what I want to add at the end, which would basically be displaying the toctree I created previously. That way, people can have an overview of the project structure without having it surrounded by comments,which makes seeing the overview a bit more difficult. – JigsawCorp Jun 04 '19 at 11:53
  • OK. But as I wrote, there is no "whole toctree". You have six separate toctrees. I guess it would be possible to write a Sphinx extension that somehow reassembles these toctrees into a "whole toctree". But there is nothing built-in for this. In addition, please edit the question to clarify things instead of piling up comments. – mzjn Jun 04 '19 at 12:02

0 Answers0