python-docs-theme 2023.9__tar.gz → 2024.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/PKG-INFO +13 -6
  2. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/README.rst +9 -2
  3. python_docs_theme-2024.2/pyproject.toml +45 -0
  4. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/__init__.py +5 -3
  5. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/layout.html +5 -4
  6. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/static/menu.js +1 -1
  7. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/static/pydoctheme.css +41 -1
  8. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/static/pydoctheme_dark.css +4 -0
  9. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/theme.conf +2 -0
  10. python_docs_theme-2023.9/pyproject.toml +0 -50
  11. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/LICENSE +0 -0
  12. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/footerdonate.html +0 -0
  13. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/static/copybutton.js +0 -0
  14. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/static/py.png +0 -0
  15. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/static/py.svg +0 -0
  16. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/static/search-focus.js +0 -0
  17. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/static/sidebar.js_t +0 -0
  18. {python_docs_theme-2023.9 → python_docs_theme-2024.2}/python_docs_theme/static/themetoggle.js +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-docs-theme
3
- Version: 2023.9
3
+ Version: 2024.2
4
4
  Summary: The Sphinx theme for the CPython docs and related projects
5
5
  Author-email: PyPA <distutils-sig@python.org>
6
6
  Requires-Python: >=3.8
@@ -10,16 +10,16 @@ Classifier: Framework :: Sphinx :: Theme
10
10
  Classifier: Intended Audience :: Developers
11
11
  Classifier: License :: OSI Approved :: Python Software Foundation License
12
12
  Classifier: Operating System :: OS Independent
13
- Classifier: Topic :: Documentation
14
- Classifier: Topic :: Software Development :: Documentation
15
13
  Classifier: Programming Language :: Python
16
- Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
17
15
  Classifier: Programming Language :: Python :: 3.8
18
16
  Classifier: Programming Language :: Python :: 3.9
19
17
  Classifier: Programming Language :: Python :: 3.10
20
18
  Classifier: Programming Language :: Python :: 3.11
21
19
  Classifier: Programming Language :: Python :: 3.12
22
20
  Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Documentation
22
+ Classifier: Topic :: Software Development :: Documentation
23
23
  Project-URL: Code, https://github.com/python/python-docs-theme
24
24
  Project-URL: Download, https://pypi.org/project/python-docs-theme/
25
25
  Project-URL: Homepage, https://github.com/python/python-docs-theme/
@@ -37,7 +37,7 @@ projects if you so choose, but please keep in mind that in doing so you're also
37
37
  choosing to accept some of the responsibility for maintaining that collective
38
38
  trust.
39
39
 
40
- To use the theme, install it into your docs build environment via ``pip``
40
+ To use the theme, install it into your docs build environment via ``pip``
41
41
  (preferably in a virtual environment).
42
42
 
43
43
 
@@ -48,5 +48,12 @@ To use this theme, add the following to ``conf.py``:
48
48
 
49
49
  - ``html_theme = 'python_docs_theme'``
50
50
 
51
- - ``html_sidebars``, defaults taken from http://www.sphinx-doc.org/en/stable/config.html#confval-html_sidebars
51
+ - ``html_sidebars``, defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
52
+
53
+ Preview
54
+ -------
55
+
56
+ See a demo of the CPython docs using this theme:
57
+
58
+ - https://python-docs-theme-previews.readthedocs.io
52
59
 
@@ -10,7 +10,7 @@ projects if you so choose, but please keep in mind that in doing so you're also
10
10
  choosing to accept some of the responsibility for maintaining that collective
11
11
  trust.
12
12
 
13
- To use the theme, install it into your docs build environment via ``pip``
13
+ To use the theme, install it into your docs build environment via ``pip``
14
14
  (preferably in a virtual environment).
15
15
 
16
16
 
@@ -21,4 +21,11 @@ To use this theme, add the following to ``conf.py``:
21
21
 
22
22
  - ``html_theme = 'python_docs_theme'``
23
23
 
24
- - ``html_sidebars``, defaults taken from http://www.sphinx-doc.org/en/stable/config.html#confval-html_sidebars
24
+ - ``html_sidebars``, defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
25
+
26
+ Preview
27
+ -------
28
+
29
+ See a demo of the CPython docs using this theme:
30
+
31
+ - https://python-docs-theme-previews.readthedocs.io
@@ -0,0 +1,45 @@
1
+ [build-system]
2
+ build-backend = "flit_core.buildapi"
3
+ requires = [
4
+ "flit_core>=3.7",
5
+ ]
6
+
7
+ [project]
8
+ name = "python-docs-theme"
9
+ version = "2024.2"
10
+ description = "The Sphinx theme for the CPython docs and related projects"
11
+ readme = "README.rst"
12
+ license.file = "LICENSE"
13
+ authors = [{name = "PyPA", email = "distutils-sig@python.org"}]
14
+ requires-python = ">=3.8"
15
+ classifiers = [
16
+ "Development Status :: 5 - Production/Stable",
17
+ "Framework :: Sphinx :: Theme",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: Python Software Foundation License",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python",
22
+ "Programming Language :: Python :: 3 :: Only",
23
+ "Programming Language :: Python :: 3.8",
24
+ "Programming Language :: Python :: 3.9",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Topic :: Documentation",
30
+ "Topic :: Software Development :: Documentation",
31
+ ]
32
+ urls.Code = "https://github.com/python/python-docs-theme"
33
+ urls.Download = "https://pypi.org/project/python-docs-theme/"
34
+ urls.Homepage = "https://github.com/python/python-docs-theme/"
35
+ urls."Issue tracker" = "https://github.com/python/python-docs-theme/issues"
36
+ [project.entry-points."sphinx.html_themes"]
37
+ python_docs_theme = 'python_docs_theme'
38
+
39
+ [tool.flit.module]
40
+ name = "python_docs_theme"
41
+
42
+ [tool.flit.sdist]
43
+ include = [
44
+ "python_docs_theme/",
45
+ ]
@@ -1,8 +1,10 @@
1
+ from __future__ import annotations
2
+
1
3
  import hashlib
