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

toctree nested drop down

I have a toctree in my index.rst that looks something like this: .. toctree:: :maxdepth: 2 cat dog moose I am looking to to nest the contents of my toctree similar to how it is done here with 'api documentation': So ultimately make…
ApathyBear
  • 9,057
  • 14
  • 56
  • 90
10
votes
2 answers

Sphinx section numbering for more than level 3 headings: .. sectnum::

I am using Sphinx to generate pdf files from rst files. Sphinx automatically generates section numbers up to level 3 headings, as well as Table of Content up to this level. However, I want the headings at all levels being numbered and be in the TOC.…
user3006469
  • 101
  • 1
  • 1
  • 3
10
votes
1 answer

Sphinx toctree either displays a TOC in sidebar with bulleted list in body, or nothing at all

I'm working with Sphinx (sphinx-1.2b1-py2.7). I want a TOC to appear in a sidebar. It seems binary: I can only get both a TOC in the sidebar and a bulleted list in the body of the text, or I get nothing (no TOC in the sidebar and no bulleted list).…
user2498859
  • 101
  • 1
  • 6
9
votes
1 answer

Sphinx sidebar: include module's functions and class' methods

In Sphinx docs, I define a reference document like this: Reference ========= .. toctree:: reference_api reference_cli reference_client reference_downloads reference_options reference_stats reference_utils The reference_api…
pawamoy
  • 3,382
  • 1
  • 26
  • 44
9
votes
1 answer

Adding files in subfolders to sphinx documentation (sphinxcontrib-matlabdomain)

I have a directory containing various folders, with each of them having matlab source files in them. Some of these folders have sub-folders containing matlab source files. How can I create a TOC tree with Sphinx to contain the sub-folders in a…
user3709710
  • 131
  • 1
  • 5
9
votes
2 answers

Multiple Levels of Toctree's in Python-Sphinx

I'm trying to use sphinx in a way to document multiple "levels" of documentation, eg: Api Reference Manual Tutorials Etc. The idea is that the Table of Contents is shown on the sidebar relative to the section you're in. So when you're on the main…
Naatan
  • 3,424
  • 4
  • 32
  • 51
9
votes
1 answer

How to set Sphinx and latexpdf toc depth?

I have a vanilla sphinx project (Sphinx 1.2b3.) created with "sphinx-quickstart" I add a basic page.rst with 4 header levels. I can control the depth of the html toc in index.rst: .. toctree:: :maxdepth: 1 :numbered: page Based upon the…
pellekrogholt
  • 1,895
  • 2
  • 16
  • 18
8
votes
1 answer

Why is toctree not updating with RTD theme?

I have an programmatically generated sphinx-doc source that uses the Read-The-Docs theme. The source tree looks like: source ├── conf.py ├── index.rst ├── models │   ├── 1lin │   │   ├── 1lin_Amplero.rst │   │   ├── 1lin_Blodgett.rst │   │   ├──…
naught101
  • 18,687
  • 19
  • 90
  • 138
8
votes
2 answers

How to edit Sidebar under Sphinx Alabaster theme

I have the following index.rst file. Know the cell population of your data ===================================== Some content .. toctree:: :maxdepth: 2 Installation ~~~~~~~~~~~~ .. toctree:: :maxdepth: 2 installation Scripts ~~~~~~~ ..…
neversaint
  • 60,904
  • 137
  • 310
  • 477
7
votes
1 answer

How to separate Sphinx chapters within a single part into different files?

I'm using the wonderful Sphinx tool to create some documentation and I'm trying to keep the codebase in a modular form by separating chapters of the same part into separate files. (See here for definitions of 'chapter' and 'part'.) I've tried to do…
AZD
  • 279
  • 1
  • 8
7
votes
2 answers

How to create a title that will not appear in the toctree with Sphinx?

I am using Sphinx to create documentation for a Python module. I wold like to add subtitles on a page but I don't want them to appear in the toctree. I want small sections and short (few lines) descriptions. Adding every section title to the toctree…
Szabolcs Dombi
  • 5,493
  • 3
  • 39
  • 71
7
votes
1 answer

How can I link the generated index page in ReadTheDocs navigation bar?

I'm creating my documentation with Sphinx on ReadTheDocs, using their theme. The build process generates a genindex.html file, which can be referenced with: Link to the :ref:`genindex` page. which creates: Link to the Index page. I can't add…
Paebbels
  • 15,573
  • 13
  • 70
  • 139
7
votes
2 answers

Autosummary with toctree not creating documentation for methods

I'm using sphinx with the numpydoc extension and autosummary. After some experimentation, I added the following options to my conf.py file. autosummary_generate = True numpydoc_show_class_members = False This is giving me a new file for each class…
kesmit
  • 121
  • 1
  • 4
7
votes
1 answer

Using self in toctree doesn't include sub-sections

I would like my toctree in sphinx to include the main (index.rst) page. The documents suggest that including 'self' will do this, but as others have noted on stackoverflow this only includes the title of the main page, so that if depth > 1 the…
Eli S
  • 1,379
  • 4
  • 14
  • 35
7
votes
1 answer

Divide Sphinx TOC into subsections with subheadings

I have a Sphinx master document which includes child documents as follows: .. toctree:: :maxdepth: 2 :numbered: doc1 doc2 doc3 doc4 doc5 doc6 I would like to divide the TOC into parts or subsections, so that it…
Jeet
  • 38,594
  • 7
  • 49
  • 56
1 2
3
10 11