From b53d0b5896c2c9ca0241fc71290534276f1bd523 Mon Sep 17 00:00:00 2001 From: DivyaSimhadri1004 <322103311048@gvpce.ac.in> Date: Sun, 27 Jul 2025 16:29:36 +0530 Subject: [PATCH 1/6] Add manual dark/light mode toggle support for sphinx13 theme --- doc/_themes/sphinx13/layout.html | 34 ++++++++++++++------- doc/_themes/sphinx13/static/sphinx13.css | 38 ++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 10 deletions(-) diff --git a/doc/_themes/sphinx13/layout.html b/doc/_themes/sphinx13/layout.html index c6657365a09..26f754d1977 100644 --- a/doc/_themes/sphinx13/layout.html +++ b/doc/_themes/sphinx13/layout.html @@ -6,6 +6,24 @@ {%- if not embedded and pagename == root_doc %} {%- endif %} + {% endblock %} {% block header %} @@ -21,6 +39,9 @@ + {% endblock %} @@ -107,17 +128,10 @@

{{ _('On this page') }}

GitHub - - + + + Expand diff --git a/doc/_themes/sphinx13/static/sphinx13.css b/doc/_themes/sphinx13/static/sphinx13.css index 22bef884737..41ade4c4af0 100644 --- a/doc/_themes/sphinx13/static/sphinx13.css +++ b/doc/_themes/sphinx13/static/sphinx13.css @@ -785,3 +785,41 @@ ul.search li.kind-title { ul.search li.kind-text { list-style-type: "\1F4C4"; /* Unicode: Page Facing Up */ } +/* --- Dark Mode Overrides --- */ +.dark-mode { + background-color: #121212; + color: #f0f0f0; +} + +.dark-mode .pageheader, +.dark-mode .sphinxsidebar, +.dark-mode .footer, +.dark-mode .related { + background-color: #1f1f1f; + color: #eee; +} + +.dark-mode a { + color: #90caf9; +} + +.dark-mode h1, +.dark-mode h2, +.dark-mode h3 { + color: #ffeb3b; +} +/* Feature card fix for dark mode */ +.dark-mode .sphinx-feature { + background-color: #1e1e1e !important; + border: 1px solid #444; + color: #e0e0e0; +} + +.dark-mode .sphinx-feature a { + color: #90caf9; +} + +.dark-mode .sphinx-feature > p.admonition-title { + background-color: #2a2a2a !important; + color: #ffeb3b; +} From d18b68b356a916bc94a7a8ebaccf12020fd118f9 Mon Sep 17 00:00:00 2001 From: DivyaSimhadri1004 <322103311048@gvpce.ac.in> Date: Sun, 27 Jul 2025 16:31:16 +0530 Subject: [PATCH 2/6] Add manual dark/light mode toggle to sphinx13 theme --- tests/roots/test-root/wrongenc.inc | 2 +- tests/roots/test-warnings/wrongenc.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/roots/test-root/wrongenc.inc b/tests/roots/test-root/wrongenc.inc index 700f61344ff..a2ace312564 100644 --- a/tests/roots/test-root/wrongenc.inc +++ b/tests/roots/test-root/wrongenc.inc @@ -1,3 +1,3 @@ This file is encoded in latin-1 but at first read as utf-8. -Max Strau a in Mnchen eine Leberkssemmel. +Max Strauß aß in München eine Leberkässemmel. diff --git a/tests/roots/test-warnings/wrongenc.inc b/tests/roots/test-warnings/wrongenc.inc index 700f61344ff..a2ace312564 100644 --- a/tests/roots/test-warnings/wrongenc.inc +++ b/tests/roots/test-warnings/wrongenc.inc @@ -1,3 +1,3 @@ This file is encoded in latin-1 but at first read as utf-8. -Max Strau a in Mnchen eine Leberkssemmel. +Max Strauß aß in München eine Leberkässemmel. From 2ba5e0a285ea4de7ec8cc8759e253b5e35e1f388 Mon Sep 17 00:00:00 2001 From: DivyaSimhadri1004 <322103311048@gvpce.ac.in> Date: Mon, 28 Jul 2025 22:55:13 +0530 Subject: [PATCH 3/6] Revert unintended change to wrongenc.inc (restore from origin/master) --- tests/roots/test-root/wrongenc.inc | Bin 111 -> 227 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/roots/test-root/wrongenc.inc b/tests/roots/test-root/wrongenc.inc index a2ace312564d1d52d58ba8e20a0d3b9fc04c901a..3a26a1aa5d7bde55545684575b9c5d6c931979ab 100644 GIT binary patch literal 227 zcmXAjK?=e!5Jexj6TCws+(~napq1fu68!*?I?Ljk=U>kt{8-av$IE*n=x5)rB9abZ@NZPd$z1t z`Yoh*N_*5_RzEPl*JkF$QUV39V4Jk^GaNnL_B^PsbTe1R&!SgMEO3c`loQS&`OXsC&@cv_7sJKVYue#gq!?f*{ znW2Uvp*CHxwt&Pass}11LmVyk={l#h$Q$>l()tH77~j%=wjDH3jks}TefF Date: Mon, 28 Jul 2025 22:57:22 +0530 Subject: [PATCH 4/6] Refactor: Move dark mode toggle script to external JS file --- doc/_themes/sphinx13/layout.html | 52 +++++++++++++----------- doc/_themes/sphinx13/static/dark-mode.js | 16 ++++++++ 2 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 doc/_themes/sphinx13/static/dark-mode.js diff --git a/doc/_themes/sphinx13/layout.html b/doc/_themes/sphinx13/layout.html index 26f754d1977..a964094a7e9 100644 --- a/doc/_themes/sphinx13/layout.html +++ b/doc/_themes/sphinx13/layout.html @@ -6,24 +6,7 @@ {%- if not embedded and pagename == root_doc %} {%- endif %} - + {% endblock %} {% block header %} @@ -128,15 +111,36 @@

{{ _('On this page') }}

GitHub - - - + + + Expand - - - + {% endmacro %} diff --git a/doc/_themes/sphinx13/static/dark-mode.js b/doc/_themes/sphinx13/static/dark-mode.js new file mode 100644 index 00000000000..fbb6b123310 --- /dev/null +++ b/doc/_themes/sphinx13/static/dark-mode.js @@ -0,0 +1,16 @@ +document.addEventListener('DOMContentLoaded', () => { + const toggleBtn = document.getElementById('toggle-theme'); + const htmlTag = document.documentElement; + + const savedTheme = localStorage.getItem('theme'); + if (savedTheme === 'dark') { + htmlTag.classList.add('dark-mode'); + toggleBtn.textContent = '☀️ Light Mode'; + } + + toggleBtn?.addEventListener('click', () => { + const isDark = htmlTag.classList.toggle('dark-mode'); + localStorage.setItem('theme', isDark ? 'dark' : 'light'); + toggleBtn.textContent = isDark ? '☀️ Light Mode' : '🌙 Dark Mode'; + }); +}); From 9bf042b9eb2d5d4564647a2f9a6d4de8a7ec4117 Mon Sep 17 00:00:00 2001 From: DivyaSimhadri1004 <322103311048@gvpce.ac.in> Date: Tue, 29 Jul 2025 06:58:43 +0530 Subject: [PATCH 5/6] Fix: Correct SVG markup and link dark-mode.js externally --- doc/_themes/sphinx13/layout.html | 35 +++++++++++++------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/doc/_themes/sphinx13/layout.html b/doc/_themes/sphinx13/layout.html index a964094a7e9..a9dfe3e4fd5 100644 --- a/doc/_themes/sphinx13/layout.html +++ b/doc/_themes/sphinx13/layout.html @@ -112,27 +112,20 @@

{{ _('On this page') }}

GitHub + d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 + 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82 + -.01-1.49-2.01.37-2.53-.49-2.69-.94 + -.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52 + -.01-.53.63-.01 1.08.58 1.23.82 + .72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07 + -1.78-.2-3.64-.89-3.64-3.95 + 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 + 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27 + .68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82 + .44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 + 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 + 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 + 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"> From 4fd6360e4949c4284324aa6fc683b1f541126784 Mon Sep 17 00:00:00 2001 From: DivyaSimhadri1004 <322103311048@gvpce.ac.in> Date: Tue, 29 Jul 2025 07:11:41 +0530 Subject: [PATCH 6/6] Fix: Clean SVG and include external dark mode script --- doc/_themes/sphinx13/layout.html | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/doc/_themes/sphinx13/layout.html b/doc/_themes/sphinx13/layout.html index a9dfe3e4fd5..5fe3884d7ec 100644 --- a/doc/_themes/sphinx13/layout.html +++ b/doc/_themes/sphinx13/layout.html @@ -112,20 +112,19 @@

{{ _('On this page') }}

GitHub + d="M8 0C3.58 0 0 3.58 0 8c0 3.54 + 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 + 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94 + -.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53 + .63-.01 1.08.58 1.23.82.72 1.21 1.87.87 + 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 + 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 + 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27 + .68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82 + .44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 + 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 + 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38 + A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z">