2
4
  import os
3
5
  from functools import lru_cache
4
6
  from pathlib import Path
5
- from typing import Any, Dict, List
7
+ from typing import Any
6
8
 
7
9
  import sphinx.application
8
10
  from sphinx.builders.html import StandaloneHTMLBuilder
@@ -19,7 +21,7 @@ def _asset_hash(path: str) -> str:
19
21
  return f"{path}?digest={digest}"
20
22
 
21
23
 
22
- def _add_asset_hashes(static: List[str], add_digest_to: List[str]) -> None:
24
+ def _add_asset_hashes(static: list[str], add_digest_to: list[str]) -> None:
23
25
  for asset in add_digest_to:
24
26
  index = static.index(asset)
25
27
  static[index].filename = _asset_hash(asset) # type: ignore
@@ -29,7 +31,7 @@ def _html_page_context(
29
31
  app: sphinx.application.Sphinx,
30
32
  pagename: str,
31
33
  templatename: str,
32
- context: Dict[str, Any],
34
+ context: dict[str, Any],
33
35
  doctree: Any,
34
36
  ) -> None:
35
37
  if app.config.html_theme != "python_docs_theme":
@@ -14,7 +14,7 @@
14
14
  </li>
15
15
  {%- endfor %}
16
16
  {%- block rootrellink %}
17
- <li><img src="{{ pathto('_static/py.svg', 1) }}" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
17
+ <li><img src="{{ pathto('_static/' ~ theme_root_icon, 1) }}" alt="{{ theme_root_icon_alt_text }}" style="vertical-align: middle; margin-top: -1px"/></li>
18
18
  <li><a href="{{theme_root_url}}">{{theme_root_name}}</a>{{ reldelim1 }}</li>
19
19
  <li class="switchers">
20
20
  <div class="language_switcher_placeholder"></div>
@@ -71,7 +71,7 @@
71
71
 
72
72
  {%- block extrahead -%}
73
73
  <link rel="stylesheet" href="{{ pathto('_static/pydoctheme_dark.css', 1) }}" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">
74
- <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/' + theme_root_icon, 1) }}" />
74
+ <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/' ~ theme_root_icon, 1) }}" />
75
75
  {%- if builder != "htmlhelp" %}
76
76
  {%- if not embedded %}
77
77
  <script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>
@@ -100,7 +100,7 @@
100
100
  </label>
101
101
  <span class="nav-items-wrapper">
102
102
  <a href="{{ theme_root_url }}" class="nav-logo">
103
- <img src="{{ pathto('_static/py.svg', 1) }}" alt="Logo"/>
103
+ <img src="{{ pathto('_static/' ~ theme_root_icon, 1) }}" alt="{{ theme_root_icon_alt_text }}"/>
104
104
  </a>
105
105
  <span class="version_switcher_placeholder"></span>
106
106
  {%- if pagename != "search" and builder != "singlehtml" %}
@@ -121,7 +121,7 @@
121
121
  {%- if logo %}
122
122
  <p class="logo">
123
123
  <a href="{{ pathto('index') }}">
124
- <img class="logo" src="{{ pathto('_static/' + logo, 1)|e }}" alt="Logo"/>
124
+ <img class="logo" src="{{ pathto('_static/' ~ logo, 1)|e }}" alt="Logo"/>
125
125
  </a>
126
126
  </p>
127
127
  {%- endif %}
@@ -143,6 +143,7 @@
143
143
  {% trans %}Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.{% endtrans %}
144
144
  <br />
145
145
  {% if theme_license_url %}{% trans license_file=theme_license_url %}See <a href="{{ license_file }}">History and License</a> for more information.{% endtrans %}<br />{% endif %}
146
+ {% if theme_hosted_on %}{% trans hosted_on=theme_hosted_on %}Hosted on {{ hosted_on }}.{% endtrans %}<br />{% endif %}
146
147
  <br />
147
148
 
148
149
  {% include "footerdonate.html" %}
@@ -54,4 +54,4 @@ document.addEventListener("DOMContentLoaded", function () {
54
54
  closeMenu()
55
55
  }
56
56
  })
