From 3fc478ee392c1f689e9d4ba6724fed4d9ab539bc Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Sat, 6 Jul 2024 04:04:05 -0400 Subject: [PATCH 1/3] Docs: Fix custom styling, restore bullets - Move the custom CSS to a dedicated `pytest.css` file in `_static/`, and reference it from the configuraton's `html_css_files` list. - Update the list-customization styling to only affect `.sidebar-scroll` (the navigation sidebar), so that bullets are visible in the rest of the documentation. - Remove the list indent from the navigation sidebar, but only at the top level, so that navigation is still nested with visible indents. --- doc/en/_static/pytest.css | 8 ++++++++ doc/en/_templates/style.html | 7 ------- doc/en/conf.py | 8 +++++--- 3 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 doc/en/_static/pytest.css delete mode 100644 doc/en/_templates/style.html diff --git a/doc/en/_static/pytest.css b/doc/en/_static/pytest.css new file mode 100644 index 00000000000..918149a3a7f --- /dev/null +++ b/doc/en/_static/pytest.css @@ -0,0 +1,8 @@ +/* Hide list bullets and top-level indent in TOC sidebar */ +.sidebar-scroll ul {list-style: none;} +.sidebar-scroll > ul {padding-left: 0;} +.sidebar-scroll li {margin: 0.4em 0;} +/* Widen the events sidebar on the front page */ +@media (min-width: 46em) { + #features {width: 50%;} +} diff --git a/doc/en/_templates/style.html b/doc/en/_templates/style.html deleted file mode 100644 index 400cb75ff97..00000000000 --- a/doc/en/_templates/style.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/doc/en/conf.py b/doc/en/conf.py index 0d440ec448a..0c5c11be3b8 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -251,7 +251,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ['_static'] +html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -274,7 +274,6 @@ "globaltoc.html", "links.html", "sidebar/scroll-end.html", - "style.html", ], "**": [ "sidebar/brand.html", @@ -284,10 +283,13 @@ "relations.html", "links.html", "sidebar/scroll-end.html", - "style.html", ], } +html_css_files = [ + "pytest.css", +] + # Additional templates that should be rendered to pages, maps page names to # template names. # html_additional_pages = {} From ec0ed40b16cc1022f0fb6e6b19d05b1117b047f5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 6 Jul 2024 08:56:36 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/en/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index 0c5c11be3b8..4db962bdcb4 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -251,7 +251,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. From a09fcc2286428ee88632c8d6417b2fb7acd8d47b Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Sat, 6 Jul 2024 04:57:52 -0400 Subject: [PATCH 3/3] Add a bottom margin to events sidebar - Prevents it accidentally sitting directly "on top" of other page elements, when the widths work out exactly wrong --- doc/en/_static/pytest.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/en/_static/pytest.css b/doc/en/_static/pytest.css index 918149a3a7f..a9a86cf8c5b 100644 --- a/doc/en/_static/pytest.css +++ b/doc/en/_static/pytest.css @@ -4,5 +4,8 @@ .sidebar-scroll li {margin: 0.4em 0;} /* Widen the events sidebar on the front page */ @media (min-width: 46em) { - #features {width: 50%;} + #features { + width: 50%; + margin-bottom: 1em; + } }