From 2c2072371ab944db5987a986094ddb0cdd8767fd Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 2 Feb 2024 15:07:10 +0200 Subject: [PATCH 1/9] Do not underline navigation links --- python_docs_theme/static/pydoctheme.css | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 14464db..c5e44fc 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -33,6 +33,30 @@ a[href] { text-decoration: underline 1px; text-underline-offset: 0.25em; } +/* No underline for navigation */ +div.genindex-jumpbox a, +div.modindex-jumpbox a, +div#search-results a, +div.sphinxsidebar a, +div.toctree-wrapper a, +div[role=navigation] a, +table.contentstable a, +table.indextable a { + text-decoration: none; +} + +/* Except when hovered */ +div.genindex-jumpbox a:hover, +div.modindex-jumpbox a:hover, +div#search-results a:hover, +div.sphinxsidebar a:hover, +div.toctree-wrapper a:hover, +div[role=navigation] a:hover, +table.contentstable a:hover, +table.indextable a:hover { + text-decoration: underline; + text-underline-offset: auto; +} body { margin-left: 1em; @@ -284,6 +308,10 @@ div.footer { margin-right: 10px; } +div.footer a { + text-underline-offset: auto; +} + div.footer a:hover { color: #0095c4; } From 2f38e86cea78c9b31372d0c291119deae5044c6f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 3 Feb 2024 23:26:28 +0200 Subject: [PATCH 2/9] Only apply underline offset to code formatting for underline visibility --- python_docs_theme/static/pydoctheme.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 14464db..dff8ee8 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -31,7 +31,10 @@ pre { a[href] { text-decoration: underline 1px; + +a[href]:has(> code) { text-underline-offset: 0.25em; + color: red; } body { From 98b94c5e56aa86ef887730263993297ead57f7a9 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 3 Feb 2024 23:32:33 +0200 Subject: [PATCH 3/9] Remove debugging --- python_docs_theme/static/pydoctheme.css | 1 - 1 file changed, 1 deletion(-) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index dff8ee8..d404934 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -34,7 +34,6 @@ a[href] { a[href]:has(> code) { text-underline-offset: 0.25em; - color: red; } body { From bd00c3da51f6a00697eefbedf8cf9cd465722561 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 3 Feb 2024 23:35:39 +0200 Subject: [PATCH 4/9] =?UTF-8?q?Don't=20underline=20the=20pilcrow=20(=C2=B6?= =?UTF-8?q?)=20navigation=20symbol?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python_docs_theme/static/pydoctheme.css | 1 + 1 file changed, 1 insertion(+) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index c5e44fc..54c1616 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -34,6 +34,7 @@ a[href] { text-underline-offset: 0.25em; } /* No underline for navigation */ +a.headerlink, div.genindex-jumpbox a, div.modindex-jumpbox a, div#search-results a, From 2dd4e77cbcf5d2f46f723a81c3938e2de22a08e2 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 3 Feb 2024 23:46:30 +0200 Subject: [PATCH 5/9] Add missing bracket --- python_docs_theme/static/pydoctheme.css | 1 + 1 file changed, 1 insertion(+) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index d404934..263f3f6 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -31,6 +31,7 @@ pre { a[href] { text-decoration: underline 1px; +} a[href]:has(> code) { text-underline-offset: 0.25em; From 2f3f86ec603341cce76616ed2f83c8a9ee0a4b4e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 4 Feb 2024 19:20:50 +0200 Subject: [PATCH 6/9] Add comments --- python_docs_theme/static/pydoctheme.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 8112fa4..959a94e 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -29,10 +29,12 @@ pre { color: inherit; } +/* Add underlines to links */ a[href] { text-decoration: underline 1px; } +/* Increase the underline offset for code to avoid obscuring underscores */ a[href]:has(> code) { text-underline-offset: 0.25em; } From fbf2bf896c464dcb192735f8e5d1222d5dcdc1eb Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 4 Feb 2024 19:22:35 +0200 Subject: [PATCH 7/9] Whitespace between CSS blocks --- python_docs_theme/static/pydoctheme.css | 1 + 1 file changed, 1 insertion(+) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 959a94e..87a0629 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -38,6 +38,7 @@ a[href] { a[href]:has(> code) { text-underline-offset: 0.25em; } + /* No underline for navigation */ a.headerlink, div.genindex-jumpbox a, From cc1161b2bbc3d7f11e14c1eda31963cc904cbd30 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 4 Feb 2024 12:56:06 -0700 Subject: [PATCH 8/9] README: Add link to preview build --- README.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 0a8db3f..5055bad 100644 --- a/README.rst +++ b/README.rst @@ -21,4 +21,11 @@ To use this theme, add the following to ``conf.py``: - ``html_theme = 'python_docs_theme'`` -- ``html_sidebars``, defaults taken from http://www.sphinx-doc.org/en/stable/config.html#confval-html_sidebars +- ``html_sidebars``, defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars + +Preview +------- + +See a demo of the CPython docs using this theme: + +- https://python-docs-theme-previews.readthedocs.io From b3d1ae14eb0c7223b3430d42c8a085aeece3f744 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 5 Feb 2024 13:50:50 +0200 Subject: [PATCH 9/9] Prepare 2024.2 release --- CHANGELOG.rst | 17 ++++++++++++----- pyproject.toml | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f44760d..0b02c3f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,18 +1,25 @@ -========= Changelog ========= +`2024.2 `_ +---------------------------------------------------------------------------- + +- Do not underline navigation links (#169) + Contributed by Hugo van Kemenade +- Only apply underline offset to code formatting for underline visibility (#171) + Contributed by Hugo van Kemenade + `2024.1 `_ ---------------------------------------------------------------------------- - Underline links for readability and a11y (#160, #166) - Contributed by Hugo van Kemenade + Contributed by Hugo van Kemenade - Add ``hosted_on`` variable for a link in the footer (#165) - Contributed by Hugo van Kemenade + Contributed by Hugo van Kemenade - Consistently reference ``theme_root_icon`` (#163) - Contributed by Marko Budiselic + Contributed by Marko Budiselic - Dark mode: fix contrast of footer highlight (#162) - Contributed by Hugo van Kemenade + Contributed by Hugo van Kemenade `2023.9 `_ ---------------------------------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index ce22aed..dd228f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = [ [project] name = "python-docs-theme" -version = "2024.1" +version = "2024.2" description = "The Sphinx theme for the CPython docs and related projects" readme = "README.rst" license.file = "LICENSE"