From 3d180b7c504c01c853c89d1985a4e0eecaae38f2 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 27 Jan 2021 21:53:24 +0100 Subject: [PATCH] docs: Make TOC appear first on narrow screens This used to put the TOC last, which is the last place you'd want it. It's not perfect and we do some hacky layoutery to achieve it, but it should generally be usable. --- doc_src/python_docs_theme/layout.html | 2 ++ doc_src/python_docs_theme/static/pydoctheme.css | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/doc_src/python_docs_theme/layout.html b/doc_src/python_docs_theme/layout.html index 18d6a8724..dcc8f2379 100644 --- a/doc_src/python_docs_theme/layout.html +++ b/doc_src/python_docs_theme/layout.html @@ -37,6 +37,8 @@ {%- endif %} {% endblock %} +{% block sidebar1 %}{{ sidebar() }}{% endblock %} +{% block sidebar2 %} {% endblock %} {% block extrahead %} {% if builder != "htmlhelp" %} diff --git a/doc_src/python_docs_theme/static/pydoctheme.css b/doc_src/python_docs_theme/static/pydoctheme.css index 5e9c65319..445c69b0b 100644 --- a/doc_src/python_docs_theme/static/pydoctheme.css +++ b/doc_src/python_docs_theme/static/pydoctheme.css @@ -241,6 +241,19 @@ dl > dt span ~ em { height: auto; position: relative; } + div.sphinxsidebar ul { + flex-basis: content; + flex-wrap: wrap; + } + div.sphinxsidebarwrapper { + display: flex; + } + div.sphinxsidebarwrapper > h3:nth-child(5) { + display: none; + } + div#searchbox { + display: none !important; + } div.content {margin-left: 0;} div.bodywrapper {