Does using self to create a site map with toctree in the sphinx seem broken?

I am updating the FAQ for a fairly large project, and I would like to add a question index at the top of the page so that it will be easier for users to find what they are looking for.

The Sphinx documentation toctree article states: "The name of the custom entry is a document containing the toctree directive. This is useful if you want to create a" sitemap "from toctree." This is what I want. The problem is that I seem to have broken down and include only the current title of the document, not the subtitles. It works correctly when I am in another document and referring to the FAQ, only in the document itself it does not work.

To demonstrate

.. toctree::
   :maxdepth: 3

   faq

In another file, the result

  • Frequently asked Questions
      • 1
      • 2
      • 3

faq

.. toctree::
   :maxdepth: 3

   self

, , , , , toctree, . .

, sphinx,

+5
1

, , contents.

, :

.. contents::
   :local:
   :depth: 1

:

  • 1
  • 2
  • 3
+8

All Articles