sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.44k stars 2.1k forks source link

nature theme sidebar blows out due to Sphinx new updates with autodoc names in the TOC #11000

Open zzzeek opened 1 year ago

zzzeek commented 1 year ago

Describe the bug

Recent Sphinx releases seem to have added autodoc names into the main TOC, such that sidebar tocs etc. will have lists of all the classes/methods /functions we have in our autodocs. This is not a bad change but has required some adjustment.

one problem seems to be that the nature CSS theme (maybe others) does not accommodate for the very large jump in width in the sidebar, most preferably using something along the lines of "overflow:auto" with a scrollbar, or perhaps some kind of wrapping.

How to Reproduce

Minimal method (you can also paste the contents of index.rst and conf.py into this report):

$ echo "Content demonstrating the bug..." > index.rst
$ echo "" > conf.py
$ sphinx-build -M html . _build
$ # open _build/html/index and see bla bla

See Alembic's docs at https://alembic.sqlalchemy.org/en/latest/ops.html for an example of this overrun of names. Screenshot is also attached. Alembic's conf adds minimal extensions and can be seen here.

Screenshot from 2022-11-28 15-28-36

Environment Information

text Platform: linux; (Linux-6.0.7-200.fc36.x86_64-x86_64-with-glibc2.35) Python version: 3.10.0 (default, Nov 5 2021, 17:23:47) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]) Python implementation: CPython Sphinx version: 5.3.0 Docutils version: 0.19 Jinja2 version: 3.1.2

Sphinx extensions

"sphinx.ext.autodoc", "sphinx.ext.intersphinx", "changelog", "sphinx_paramlinks", "sphinx_copybutton"

Additional context

No response

zzzeek commented 1 year ago

I've added these CSS bits to resolve on my end

div.documentwrapper div.bodywrapper { margin-left: 350px;}
div.document div.sphinxsidebar { width: 350px; }

div.sphinxsidebarwrapper div {
    overflow: auto;
}
1Maxnet1 commented 1 year ago

I can confirm the issue, it does also happen for me e.g. for the title bar, see here: https://motis-datagon.gitlab.io/trias-py/triaspy.trias.common_xml_structures.trias_location_support.location_reference_structure.html