From 8a4d4dfab73acdcca9d45ff33eb6a81e8ee39e23 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Thu, 13 Jan 2022 17:31:01 +0000 Subject: [PATCH 01/30] Update Makefile --- Makefile | 6 +----- build.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 080be0268b0..bfaa6c1e4fe 100644 --- a/Makefile +++ b/Makefile @@ -65,15 +65,11 @@ pep_rss: $(PYTHON) generate_rss.py pages: pep_rss - $(SPHINX_BUILD) --index-file + $(SPHINX_BUILD) --build-dirs --index-file sphinx: $(SPHINX_BUILD) -# for building Sphinx without a web-server -sphinx-local: - $(SPHINX_BUILD) --build-files - fail-warning: $(SPHINX_BUILD) --fail-on-warning diff --git a/build.py b/build.py index 784fbea547d..4c142fb6fe0 100644 --- a/build.py +++ b/build.py @@ -53,7 +53,7 @@ def create_index_file(html_root: Path, builder: str) -> None: sphinx_builder = "linkcheck" else: # default builder - sphinx_builder = "dirhtml" + sphinx_builder = "html" # other configuration config_overrides = {} From 4ae7aa33e7ca6fdc7dd7ee94203e266462275ca6 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Thu, 13 Jan 2022 17:50:15 +0000 Subject: [PATCH 02/30] Fix PEP 9 --- pep-0009.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pep-0009.txt b/pep-0009.txt index a94b4f5917f..4a9f3d6681c 100644 --- a/pep-0009.txt +++ b/pep-0009.txt @@ -11,6 +11,7 @@ Post-History: Resolution: https://mail.python.org/mailman/private/peps/2016-January/001165.html :: + Update As of 05-Jan-2016, this PEP is officially deprecated and replaced @@ -226,10 +227,11 @@ Resolution: https://mail.python.org/mailman/private/peps/2016-January/001165.htm -Local Variables: -mode: indented-text -indent-tabs-mode: nil -sentence-end-double-space: t -fill-column: 70 -coding: utf-8 -End: +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + coding: utf-8 + End: From c14d665358053e2c96d2f310115880c4b8da7469 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Thu, 13 Jan 2022 23:05:13 +0000 Subject: [PATCH 03/30] Fix comment blocks --- pep-0011.txt | 3 ++- pep-0610.rst | 3 ++- pep-0625.rst | 3 ++- pep-3139.txt | 15 ++++++++------- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pep-0011.txt b/pep-0011.txt index dba6ec7b364..b867018c80c 100644 --- a/pep-0011.txt +++ b/pep-0011.txt @@ -287,7 +287,8 @@ Copyright This document has been placed in the public domain. -.. + +.. Local Variables: mode: indented-text indent-tabs-mode: nil diff --git a/pep-0610.rst b/pep-0610.rst index f41e4616c65..d4aacffa44d 100644 --- a/pep-0610.rst +++ b/pep-0610.rst @@ -568,7 +568,8 @@ This document is placed in the public domain or under the CC0-1.0-Universal license, whichever is more permissive. -.. + +.. Local Variables: mode: indented-text indent-tabs-mode: nil diff --git a/pep-0625.rst b/pep-0625.rst index 4b39fba1d7f..dcebad94e63 100644 --- a/pep-0625.rst +++ b/pep-0625.rst @@ -158,7 +158,8 @@ This document is placed in the public domain or under the CC0-1.0-Universal license, whichever is more permissive. -.. + +.. Local Variables: mode: indented-text indent-tabs-mode: nil diff --git a/pep-3139.txt b/pep-3139.txt index b2a19e006ab..d6b79fffff9 100644 --- a/pep-3139.txt +++ b/pep-3139.txt @@ -185,10 +185,11 @@ Copyright -Local Variables: -mode: indented-text -indent-tabs-mode: nil -sentence-end-double-space: t -fill-column: 70 -coding: utf-8 -End: +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + coding: utf-8 + End: From 137e92928a85c30c76959906b08aebcc6cedafc1 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Wed, 12 Jan 2022 22:09:48 +0000 Subject: [PATCH 04/30] Dark mode --- .../pep_theme/static/style.css | 104 +++++++++--------- .../pep_theme/templates/page.html | 4 +- pep_sphinx_extensions/pep_theme/theme.conf | 1 + 3 files changed, 54 insertions(+), 55 deletions(-) diff --git a/pep_sphinx_extensions/pep_theme/static/style.css b/pep_sphinx_extensions/pep_theme/static/style.css index a23a9ae600c..6108e5752f3 100644 --- a/pep_sphinx_extensions/pep_theme/static/style.css +++ b/pep_sphinx_extensions/pep_theme/static/style.css @@ -1,40 +1,36 @@ @charset "UTF-8"; -/* Styles for PEPs +/* Styles for PEPs */ -Colours: -white: - background - footnotes/references vertical border -#333 - body text -#888 - blockquote left line - header breadcrumbs separator - link underline (hovered/focused) -#ccc: - scrollbar -#ddd - header bottom border - horizontal rule - table vertical border -#eee: - link underline - table rows & top/bottom border - PEP header rows - footnotes/references rows - admonition note background -#f8f8f8: - inline code background - -#0072aa: - links -# fee: - admonition warning background - -*/ +/* Set master 'light-mode' colours (default) */ +:root { + --colour-background: white; + --colour-background-accent: #eee; + --colour-text: #333; + --colour-links: #0072aa; + --colour-scrollbar: #ccc; + --colour-rule-strong: #888; + --colour-rule-light: #ddd; + --colour-inline-code: #f8f8f8; + --colour-warning: #fee; +} +/* Set master 'dark-mode' colours */ +@media (prefers-color-scheme: dark) { + :root { + --colour-background: #000; + --colour-background-accent: #111; + --colour-text: #ccc; + --colour-links: #47c; + --colour-scrollbar: #333; + --colour-rule-strong: #777; + --colour-rule-light: #222; + --colour-inline-code: #222; + --colour-warning: #900; + } +} /* Set master rules */ * {box-sizing: border-box} +:root {color-scheme: light dark} html { overflow-y: scroll; -webkit-font-smoothing: antialiased; @@ -46,8 +42,8 @@ html { } body { margin: 0; - color: #333; - background-color: white; + color: var(--colour-text); + background-color: var(--colour-background); } section#pep-page-section { padding: 0.25rem 0.25rem 0; @@ -95,19 +91,19 @@ h6 { a, a:active, a:visited { - color: #0072aa; - text-decoration-color: #eee; + color: var(--colour-links); + text-decoration-color: var(--colour-background-accent); display: inline; } a:hover, a:focus { - text-decoration-color: #888; + text-decoration-color: var(--colour-rule-strong); } /* Blockquote rules */ blockquote { font-style: italic; - border-left: 1px solid #888; + border-left: 1px solid var(--colour-rule-strong); margin: .5rem; padding: .5rem 1rem; } @@ -130,7 +126,7 @@ code { } code.literal { font-size: .8em; - background-color: #f8f8f8; + background-color: var(--colour-inline-code); } pre { padding: .5rem .75rem; @@ -147,7 +143,7 @@ dl dd { /* Horizontal rule rule */ hr { border: 0; - border-top: 1px solid #ddd; + border-top: 1px solid var(--colour-rule-light); margin: 1.75rem 0; } /*Image rules */ @@ -187,14 +183,14 @@ sub {bottom: -0.25em} table { width: 100%; border-collapse: collapse; - border-top: 1px solid #eee; - border-bottom: 1px solid #eee; + border-top: 1px solid var(--colour-background-accent); + border-bottom: 1px solid var(--colour-background-accent); } table caption { margin: 1rem 0 .75rem; } table tbody tr:nth-of-type(odd) { - background-color: #eee; + background-color: var(--colour-background-accent); } table th, table td { @@ -202,19 +198,19 @@ table td { padding: 0.25rem 0.5rem 0.2rem; } table td + td { - border-left: 1px solid #ddd; + border-left: 1px solid var(--colour-rule-light); } /* Breadcrumbs rules */ section#pep-page-section > header { - border-bottom: 1px solid #ddd; + border-bottom: 1px solid var(--colour-rule-light); } section#pep-page-section > header > h1 { font-size: 1.1rem; margin: 0; display: inline-block; padding-right: .6rem; - border-right: 1px solid #888; + border-right: 1px solid var(--colour-rule-strong); } ul.breadcrumbs { margin: 0; @@ -237,10 +233,10 @@ div.warning { margin-bottom: 1rem; } div.note { - background-color: #eee; + background-color: var(--colour-background-accent); } div.warning { - background-color: #fee; + background-color: var(--colour-warning); } p.admonition-title { font-weight: bold; @@ -253,8 +249,8 @@ dl.footnote { grid-template-columns: fit-content(30%) auto; line-height: 1.875; width: 100%; - border-top: 1px solid #eee; - border-bottom: 1px solid #eee; + border-top: 1px solid var(--colour-background-accent); + border-bottom: 1px solid var(--colour-background-accent); } dl.rfc2822 > dt, dl.rfc2822 > dd, dl.footnote > dt, dl.footnote > dd { @@ -262,11 +258,11 @@ dl.footnote > dt, dl.footnote > dd { } dl.rfc2822 > dt:nth-of-type(even), dl.rfc2822 > dd:nth-of-type(even), dl.footnote > dt:nth-of-type(even), dl.footnote > dd:nth-of-type(even) { - background-color: #eee; + background-color: var(--colour-background-accent); } dl.footnote > dt { font-weight: normal; - border-right: 1px solid white; + border-right: 1px solid var(--colour-background); } /* Sidebar formatting */ @@ -276,11 +272,11 @@ nav#pep-sidebar { top: 0; height: 100vh; scrollbar-width: thin; /* CSS Standards, not *yet* widely supported */ - scrollbar-color: #ccc transparent; + scrollbar-color: var(--colour-scrollbar) transparent; } nav#pep-sidebar::-webkit-scrollbar {width: 6px} nav#pep-sidebar::-webkit-scrollbar-track {background: transparent} -nav#pep-sidebar::-webkit-scrollbar-thumb {background: #ccc} +nav#pep-sidebar::-webkit-scrollbar-thumb {background: var(--colour-scrollbar)} nav#pep-sidebar > h2 { font-size: 1.4rem; } diff --git a/pep_sphinx_extensions/pep_theme/templates/page.html b/pep_sphinx_extensions/pep_theme/templates/page.html index d47644a73c8..c440b5e2150 100644 --- a/pep_sphinx_extensions/pep_theme/templates/page.html +++ b/pep_sphinx_extensions/pep_theme/templates/page.html @@ -4,11 +4,13 @@
+