Questions tagged [toctree]

Use this tag for questions about the toctree Sphinx directive. This directive is used to interconnect documentation files, other toctrees, and tables of contents.

.. toctree:: is a directive of the Python Sphinx document generation tool used to interconnect documentation files, other toctrees, and tables of contents.

This tag serves to distinguish questions specific to the specialized Sphinx .. toctree:: directive from other tables-of-contents (ToC) that may coexist, or be generated, in the same context. For example the reST ToC directive, or a LaTex ToC among others, in which case the generic should be used.

Additionally, this tag serves to filter questions that -altough textually containing the word "toctree"- are not about the directive in itself.

This tag can stand alone, but should be used in conjunction with the parent tag .

For official documentation on the .. toctree:: directive.

160 questions
2
votes
1 answer

How to Link Local Python Help Documents Using Sphinx

How can I get my Sphinx RST file to include a link to the "contents.html" Python help page? More Details I have an RST help document (index.rst) in an offline environment. I have downloaded and successfully built the Python documentation using the…
Jeff G
  • 4,470
  • 2
  • 41
  • 76
2
votes
1 answer

How to generate Python package documentation with Sphinx

Currently I do this: conf.py: autosummary_generate = True reference.rst: package_1 --------- .. autosummary:: :toctree: _generated package_1.module_1 package_1.module_2 package_1.module_3 ... This will generate an overview table…
mar10
  • 14,320
  • 5
  • 39
  • 64
2
votes
1 answer

Sphinx - what is different between toctree and content?

I can create table of contents in two ways: .. contents:: :local: depth: 1 or as .. toctree:: :maxdepth: 1 index What is difference? Where I should use the toctree and where the contents?
matousc
  • 3,698
  • 10
  • 40
  • 65
2
votes
0 answers

Is it possible to mix external links and includes in the toctree (ordered)?

I need to include the page content and some external links in the toctree of my sphinx documentation, in the correct order Suppose this is my structure: ======= Test ======= .. toctree:: :hidden: Test Some…
super-qua
  • 3,148
  • 1
  • 23
  • 30
2
votes
1 answer

How do I insert front matter in latexpdf output in Sphinx

We are considering using Sphinx where I work and it appears to do everything we need. However, I am having issues getting it to match the required corporate template, which requires there to be some front matter pages inserted between the title…
2
votes
2 answers

Templating Sphinx's sidebar toctree

I am trying to make a new Sphinx template, which would create a custom toctree for the sidebar. Using the Jinja templating language, there seems to be only one function available: toctree() which displays all the toctree at once but I need to loop…
fffred
  • 596
  • 4
  • 19
2
votes
2 answers

Section titles in the Sphinx sidebar

Is there any way to add section titles in the left menu of Sphinx documentation? I know you can do it if you use MkDocs (for example here), but is there a way to do this in Sphinx and ReSTructured text? I want to divide my documentation into…
ostrokach
  • 17,993
  • 11
  • 78
  • 90
2
votes
1 answer

Headings of different files do not match

I have a very basic setup in Sphinx. The TOC is as follows: .. toctree:: :maxdepth: 3 one two And the files one and two look like this: one.rst #### Part #### ******* Chapter ******* Section ======= two.rst: *************** Another…
2
votes
1 answer

Change Sphinx's template for table of contents

I am using Sphinx with my own template to get a documentation style like the twitter bootstrap documentation: http://getbootstrap.com/2.3.2/getting-started.html There you can see the navigation on the left, which is static and stays at the same…
tester
  • 3,977
  • 5
  • 39
  • 59
2
votes
1 answer

Location of Sphinx sources for my notes - WARNING: document isn't included in any toctree

How can you fix the Sphinx's warning at the bottom? I am trying to have my Python notes in Sphinx. I have my notes in separate files at the same directory level as the index.rst. I get the following warnings after building HTML The…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
2
votes
1 answer

How do I include all documents in the Sphinx globaltoc sidebar?

I would like every single document in the entire TOC to be included in the globaltoc sidebar. How do I achieve this? In theme files, there are calls to {{ toctree() }}, but I don't know what toctree() refers to.
jameshfisher
  • 34,029
  • 31
  • 121
  • 167
2
votes
2 answers

Explicit Title for toctree in Sphinx

I am trying to explicitly set the title of an element in my toctree. The documentation says it should be this: .. toctree:: All about strings But it just prints the title of what's in the string.rst document, and not "All about…
dvreed77
  • 2,217
  • 2
  • 27
  • 42
1
vote
1 answer

Side bar navigation incomplete in Sphinx

I made a Sphinx project with an index file and two other rst files called firstdoc.rst and seconddoc.rst. My index.rst has the following toctree: .. toctree:: :maxdepth: 2 :caption: Contents: firstdoc seconddoc I ran make html after…
user3425506
  • 1,285
  • 1
  • 16
  • 26
1
vote
0 answers

Generate different TOCs for subfolders within the same project in Sphinx

Following the instructions about conditional text in Sphinx, I created three different build subdirectories in one project to generate three custom contents from the same source (e.g. source-file -> output1 for users, output2 for admins, output3 for…
N_user
  • 37
  • 6
1
vote
0 answers

How to expand and collapse the table of content

I am trying to document some of my python codes. I am using the sphinx_rtd_theme. I have added a simple table of content by doing: Welcome to my documentation! =========================================== .. toctree:: :maxdepth: 5 :caption:…
Leo
  • 479
  • 2
  • 6
  • 16