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

Sphinx: modules.rst: WARNING: document isn't included in any toctree

Trying to generate documentation with Sphinx. First using: sphinx-apidoc Then using: sphinx-build html And I got this warning about the modules.rst file. The file exists, the html is also generated, it definitely looks like a table of content. I…
Milan
  • 1,547
  • 1
  • 24
  • 47
4
votes
0 answers

Can't create sidebars in Python Sphinx html output?

I'm documenting my Python project using Sphinx tool and my HTML output currently looks like this: As you can see the tool bar has "Navigation" heading with nothing under it. When I add the following code to my conf.py file, the HTML toolbar…
Caffeine
  • 445
  • 1
  • 4
  • 16
4
votes
0 answers

Sphinx toctree with automodule

I have modules I'd like to document such that the table of contents is on the main page index and the documentations themselves are in separate pages. I'm new to automatic documentation and Sphinx, but I've gotten…
Felix
  • 2,548
  • 19
  • 48
4
votes
2 answers

Warning about toctree references

Contents: .. toctree:: :maxdepth: 2 foo.rst bar.rst Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` I am trying to build it using sphinx-build . doc It gives me warning: (WARNING/2) toctree…
user12345
  • 2,400
  • 8
  • 33
  • 40
4
votes
1 answer

Include toctree from subdirectory in Index toctree

The structure of my project that I want to document is as follows: /top Index.rst /a toctree_a.rst (contains doc and doc2) doc.rst doc2.rst /b toctree_b.rst (contains doc4 and doc3) doc3.rst doc4.rst I want…
Almidas
  • 379
  • 2
  • 6
  • 16
4
votes
1 answer

Annotated Sphinx toctree

The usual use of toctree in Sphinx looks something like this: .. toctree:: :maxdepth: 2 foo bar baz and if, for example, foo.rst starts with a title heading "Being Foo", bar.rst starts with "Doing Bar", and baz.rst starts with…
Jason S
  • 184,598
  • 164
  • 608
  • 970
4
votes
2 answers

Change color of caption text in toctree

Is there a way to change the color of captions on a sphinx webpage? I'm using the :caption: directive with toctree, but the caption comes out almost the same color as the sidebar. For reference here is the link to the page with the hard to see…
Syntactic Fructose
  • 18,936
  • 23
  • 91
  • 177
4
votes
2 answers

How do I generate a sitemap.xml file with sphinx?

Here it says: "The special entry name self stands for the document containing the toctree directive. This is useful if you want to generate a “sitemap” from the toctree." And I have been looking at this thred - Using self to create a sitemap with…
anthony-dandrea
  • 2,583
  • 7
  • 26
  • 46
4
votes
1 answer

autosummary with toctree also lists imported members

I use Sphinx and autosummary to produce the documentation of a Python software. It works well but the produced .rst files also list the imported functions and classes, which is not the behaviour I would like. For example a package "packageex" with…
paugier
  • 1,838
  • 2
  • 20
  • 39
4
votes
1 answer

Hide specific files from toctree?

I'm using a readthedocs.org instance on my localhost to build HTML documentation from my github repo and I would like to be able to do the following. Currently I have a list of files being read by using toctree's glob feature like this: ..…
4
votes
0 answers

Continuing numbering from heading to list in toctree

I'm looking to get list numbers to continue on from heading numbers. I've tried the :numbered: directive in .. toctree:, but that only produces numbers for the headings. For example: Section ===== Sub Section ----------- #. item 1 #. item 2 #.…
mrmagooey
  • 4,832
  • 7
  • 37
  • 49
4
votes
1 answer

Change internal link labels in Sphinx

I'm generating documentation with Sphinx. I can change the label of links to documents in the table of contents with Features in the toctree directive as per the toctree directive, but how can I do the same for links…
jfoucher
  • 2,251
  • 2
  • 21
  • 29
3
votes
2 answers

Using Sphinx to generate Python document using :glob:

I am new to Sphinx. The file /home/user/myproject/docs/source/index.rst is as following: My project contents: .. toctree:: :glob: * I am getting the below message on running $ make html under /home/user/myproject/docs/: checking…
hllau
  • 9,879
  • 7
  • 30
  • 35
3
votes
1 answer

Can I add a horizontal bar to a table of contents in Sphinx?

I'm developing documentation in Sphinx, and would like to separate sections in my table of contents using horizontal bars. I often see this in menus: Is there a way to do it in sphinx?
Abe
  • 22,738
  • 26
  • 82
  • 111
3
votes
1 answer

How to add captions in Sphinx toctree without adding new documents?

Okay, I'm using Sphinx Autosummary to generate documentation for some classes. There are three different types of classes and I want my sidebar to have three distinct sections, like if I was using the :caption: option in the toctree directive. So I…
Jay Parthasarthy
  • 327
  • 1
  • 4
  • 11