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

Using self to create a sitemap with toctree in sphinx seem broken?

I'm updating a FAQ for a fairly big project and I would like to add an index of the questions at the top of the page, so it becomes easier for users to find what they're looking for. The Sphinx documentation toctree article states "The special entry…
Damgaard
  • 922
  • 1
  • 9
  • 17
6
votes
2 answers

Sphinx toctree directive: How to hide the caption from being displayed?

If I have the following in index.rst: This Section ------------ .. toctree:: :caption: This Section :maxdepth: 1 this_section/intro this_section/body this_section/outro Then "This Section" would show up twice in the generated HTML…
xuhdev
  • 8,018
  • 2
  • 41
  • 69
6
votes
1 answer

Sphinx toctree in sidebar ONLY

I'm new to Sphinx and have been searching for a solution to this question for a while. My Index Page is made from index.rst which contains a toctree. The page displays the TOC in the body as well as the sidebar. I'd like to show the TOC on the…
FT Support
  • 61
  • 4
6
votes
1 answer

How to add a toctree entry?

I am trying to get started with Sphinx for documenting Python, and I seem to be missing some very basic step in getting started. I'm following the http://www.sphinx-doc.org/en/stable/tutorial.html and have installed and configured (with defaults,…
Karthick
  • 2,031
  • 1
  • 13
  • 18
6
votes
1 answer

Can't display multiple .md files in .rst toctree Sphinx

I can render my Readme.md files in Sphinx using recommonmark. But when I try to put in multiple Readme files in a .rst file toctree only the first one can be accessed from the documentation link. Kick! KVM ========= Source Code:…
Strommer
  • 313
  • 1
  • 2
  • 10
6
votes
1 answer

WARNING: toctree contains reference to nonexisting document error with Sphinx

I used the sphinx-quickstart to set everything up. I used doc/ for the documentation root location. The folder containing my package is setup as: myfolder/ doc/ mypackage/ __init__.py moprob.py ... After the quick…
magnoliafork
  • 95
  • 1
  • 7
6
votes
2 answers

Python Sphinx skips first section when generating pdf

I use sphynx to generate documentation from static .rst files (no docstrings extraction). I have two files in my repository: index.rst .. toctree:: intro and intro.rst Will be skipped =============== Where is my parent…
kraymer
  • 3,254
  • 1
  • 24
  • 32
6
votes
1 answer

How do I conditionally include a file in a Sphinx 'toctree'?

I would like to include one of my files in my Sphinx TOC only when a certain tag is set, however the obvious approach fails: .. toctree:: :maxdepth: 5 index core utils oec plotting install news glossary .. only::…
orome
  • 45,163
  • 57
  • 202
  • 418
5
votes
1 answer

Using Jinja2 with Sphinx autosummary

I am trying to use sphinx.ext.autosummary to document a Python package. Since 'autosummary' requires us to list all the items to be included, I wanted to specify these using Jinja2. My conf.py is as follows (relevant parts shown): extensions = [ …
5
votes
0 answers

WARNING: toctree contains reference to nonexisting document

I'm using sphinx for documenting my Django application. I have the following directory structure of docs docs |- build |- source |- _static |- _templates |- conf.py |- index.rst |- upgrade.rst |- upgrade_changes |- migration …
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
5
votes
0 answers

Sphinx latex pdf include sub-toctree on subsection page

I have a sphinx documentation project that I use to generate an HTML (make html) and a PDF (make latexpdf) version of the documentation. I use subdirectories to organize some of the pages. My directory structure is something like this: source/ …
djhoese
  • 3,567
  • 1
  • 27
  • 45
5
votes
1 answer

In Sphinx, how do I hide the section numbers when producing a LaTeX PDF?

The documentation says that "Numbering up to a specific depth is also possible, by giving the depth as a numeric argument to numbered," which is a toctree option. But giving it a depth of 0 or 1 doesn't work. Any other ideas?
redcurry
  • 2,381
  • 2
  • 24
  • 38
5
votes
1 answer

Automatic toctree update

I'm not sure if this is possible. But I'm hoping to put multiple .rst files in a directory, and during compilation. I want these files to automatically be inserted in the toctree. How can I go about this?
kirikoumath
  • 723
  • 9
  • 20
5
votes
2 answers

Adding subsections of self in the toctree

I am having an issue with getting the table of contents (TOC) to display subsections of the front page of my documentation. I have a number of sections on my front page, and I would like these to be displayed in the TOC. The display of subsection…
amicitas
  • 13,053
  • 5
  • 38
  • 50
4
votes
1 answer

sphinx for multiple, separate documents

I'm pretty new to Sphinx, documenting my project on a server. Now a co-worker sees what I've been up to and she wants to do the same thing--document her project on the same server. The projects are not related (they don't belong in a single…
Tim
  • 1,013
  • 3
  • 17
  • 36