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

Hidden toctree still generates a toctree-wrapper div in output html #10093

Open
alexisthual opened this issue Jan 12, 2022 · 0 comments
Open

Comments

@alexisthual
Copy link

Describe the bug

Currently, sphinx generates a <div class="toctree-wrapper compound"> </div> even when toctree is :hidden:.
I think it'd be more consistent if nothing was added to the DOM when toctree is hidden.

My guess is that it boils down to changing this part of the code

wrappernode = nodes.compound(classes=['toctree-wrapper'])
wrappernode.append(subnode)
self.add_name(wrappernode)
ret = self.parse_content(subnode)
ret.append(wrappernode)
return ret

and maybe only run ret.append(wrappernode) when subnode['hidden'] is not False?

Let me know what you think!

How to Reproduce

$ git clone https://github.com/.../some_project
$ cd some_project
$ pip install -r requirements.txt
$ cd docs
$ make html SPHINXOPTS="-D language=de"
$ # open _build/html/index and see bla bla

Expected behavior

No response

Your project

https://github.com/nilearn/nilearn

Screenshots

No response

OS

Ubuntu

Python version

3.9

Sphinx version

4.3.2

Sphinx extensions

No response

Extra tools

No response

Additional context

No response

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

No branches or pull requests

2 participants