From 0f18f099351a91b8357c5551c5b5355f238d27d1 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Thu, 4 Mar 2021 22:52:20 +0100 Subject: [PATCH 001/201] Add the copy button to pycon3 highlighted code blocks. (#64) --- python_docs_theme/static/copybutton.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_docs_theme/static/copybutton.js b/python_docs_theme/static/copybutton.js index f5960d26..16dee005 100644 --- a/python_docs_theme/static/copybutton.js +++ b/python_docs_theme/static/copybutton.js @@ -5,6 +5,7 @@ $(document).ready(function() { var div = $('.highlight-python .highlight,' + '.highlight-python3 .highlight,' + '.highlight-pycon .highlight,' + + '.highlight-pycon3 .highlight,' + '.highlight-default .highlight'); var pre = div.find('pre'); @@ -61,4 +62,3 @@ $(document).ready(function() { } }); }); - From 6d56e320fa5fb754a37dc39a6db1a1071ceeb00a Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Tue, 13 Apr 2021 23:16:07 +0200 Subject: [PATCH 002/201] Test Github action to validate the theme against docsbuild scripts. (#69) --- .github/workflows/tests.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..0462f5e8 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,34 @@ +name: Tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build_doc: + name: 'Build cpython doc' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: clone docsbuild scripts + run: | + git clone https://github.com/python/docsbuild-scripts/ + - name: setup requirements + run: | + python -m pip install --upgrade pip + python -m pip install jinja2 markupsafe + - name: build docs + run: | + python3 ./docsbuild-scripts/build_docs.py --quick --build-root ./build_root --www-root ./www --log-directory ./logs --group $(id -g) --skip-cache-invalidation --theme $(pwd) --language en --branch 3.9 + - name: 'Upload' + uses: actions/upload-artifact@v2.2.2 + with: + name: doc-html + path: www/ From 55864868d933d26fdb1bb2ccabba01f44ebba011 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Sat, 1 May 2021 06:20:29 -0400 Subject: [PATCH 003/201] Use default pygments theme (#68) The default theme looks a lot better than the default theme with the green background. --- python_docs_theme/theme.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_docs_theme/theme.conf b/python_docs_theme/theme.conf index bffa8c1c..ac8f097c 100644 --- a/python_docs_theme/theme.conf +++ b/python_docs_theme/theme.conf @@ -1,7 +1,7 @@ [theme] inherit = default stylesheet = pydoctheme.css -pygments_style = sphinx +pygments_style = default [options] bodyfont = 'Lucida Grande', Arial, sans-serif From 6892a232093ce2a6374eefebaf9a891f021560eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Wirtel?= Date: Wed, 5 May 2021 17:08:45 +0200 Subject: [PATCH 004/201] Use Python 3.8 for the Github Actions (#71) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0462f5e8..4fbd65c7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.8 - name: clone docsbuild scripts run: | git clone https://github.com/python/docsbuild-scripts/ From 844973206b71948abd113ea0ec24a9955ea1d6aa Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Fri, 7 May 2021 10:25:26 +0300 Subject: [PATCH 005/201] Make the theme responsive (#46) --- python_docs_theme/layout.html | 121 ++++++++-- python_docs_theme/static/caret-down.svg | 1 + python_docs_theme/static/menu.js | 55 +++++ python_docs_theme/static/py.svg | 14 ++ python_docs_theme/static/pydoctheme.css | 305 +++++++++++++++++++++++- python_docs_theme/theme.conf | 2 +- 6 files changed, 470 insertions(+), 28 deletions(-) create mode 100644 python_docs_theme/static/caret-down.svg create mode 100644 python_docs_theme/static/menu.js create mode 100644 python_docs_theme/static/py.svg diff --git a/python_docs_theme/layout.html b/python_docs_theme/layout.html index c4a48fa6..8a0d65d4 100644 --- a/python_docs_theme/layout.html +++ b/python_docs_theme/layout.html @@ -1,46 +1,121 @@ {% extends "classic/layout.html" %} -{% block rootrellink %} -
  • -
  • {{theme_root_name}}{{ reldelim1 }}
  • - {% if theme_root_include_title %} - {{ shorttitle }}{{ reldelim1 }} - {% endif %} -{% endblock %} +{%- macro relbar() %} +{# modified from sphinx/themes/basic/layout.html #} + +{%- endmacro %} {%- macro searchbox() %} {# modified from sphinx/themes/basic/searchbox.html #} {%- if builder != "htmlhelp" %} - @@ -59,16 +60,6 @@

    {{ _('Navigation') }}

    {% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} {% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} -{% block relbaritems %} -{%- if pagename != "search" and builder != "singlehtml" and builder != "htmlhelp" %} -
  • - {{ searchbox() }} - {{ reldelim2 }} -
  • -{%- endif %} -
  • {{ reldelim2 }}
  • -{% endblock %} - {%- block extrahead -%} diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 21be22c6..18ad6108 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -34,24 +34,23 @@ body { } div.related { + margin-top: 0.5em; margin-bottom: 1.2em; padding: 0.5em 0; - border-top: 1px solid #ccc; - margin-top: 0.5em; + border-width: 1px; + border-color: #ccc; } -div.related a:hover { - color: #0095c4; +.mobile-nav + div.related { + border-bottom-style: solid; } -div.related ~ div.related { - border-top: 1px solid #ccc; - border-bottom: none; +.document + div.related { + border-top-style: solid; } -div.related:first-child { - border-top: 0; - border-bottom: 1px solid #ccc; +div.related a:hover { + color: #0095c4; } .related .switchers { @@ -62,13 +61,6 @@ div.related:first-child { margin-right: 5px; } -.version_switcher_placeholder, -.language_switcher_placeholder { - padding-left: 5px; - background-color: white; -} - - div.related ul::after { content: ''; clear: both; diff --git a/python_docs_theme/static/pydoctheme_dark.css b/python_docs_theme/static/pydoctheme_dark.css index d263f949..c1016878 100644 --- a/python_docs_theme/static/pydoctheme_dark.css +++ b/python_docs_theme/static/pydoctheme_dark.css @@ -13,12 +13,7 @@ body { div.related { color: rgba(255, 255, 255, 0.7); /* classic overwrite */ - border-top-color: #424242; -} - -div.related:first-child { - /* use :first-child because border-color would need !important */ - border-bottom-color: #424242; + border-color: #424242; } /* SIDEBAR */ From dd5772236307153b1361b0e825f329cebe8df65d Mon Sep 17 00:00:00 2001 From: Septatrix <24257556+Septatrix@users.noreply.github.com> Date: Mon, 10 May 2021 16:38:16 +0200 Subject: [PATCH 039/201] Adjust to responsive changes --- python_docs_theme/static/pydoctheme.css | 16 ++++++++-------- python_docs_theme/static/pydoctheme_dark.css | 6 +++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 18ad6108..69a59df7 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -16,6 +16,12 @@ div.sphinxsidebar ul, div.sphinxsidebar h3, div.sphinxsidebar h3 a, div.sphinxsidebar h4, +.menu a, +.menu p, +.menu ul, +.menu h3, +.menu h3 a, +.menu h4, table.docutils td, table.indextable tr.cap, pre { @@ -213,6 +219,7 @@ table.docutils td, table.docutils th { border: 1px solid #ddd !important; border-radius: 3px; + padding: 0.3em 0.5em; } table p, @@ -222,12 +229,6 @@ table li { table.docutils th { background-color: #eee; - padding: 0.3em 0.5em; -} - -table.docutils td { - background-color: white; - padding: 0.3em 0.5em; } table.footnote, @@ -465,6 +466,7 @@ dl > dt span ~ em { width: 300px; height: 100%; background-color: #eee; + color: #444444; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); overflow-y: auto; } @@ -484,7 +486,6 @@ dl > dt span ~ em { font-size: 1.3em; } .menu-wrapper h3 { - color: #444444; font-size: 1.4em; } .menu-wrapper h3 + p, @@ -493,7 +494,6 @@ dl > dt span ~ em { } .menu a { font-size: smaller; - color: #444444; text-decoration: none; } .menu ul { diff --git a/python_docs_theme/static/pydoctheme_dark.css b/python_docs_theme/static/pydoctheme_dark.css index c1016878..2d574ad0 100644 --- a/python_docs_theme/static/pydoctheme_dark.css +++ b/python_docs_theme/static/pydoctheme_dark.css @@ -17,7 +17,7 @@ div.related { } /* SIDEBAR */ -div.sphinxsidebar { +div.sphinxsidebar, .menu-wrapper { background-color: #333; color: inherit; } @@ -112,3 +112,7 @@ div.note { .note code { background-color: rgba(255, 255, 255, 0.1); } + +.mobile-nav { + box-shadow: rgba(255, 255, 255, 0.25) 0 0 2px 0; +} \ No newline at end of file From 3bf3806b1f829b29ed5664b6772c1e9d163f270c Mon Sep 17 00:00:00 2001 From: Septatrix <24257556+Septatrix@users.noreply.github.com> Date: Fri, 18 Nov 2022 22:31:44 +0200 Subject: [PATCH 040/201] Fix more bugs with the new mobile view --- python_docs_theme/layout.html | 50 +++++++----- python_docs_theme/static/caret-down.svg | 1 - python_docs_theme/static/pydoctheme.css | 85 ++++++++++---------- python_docs_theme/static/pydoctheme_dark.css | 8 ++ python_docs_theme/static/themetoggle.js | 31 ++----- 5 files changed, 89 insertions(+), 86 deletions(-) delete mode 100644 python_docs_theme/static/caret-down.svg diff --git a/python_docs_theme/layout.html b/python_docs_theme/layout.html index f05f1660..3b284971 100644 --- a/python_docs_theme/layout.html +++ b/python_docs_theme/layout.html @@ -37,7 +37,7 @@

    {{ _('Navigation') }}

    {{ reldelim2 }} {%- endif %} -
  • {{ reldelim2 }}
  • +
  • {{ themeselector() }}{{ reldelim2 }}
  • {% endblock %} @@ -57,6 +57,17 @@

    {{ _('Navigation') }}

    {%- endif %} {%- endmacro %} +{%- macro themeselector() %} + +{%- endmacro %} + {% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} {% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} @@ -84,28 +95,31 @@

    {{ _('Navigation') }}

    -