bashtage / sphinx-material

A material-based, responsive theme inspired by mkdocs-material
Other
312 stars 91 forks source link

Toctree not shown in sidebar #128

Open thmsklngr opened 1 year ago

thmsklngr commented 1 year ago

Hi,

I wanted to use this theme for my current project and so I switched from the RTD theme - and I immediately I recognized, that I can't see links in the left sidebar. I also tried to configure it like the one in the repo, but no success. Any hints for me?

Relevant entries in conf.py:

import sphinx_material
extensions.append("sphinx_material")
html_theme_path = sphinx_material.html_theme_path()
html_context = sphinx_material.get_html_context()
html_theme = 'sphinx_material'

html_theme_options = {
    'nav_title': 'My project',
    'globaltoc_depth': 3,
    'globaltoc_collapse': False,
    'globaltoc_includehidden': False,
}

index.rst:

Welcome to My project's documentation!
=====================================

.. toctree::
    :hidden:

    Home<self>

.. toctree::
   :glob:
   :maxdepth: 1
   :caption: Library

   lib/index
   lib/*

.. toctree::
   :glob:
   :maxdepth: 1
   :caption: Modules

   modules/index
   modules/*

The only entry in the sidebar is the title set via 'nav_title'. :(

Regards, Thomas

mason3k commented 1 year ago

From the docs:

You must set html_sidebars in order for the side bar to appear. There are four in the complete set.

html_sidebars = {
    "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
}

You might also want to set 'globaltoc_includehidden' to True if you want to see hidden toctree