57
- })
57
+ })
@@ -29,6 +29,42 @@ pre {
29
29
  color: inherit;
30
30
  }
31
31
 
32
+ /* Add underlines to links */
33
+ a[href] {
34
+ text-decoration: underline 1px;
35
+ }
36
+
37
+ /* Increase the underline offset for code to avoid obscuring underscores */
38
+ a[href]:has(> code) {
39
+ text-underline-offset: 0.25em;
40
+ }
41
+
42
+ /* No underline for navigation */
43
+ a.headerlink,
44
+ div.genindex-jumpbox a,
45
+ div.modindex-jumpbox a,
46
+ div#search-results a,
47
+ div.sphinxsidebar a,
48
+ div.toctree-wrapper a,
49
+ div[role=navigation] a,
50
+ table.contentstable a,
51
+ table.indextable a {
52
+ text-decoration: none;
53
+ }
54
+
55
+ /* Except when hovered */
56
+ div.genindex-jumpbox a:hover,
57
+ div.modindex-jumpbox a:hover,
58
+ div#search-results a:hover,
59
+ div.sphinxsidebar a:hover,
60
+ div.toctree-wrapper a:hover,
61
+ div[role=navigation] a:hover,
62
+ table.contentstable a:hover,
63
+ table.indextable a:hover {
64
+ text-decoration: underline;
65
+ text-underline-offset: auto;
66
+ }
67
+
32
68
  body {
33
69
  margin-left: 1em;
34
70
  margin-right: 1em;
@@ -177,7 +213,7 @@ div.body {
177
213
 
178
214
  div.body p, div.body dd, div.body li, div.body blockquote {
179
215
  text-align: left;
180
- line-height: 1.4;
216
+ line-height: 1.6;
181
217
  }
182
218
  div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 {
183
219
  margin: 0;
@@ -279,6 +315,10 @@ div.footer {
279
315
  margin-right: 10px;
280
316
  }
281
317
 
318
+ div.footer a {
319
+ text-underline-offset: auto;
320
+ }
321
+
282
322
  div.footer a:hover {
283
323
  color: #0095c4;
284
324
  }
@@ -60,6 +60,10 @@ span.highlighted {
60
60
  background-color: #616161;
61
61
  }
62
62
 
63
+ .footnote:target {
64
+ background-color: #2c3e50;
65
+ }
66
+
63
67
  /* Below for most things in text */
64
68
 
65
69
  dl.field-list > dt {
@@ -26,10 +26,12 @@ headlinkcolor = #aaaaaa
26
26
  codebgcolor = #eeffcc
27
27
  codetextcolor = #333333
28
28
 
29
+ hosted_on =
29
30
  issues_url =
30
31
  license_url =
31
32
  root_name = Python
32
33
  root_url = https://www.python.org/
33
34
  root_icon = py.svg
35
+ root_icon_alt_text = Python logo
34
36
  root_include_title = True
35
37
  copyright_url =
@@ -1,50 +0,0 @@
1
- [build-system]
2
- requires = ["flit_core>=3.7"]
3
- build-backend = "flit_core.buildapi"
4
-
5
- # project metadata
6
- [project]
7
- name = "python-docs-theme"
8
- version = "2023.9"
9
- description = "The Sphinx theme for the CPython docs and related projects"
10
- readme = "README.rst"
11
- urls.Code = "https://github.com/python/python-docs-theme"
12
- urls.Download = "https://pypi.org/project/python-docs-theme/"
13
- urls.Homepage = "https://github.com/python/python-docs-theme/"
14
- urls."Issue tracker" = "https://github.com/python/python-docs-theme/issues"
15
- license.file = "LICENSE"
16
- requires-python = ">=3.8"
17
-
18
- # Classifiers list: https://pypi.org/classifiers/
19
- classifiers = [
20
- "Development Status :: 5 - Production/Stable",
21
- "Framework :: Sphinx :: Theme",
22
- "Intended Audience :: Developers",
23
- "License :: OSI Approved :: Python Software Foundation License",
24
- "Operating System :: OS Independent",
25
- "Topic :: Documentation",
26
- "Topic :: Software Development :: Documentation",
27
- "Programming Language :: Python",
28
- "Programming Language :: Python :: 3",
29
- "Programming Language :: Python :: 3.8",
30
- "Programming Language :: Python :: 3.9",
31
- "Programming Language :: Python :: 3.10",
32
- "Programming Language :: Python :: 3.11",
33
- "Programming Language :: Python :: 3.12",
34
- "Programming Language :: Python :: 3.13",
35
- ]
36
-
37
- [[project.authors]]
38
- name = "PyPA"
39
- email = "distutils-sig@python.org"
40
-
41
- [project.entry-points."sphinx.html_themes"]
42
- python_docs_theme = 'python_docs_theme'
43
-
44
- [tool.flit.module]
45
- name = "python_docs_theme"
46
-
47
- [tool.flit.sdist]
48
- include = [
49
- "python_docs_theme/",
50
- ]