2

I have this source directory structure:

.
├── conf.py
├── devel
│   └── python
│       ├── Controles de flujo, condicionales y bucles.md
│       ├── Encapsulamiento.md
|       ├── (...)
├── index.rst
├── _static
├── _templates
└── webdevel

This is my index.rst:

¡Bienvenidos a Echemos un bitstazo!
======================================================

Este es mi espacio de documentación personal dónde almaceno todo tipo de conocimientos relacionados con la administración de sistemas y redes informáticas; desarrollo y otros temas varios de IT.

.. toctree::
   :maxdepth: 1 
   :caption: Administración de sistemas

   devel/python/python

Índice y tablas
==================

* :ref:`genindex`
* :ref:`search`

This is my python.rst:

Python
======================================================

.. toctree::
   :maxdepth: 1
   :caption: Contenido:
   :glob:

   *

My conf.py:

project = 'Echemos un bitstazo ~ Wiki'
copyright = '2021, Álvaro Castillo'
author = 'Álvaro Castillo'
extensions = [ 'myst_parser'
]
templates_path = ['_templates']
language = 'es'
exclude_patterns = []
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']

After do sphinx-build -b html source build, I got index.html, python.html...et

I have this index menu: Index menu

I have this Python menu: enter image description here

However, the menu is changed when I access another page likes Encapsulamiento. enter image description here

How I can fix this slide menu bar showing all posts as in python.html?

mzjn
  • 48,958
  • 13
  • 128
  • 248
sincorchetes
  • 351
  • 1
  • 4
  • 13

2 Answers2

1

Add Encapsulamiento to your toctree in index.rst.

.. toctree::
    :maxdepth: 2
    :caption: Administración de sistemas

    devel/python/python
    path/to/encapsulamiento

Also change maxdepth to 2.

Steve Piercy
  • 13,693
  • 1
  • 44
  • 57
  • Hi! Thanks for your answer, but It just only adds to the index.html menu item. https://i.imgur.com/HzLw78M.png Encapsulamiento--> https://i.imgur.com/Os2SZ02.png – sincorchetes Jun 15 '21 at 14:21
  • Perhaps change `maxdepth` to `2`? – Steve Piercy Jun 15 '21 at 15:08
  • Noup, because If I set maxdepth, I got the index of python.rst inside index.html :/ and It does not solve it. – sincorchetes Jun 15 '21 at 15:26
  • 2
    Did you do a `make clean` first, then force reload the page? You might be viewing a cached file, either in the browser or in the build directory. Sphinx only rebuilds pages that have changed, and if the only change was in `index.rst` that would be the only page that updated. – Steve Piercy Jun 16 '21 at 06:09
  • @sincorchetes Would you please accept my answer as the solution by checking it and optionally upvoting it? – Steve Piercy Jun 16 '21 at 07:02
  • But, your solution was not :maxdepth: 2, was make clean. Can you edit it? – sincorchetes Jun 16 '21 at 12:57
  • No. Try `:maxdepth: 1` then `make clean` and `make html`. Clean merely deletes files. You must use the proper `:maxdepth:` setting to get the desired navigation depth. – Steve Piercy Jun 17 '21 at 10:20
  • If you see my main entry. I used :maxdepth: 1... but I haven't used make clean. – sincorchetes Jun 17 '21 at 15:31
0

@steve piercy's comment on his answer was what solved this issue for me: make clean. As he didn't want to edit his answer I'll post this here so that it doesn't get lost for other people.

Noah Sprent
  • 133
  • 5