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
3
votes
1 answer

Sphinx toctree contains reference to nonexisting document

I am very new to Sphinx. Doc says it is easy to set up - maybe so but I am having a bear of a time. I finally have .rst files being created but while I have updated index.rst I am getting this error. I confirmed the .rst files exist in the /docs…
efultz
  • 1,135
  • 2
  • 11
  • 26
3
votes
0 answers

How can I use different master_docs in HTML and LaTeX?

Because of discrepancies in the ways indexes and toctree captions are processed by builders, I'd like to use a different 'master' document for the HTML and LaTeX builds of my Sphinx document. The following almost works: def set_master_doc(app): …
Clément
  • 12,299
  • 15
  • 75
  • 115
3
votes
2 answers

Image and table of contents side by side in Restructured Text with python-Shinx

I have been using Sphinx to make a nice documentation of my code and I would like to know if it's possible to place an image next to the table of contents (instead of a big white space without anything) For now, my beginner's index.rst file looks…
Micawber
  • 707
  • 1
  • 5
  • 19
3
votes
1 answer

Sphinx RST expand subpages in html output

I'm using the sphinx documentation system to generate reports in both HTML and Latex output formats. So have a hierarchical structure where I have a read index.rst which contains a toctree that references all chapters in order of appearance. Then a…
user2882307
3
votes
1 answer

How to reset numbered sections in Sphinx?

I have several documents that are independant from each others: index.rst foo.rst bar.rst conf.py Makefile I would like to access foo.rst from index.rst, but I would like the two subdocuments to start their numbering at 1. In index.rst I have: ..…
nowox
  • 25,978
  • 39
  • 143
  • 293
3
votes
0 answers

Remove redundant toctree from sidebar in sphinx

Edit: this other post seems related I am using the fulltoc extension to display the table of contents in the sidebar. The global table of contents is defined in the global index.rst file. It is actually composed of a series of toctrees basically: ..…
leafmeal
  • 1,824
  • 15
  • 15
3
votes
1 answer

Listing local sections first, linked pages last in TOC

Let's say I have the following index.rst: Some global topic ===================== .. toctree:: :glob: nested/index Global topic introduction ------------------------ And nested/index.rst: Some sub-topic ============== I want TOC to be…
EugZol
  • 6,476
  • 22
  • 41
3
votes
0 answers

Sphinx toctree, automodule all html in one page

I am using Sphinx to document my Python project. My issue is all my python files under Table of Content, are listed under one page. This is what I have so far. I would file to have Python_file_1,Python_file_2 and Python_file_3 in different html…
mtkilic
  • 1,213
  • 1
  • 12
  • 28
2
votes
1 answer

Using javascript instead of Sphinx's default toctree

I'm using sphinx to auto-generate html pages. The Table of Contents is really long so I'm trying to add a new html class (among other things) to the toctree's div so I can use a javascript library. Basically wanting to change how the toctree…
max
  • 2,346
  • 4
  • 26
  • 34
2
votes
1 answer

How to remove repeating "toc" from the bottom of the index page in sphinx?

Here's my index.rst: Welcome to the documentation! ============================= .. include:: readme.rst .. _INTRODUCTION:: .. toctree:: :maxdepth: 1 :caption: Introduction readme .. toctree:: :maxdepth: 1 :caption: Contents: …
paul-shuvo
  • 1,874
  • 4
  • 33
  • 37
2
votes
2 answers

Sphinx - How to maintain side bar content between pages?

I have this source directory structure: . ├── conf.py ├── devel │   └── python │   ├── Controles de flujo, condicionales y bucles.md │   ├── Encapsulamiento.md | ├── (...) ├── index.rst ├── _static ├── _templates └── webdevel This is…
2
votes
1 answer

Make the heading levels of documents automatically dependent of the depth's levels of the (sub(sub(...)))folders they belong to

Suppose I have: a foo0.rst file at the root (source) of my sphinx-doc source folder, a foo1.rst file in a subfolder subfolder1 of source, a foo2.rst file in a subfolder subfolder2 of subfolder1, that is: $ tree source source ├── foo0.rst └──…
Denis Bitouzé
  • 520
  • 6
  • 18
2
votes
1 answer

Rename autosummary toctree entries

I have decided to use autosummary to create documentation of my module. In index.rst I have "imported" all relevant modules and submodules that I want documentation on. The modules are documented as expected, but one thing bothers me. The module…
Felix
  • 2,548
  • 19
  • 48
2
votes
1 answer

toctree dropdown menu

I want to get a dropdown menu when listing pages in Sphinx. I am using toctree. But when this list appears, all the subsections also appear in the list. Is there a way to either: Get a dropdown menu or Not show the subsections
Wouter
  • 477
  • 2
  • 6
  • 8
2
votes
1 answer

Sphinx Documentation with different separated subjects

I'm trying to build kind of a dashboard in the index with one tile per subject. Each subject will later have its own folder in source with it's own md files. I want each subject to be disconnected to the others. So the previous button should no go…
vinni
  • 633
  • 2
  • 8
  • 32