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

Toctree Activates Current Page and Main Page on Sidebar

There is no problem on de index.rst it seems as below: However, when I go to another page, in my case it is annotation-module.rst, the sidebar selects and shows both index and annotation-module, as seen below: However, I want to have only…
Eray Erdin
  • 2,633
  • 1
  • 32
  • 66
1
vote
1 answer

Sphinx Alabaster theme TOC not showing in all pages

I am trying to have the TOC show up in all my pages. My set up is pretty simple. In the index.rst, I have Installation ============ Scripting ========= .. toctree:: :maxdepth: 2 :caption: Contents: class ASAT """""""""" .. toctree:: …
securisec
  • 3,435
  • 6
  • 36
  • 63
1
vote
1 answer

Selecting packages in toctree but not modules

I'm using Sphinx to generate docs for a repository. The Sphinx toctree allows the use of :glob: to auto-select certain docs. I have a toctree of the form .. toctree:: :maxdepth: 1 :glob: …
brunston
  • 1,244
  • 1
  • 10
  • 18
1
vote
0 answers

toctree entry pointing to non reST files

I have built some HTML files with javadoc. I have those in Sphinx _static dir. Now I'm trying to put a link to those HTML files in Sphinx toctree: .. toctree:: API reference <_static/api/index.html> Is there any way to do this? As much as I've…
PovilasB
  • 1,488
  • 1
  • 15
  • 25
1
vote
2 answers

Missing blanck line between directive and entries error

I have just created my documentation using Sphinx and this is my problem: Initially in the Toc tree directive is empty and then I add "tutorial" below and it looks like this: .. toctree:: :maxdepth: 2 tutorial and when I "make html", I do…
Simon
  • 29
  • 3
1
vote
1 answer

Create table of content inside table

I want to be able to generate table of content inside a table. E.g. it should have borders and look like this: .. tabularcolumns::…
1
vote
1 answer

"preparing documents" hangs - toctree circular references in Sphinx

i try to generate a documentation with Sphinx but the generation hangs on "preparing documents .." I search for a solution but I don't find any advice to solve the problem. The problem appears after adding a Table of content to all files. The…
Mischa
  • 635
  • 6
  • 14
0
votes
0 answers

How to use a substitution variable in Toctree Sphinx?

The problem consist to use a substitution variable var_link which is declared in conf.py file as follow : var_link = 'https://www.google.fr/' This variable is added into rst_prolog by rst_prolog = f""" .. |var_link| replace:: {var_link} """ And I…
0
votes
1 answer

Programmatically adding Nested TOC entries to Sidebar in Sphinx

I am trying to automatically add entries into the TOC sidebar based on the contents of a directory through a extension, and for some reason the TOC Node correctly applies an entry to the current section but it does not apply any additional sections…
David W
  • 1
  • 2
0
votes
1 answer

Items and sub-items in different directories and listed in menu - Sphinx

I'm creating a project using the Sphinx tool. And to keep the organization, I separated the sub-items into directories with the name of the item "Mother", as…
0
votes
0 answers

Font styling when annotating Sphinx toctree

I'm trying to build documentation for a Python project using Sphinx (using autodoc with the readthedocs theme). I want to override the text in the table of contents side bar. Following this example, I can achieve this by modifying the toctree in…
MRule
  • 529
  • 1
  • 6
  • 18
0
votes
0 answers

How to structure Sphinx documentation to prevent overriding documentation if files have same name

I have multiple small projects that are somewhat related to eachother so i want them to be in single sphinx documentation. Each handler.py module have different docstring but when i build documentation both modules reference handler.py from…
Fryger
  • 1
  • 1
0
votes
1 answer

Create Sphinx nested TOC to link to a new page

I'm trying to create a single entry on the main toctree with three nested entries that each link to a page (because our main TOC is already quite long). The structure is like this: - Layers + Using Layers + Layer Arguments + Layers…
Katie
  • 21
  • 1
  • 7
0
votes
1 answer

How to hide TOC from sidebar in sphinx.ext.autosummary?

I need Sphinx autosummary extension to generate stub using :toctree: generated/ but I also want to prevent TOC entries from appearing in the HTML sidebar. Consider following docstring: MySubPackage…
0
votes
0 answers

index.rst build just only links of the rest of pages. - Sphinx

I have a index.rst with this sintaxis: Example ====================================================== .. toctree:: :maxdepth: 0 :caption: Contents: item Items and tables ================== * :ref:`genindex` * :ref:`modindex` *…
sincorchetes
  • 351
  • 1
  • 4
  • 13