Yulian
Yulian

Reputation: 11

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 <module.main>

The above will display "Main page" in the TOC of the HTML document. I would like the same using autosummary toctree

.. autosummary::
  :toctree:
  
  Main page <module.main>

However, the above label produces: module\main.rst: WARNING: document isn't included in any toctree

The purpose of this, when the html page is generated the TOC shows:

module package
   module.main module

What I want to see is:

module package
   main module

I am not even sure that this is the right place to achieve the above rendering

Upvotes: 1

Views: 722

Answers (1)

Yulian
Yulian

Reputation: 11

I have found out where this whole issues is coming from. The cause isn't in the toctree but the titles of each rst file. I use apidoc and autosummary. The apidoc has a template pacakge.rst that builds a toctree and it uses the titles of the generated .rst files to display the name in the *.html.

By title I mean, if you open the autosummary/module.rst:

{{ fullname | escape | underline }}

Upvotes: 0

Related Questions