Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set menu depth #89

Open
adrianandreias opened this issue Sep 26, 2016 · 2 comments · May be fixed by #159
Open

Set menu depth #89

adrianandreias opened this issue Sep 26, 2016 · 2 comments · May be fixed by #159

Comments

@adrianandreias
Copy link

Any way to set the left menu options depth?

Seems that the left menu always shows the first two levels of the menu tree.

@hlinander
Copy link

I don't know if this is still relevant but I ran into the same problem and solved it by overriding the navigation.html template where I added the maxdepth option to the toctree invocation. This is my _templates/navigation.html:

<h3>{{ _('Navigation') }}</h3>
{{ toctree(maxdepth=4, includehidden=theme_sidebar_includehidden, collapse=theme_sidebar_collapse) }}
{% if theme_extra_nav_links %}
<hr />
<ul>
    {% for text, uri in theme_extra_nav_links.items() %}
    <li class="toctree-l1"><a href="{{ uri }}">{{ text }}</a></li>
    {% endfor %}
</ul>
{% endif %}

This assumes that you include navigation.html in the html_sidebar variable in conf.py as stated by the documentation.

@bitprophet
Copy link
Collaborator

@hlinander's approach is legit (when possible I always hope users can just use normal Sphinx tricks to work around stuff) but I would like it to be easier to tweak the depth if that is all one wants to manipulate; marking as possible enhancement, patches welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@bitprophet @adrianandreias @hlinander and others