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
17
votes
2 answers

How can I link to a page section in a sphinx toctree

I have a .. toctree as part of a sphinx page, which includes relative links to other rst files in my package. How can I include a link to a subsection of a given page, rather than the full page itself? I took a stab at .. toctree:: …
Duncan Macleod
  • 1,045
  • 11
  • 21
15
votes
2 answers

Show entire toctree in Read The Docs sidebar

It's my understanding the new Read The Docs theme generates the sidebar from the toctree with a depth of 2. My documentation is relatively deep, and a depth of 2 is not enough for it to be useful. How can I increase this limit, or preferably…
Kevin
  • 28,963
  • 9
  • 62
  • 81
14
votes
5 answers

Hide Sphinx subsections from main TOCTree

Is it possible to hide one (or all) subsections present in a RST file from the main TOCTree? Let me describe a little more: index.rst :doc:`Label ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. toctree:: Label…
user753531
13
votes
1 answer

Can't get sphinx to link under toctree to another document

I'm attempting to learn sphinx and am stuck on just the basic examples. I'm being given the following error on a make html in the source directory. Running Sphinx v1.1.3 loading pickled environment... not yet created building [html]: targets for 2…
John Lotacs
  • 1,184
  • 4
  • 20
  • 34
12
votes
3 answers

How can I reverse order the toctree provided by the "glob" flag option?

Does anyone know any option to order toctree in descending order of the filenames? In case of ascending order, we can use :glob: option like this: .. toctree: :glob: 2011* This would be handy for daily notes written in restructured text that…
Philipp der Rautenberg
  • 2,212
  • 3
  • 25
  • 39
12
votes
2 answers

Sphinx doesn't generate sidebar table of contents for headers

I'm struggling with sidebar table of contents in Sphinx's generated documentation. I just want to have kind of automatically generated index tree by the left side of my documentation. Instead, I see only blank headers: (I hope you don't mind target…
Asmoox
  • 592
  • 8
  • 23
12
votes
1 answer

How to make toctree link refer to the separate file like it refers to the subsections

Structure The following structure of the project: index.rst MyProject ========= Contents: .. toctree:: group1 group1.rst Group1 ------ Subgroup1 ========= Subgroup1 contents Subgroup2 ========= Subgroup2 contents Rendered to (after…
user2288008
12
votes
1 answer

Different toctree title and document title, specified in document source only

When inserting a document in a toctree, the link displayed is the main title of the document. So when I do: .. toctree:: materials/diffuse materials/glossy materials/specular I get: Materials Diffuse material Glossy material Specular…
galinette
  • 8,896
  • 2
  • 36
  • 87
12
votes
1 answer

What is this "generated" option in Sphinx autosummary directive?

I'm using sphinx-apidoc and autosummary extensions to document an API for a library and I'm really unable to understand the purpose of the generated/ option below: .. autosummary:: :nosignatures: :toctree: generated/ module.function_1 …
Dashing Adam Hughes
  • 1,522
  • 1
  • 13
  • 12
11
votes
1 answer

Make classes appear on TOC in Sphinx

I'm starting to document a few python classes using ext.autodoc. I have several *.rst files with content such as ======== mymodule ======== .. automodule:: mymodule .. autoclass:: myclassA :members: .. autoclass:: myclassB …
Stefan
  • 4,187
  • 1
  • 32
  • 38
11
votes
4 answers

Conditional toctree in Sphinx

I want to do multiple versions of a documentation, which differ in the sections that are included. To achieve this I would usually use either the only directive or the ifconfig extension. However, I cannot use any of those in combination with the…
11
votes
1 answer

Include another page’s ToC in Sphinx

I have the following page at plugins/index.html: Plugin Development ================== .. toctree:: :hidden: basics/index advanced/index The Basics ---------- - :doc:`basics/gettingstarted` - :doc:`basics/resources` -…
Brandon Kelly
  • 2,033
  • 2
  • 21
  • 38
10
votes
1 answer

Different :maxdepth: for specific entries in toctree (Sphinx)

I have some Sphinx based documentation for a library I built and I'd like to display the expanded table of contents for all my pages except for the changelog. I figured out how to do it by moving the changelog to a second :toctree::, but this has…
aiguofer
  • 1,887
  • 20
  • 34
10
votes
1 answer

Sphinx does not recognize subfolders

I'm new in using Sphinx. I'm able to create HTML documentations as long as my files are in the source top folder. As soon as I'm putting them in a subfolder in the source directory, Sphinx does not include the document into the build. Sphinx tells…
Stephan
  • 242
  • 4
  • 16
10
votes
1 answer

Can Sphinx Section Numbering Skip Certain Sections (like a title)?

I am making a series of design documents in Sphinx and I would like to include them together in a toctree and have the sections within the documents numbered. I know that I can use .. sectnum:: to number all sections in the child pages. However,…
Randy
  • 908
  • 12
  • 30
1
2
3
10 11