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

Sphinx autosummary does not use labels in toctree

Is there any option to use labels in sphinx-autosummary toctree? Sphinx can build a toctree such as: .. toctree:: Main page The above will display "Main page" in the TOC of the HTML document. I would like the same using autosummary…
Yulian
  • 11
  • 4
1
vote
1 answer

Collapse all :glob:-discovered files into one TOC entry

I've got something like this: .. toctree:: :maxdepth: 2 :caption: Contents: :hidden: :glob: docs frontend backend tools/* I'd like all the documents found in the tools directory to collapse into one expandable sidebar TOC…
Alexey Orlov
  • 2,412
  • 3
  • 27
  • 46
1
vote
1 answer

How to remove bullets from numbered toctree in restructured text?

I am using a toctree in Sphinx to automatically generate a table of contents for a webpage. .. toctree:: :maxdepth: 2 :numbered: First Second Third which creates (roughly): First Second Third I want the numbers, but I…
jlconlin
  • 14,206
  • 22
  • 72
  • 105
1
vote
1 answer

Can sphinx link to documents that are located in one path above the .rst document?

I'm trying to use the basics of Sphinx to document a small project. But I can't get him to find the files that are in a directory above. The project structure is as follows: /Users/machine/workspace/project1 ├── BDRespostas.py ├── constantes.py ├──…
erfelipe
  • 460
  • 4
  • 14
1
vote
1 answer

Add download links to toctree

I would like to add a bulleted list of download links within my toctree. Ideally, it would look something like this: Foo Example download foo.py file download foo.ipynb file Bar Example download bar.py file download bar.ipynb file I've…
dshanahan
  • 676
  • 5
  • 12
1
vote
1 answer

Sphinx LaTeX Table of Contents - avoid toctree nesting of included rst files

I have a Sphinx documentation with the following structure: My chapter title ===================== Chapter intro part 1 -------------------------- Brief introduction that I would like to have in the start of this chapter... Chapter intro part…
mfcss
  • 1,039
  • 1
  • 9
  • 25
1
vote
0 answers

toctree maxdepth for display but not for navigation sidebar

I would like to use something like this in the root index: .. toctree:: :maxdepth: 1 sub1/index sub2/index So only the top-level titles are shown. But this also limits the navigation sidebar. Can this be avoided somehow? I also found…
Peter
  • 3,322
  • 3
  • 27
  • 41
1
vote
0 answers

Can a list in Restructured Text (reST) extend section numbers?

I have an RST document like this: Introduction ------------ Some intro text. Next Level Stuff ---------------- 1. The first list item 2. The second list item 3. The third list item I'm trying either a :numbered: toctree or .. sectnum:: to…
ajwood
  • 18,227
  • 15
  • 61
  • 104
1
vote
3 answers

Managing Sphinx toctrees combined with inline sections

I'm trying to learn how I can manage a toctree element that is located in the same file as other content. Suppose I have a thingamajig.rst chapter that looks like this: Thingamajigs ============ .. toctree:: :maxdepth: 2 foo bar …
Jason S
  • 184,598
  • 164
  • 608
  • 970
1
vote
1 answer

Sphinx/RST: Include another RST file without adding it to the TOC?

I'm improving some technical docs (Sphinx) and would like to include the contents of an RST file in multiple places; however, in doing so, that RST file is being added to the TOC multiple times. How can I include the file where I want but only…
Keon
  • 31
  • 1
  • 3
1
vote
1 answer

Custom section numbering in Sphinx

I would like to have different numbering for Sphinx: i, ii, iii for the frontmatter 1., 1.1, 2. for the main content A., B., ... for the appendix The numbering comes from the :numbered: option in a .. toctree:: directive. This is somehow related…
nowox
  • 25,978
  • 39
  • 143
  • 293
1
vote
1 answer

Sphinx (RTD Theme) section navigation is not consistent

My issue is hard to convey with words. I'll try the best I can. Using Sphinx 2.0.0, I have a project with the following "root" toctree. This is the index toctree: Welcome to FIRST Robotics…
1
vote
2 answers

Including notebook with nbsphinx fails

I am new to Sphinx and I want to write a documentation of a Python package. I have a problem when I want to include a demonstration file. I want to include the file demo.ipynb using the extension nbsphinx. It is successfully installed on my…
1
vote
1 answer

toctree numbering not shown on external link entries

I'm currently writing a technical documentation with Sphinx. I use a numbered toctree. When I insert an external web link in the toctree the rendered entry does not contain a number. For this toctree : .. toctree:: :numbered: :hidden: …
bfranchet
  • 46
  • 2
1
vote
3 answers

Sphinx adds Headings from Markdown File to Document Structure

I have configured Sphinx to use markdown files. In my index.rst file I have .. toctree:: :maxdepth: 2 :caption: Contents: documents/Markdown In Markdown.md I have # Markdown ## H2 Heading When I render the main page I get the H2…
Mr. J
  • 1,524
  • 2
  • 19
  • 42