Agatha Garcia
Agatha Garcia

Reputation: 3

Pages not showing on side menu

I am using Sphinx and ReStructuredText to create documentation, but even though all pages were created the same way, only 4 out of 8 are showing on the side menu. This is my table of contents:

.. toctree::

   :glob:
   :titlesonly:
   
   *

I've tried to add the pages manually, but it didn't seem to work either. Here's the link to the documentation where you can find the source code: Docs

Upvotes: 0

Views: 601

Answers (1)

Steve Piercy
Steve Piercy

Reputation: 15065

You should use either correct syntax of the toctree directive when using its options, or use file names whose casing aligns with what you put in the toctree directive.

The .rst files in your directory are the following.

Coordenadas.rst
Galeria-mapa.rst
Home-page.rst
Lista-camadas.rst
index.rst
legenda.rst
marcador.rst
medicao.rst
oscilar.rst

But in your index.rst you use the incorrect case for those filenames, and you add a blank line between the file names and glob character without using the glob option.

.. toctree::

   Home-page
   Coordenadas
   Galeria-mapa
   Legenda
   Lista-camadas
   Marcador
   Medicao
   Oscilar

   *

By looking at the build log on Read The Docs, you would find several warnings indicating what went wrong.

/home/docs/checkouts/readthedocs.org/user_builds/documentation-senografia/checkouts/latest/docs/source/index.rst:5: WARNING: toctree contains reference to nonexisting document 'Legenda'

To fix it, this is one option.

.. toctree::

   Home-page
   Coordenadas
   Galeria-mapa
   legenda
   Lista-camadas
   marcador
   medicao
   oscilar

And this should work, too. Note that in this version compared to yours, the options are immediately after the toctree directive without a blank line between them. A blank line should be present before the first toctree entry.

.. toctree::
    :glob:
    :titlesonly:

    *

Upvotes: 2

Related Questions