python-docs-theme 2024.3__tar.gz → 2024.6__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 (17) hide show
  1. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/PKG-INFO +13 -12
  2. python_docs_theme-2024.3/README.rst → python_docs_theme-2024.6/README.md +11 -10
  3. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/pyproject.toml +31 -5
  4. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/__init__.py +1 -1
  5. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/layout.html +19 -5
  6. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/static/pydoctheme.css +139 -7
  7. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/static/pydoctheme_dark.css +40 -4
  8. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/LICENSE +0 -0
  9. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/footerdonate.html +0 -0
  10. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/static/copybutton.js +0 -0
  11. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/static/menu.js +0 -0
  12. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/static/py.png +0 -0
  13. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/static/py.svg +0 -0
  14. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/static/search-focus.js +0 -0
  15. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/static/sidebar.js_t +0 -0
  16. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/static/themetoggle.js +0 -0
  17. {python_docs_theme-2024.3 → python_docs_theme-2024.6}/python_docs_theme/theme.conf +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-docs-theme
3
- Version: 2024.3
3
+ Version: 2024.6
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
7
- Description-Content-Type: text/x-rst
7
+ Description-Content-Type: text/markdown
8
8
  Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Framework :: Sphinx :: Theme
10
10
  Classifier: Intended Audience :: Developers
@@ -25,8 +25,7 @@ Project-URL: Download, https://pypi.org/project/python-docs-theme/
25
25
  Project-URL: Homepage, https://github.com/python/python-docs-theme/
26
26
  Project-URL: Issue tracker, https://github.com/python/python-docs-theme/issues
27
27
 
28
- Python Docs Sphinx Theme
29
- =========================
28
+ # Python Docs Sphinx Theme
30
29
 
31
30
  This is the theme for the Python documentation.
32
31
 
@@ -37,23 +36,25 @@ projects if you so choose, but please keep in mind that in doing so you're also
37
36
  choosing to accept some of the responsibility for maintaining that collective
38
37
  trust.
39
38
 
40
- To use the theme, install it into your docs build environment via ``pip``
39
+ To use the theme, install it into your docs build environment via `pip`
41
40
  (preferably in a virtual environment).
42
41
 
43
42
 
44
- Configuration options
45
- ---------------------
43
+ ## Configuration options
46
44
 
47
- To use this theme, add the following to ``conf.py``:
45
+ To use this theme, add the following to `conf.py`:
48
46
 
49
- - ``html_theme = 'python_docs_theme'``
47
+ - `html_theme = 'python_docs_theme'`
50
48
 
51
- - ``html_sidebars``, defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
49
+ - `html_sidebars`, defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
52
50
 
53
- Preview
54
- -------
51
+ ## Preview
55
52
 
56
53
  See a demo of the CPython docs using this theme:
57
54
 
58
55
  - https://python-docs-theme-previews.readthedocs.io
59
56
 
57
+ The kitchen sink is a showcase of every Sphinx feature:
58
+
59
+ - https://sphinx-themes.org/sample-sites/python-docs-theme/kitchen-sink/
60
+
@@ -1,5 +1,4 @@
1
- Python Docs Sphinx Theme
2
- =========================
1
+ # Python Docs Sphinx Theme
3
2
 
4
3
  This is the theme for the Python documentation.
5
4
 
@@ -10,22 +9,24 @@ projects if you so choose, but please keep in mind that in doing so you're also
10
9
  choosing to accept some of the responsibility for maintaining that collective
11
10
  trust.
12
11
 
13
- To use the theme, install it into your docs build environment via ``pip``
12
+ To use the theme, install it into your docs build environment via `pip`
14
13
  (preferably in a virtual environment).
15
14
 
16
15
 
17
- Configuration options
18
- ---------------------
16
+ ## Configuration options
19
17
 
20
- To use this theme, add the following to ``conf.py``:
18
+ To use this theme, add the following to `conf.py`:
21
19
 
22
- - ``html_theme = 'python_docs_theme'``
20
+ - `html_theme = 'python_docs_theme'`
23
21
 
24
- - ``html_sidebars``, defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
22
+ - `html_sidebars`, defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
25
23
 
26
- Preview
27
- -------
24
+ ## Preview
28
25
 
29
26
  See a demo of the CPython docs using this theme:
30
27
 
31
28
  - https://python-docs-theme-previews.readthedocs.io
29
+
30
+ The kitchen sink is a showcase of every Sphinx feature:
31
+
32
+ - https://sphinx-themes.org/sample-sites/python-docs-theme/kitchen-sink/
@@ -6,9 +6,9 @@ requires = [
6
6
 
7
7
  [project]
8
8
  name = "python-docs-theme"
9
- version = "2024.3"
9
+ version = "2024.6"
10
10
  description = "The Sphinx theme for the CPython docs and related projects"
11
- readme = "README.rst"
11
+ readme = "README.md"
12
12
  license.file = "LICENSE"
13
13
  authors = [{name = "PyPA", email = "distutils-sig@python.org"}]
14
14
  requires-python = ">=3.8"
@@ -44,6 +44,32 @@ include = [
44
44
  "python_docs_theme/",
45
45
  ]
46
46
 
47
- [tool.isort]
48
- add_imports = "from __future__ import annotations"
49
- profile = "black"
47
+ [tool.ruff]
48
+ fix = true
49
+
50
+ [tool.ruff.lint]
51
+ select = [
52
+ "C4", # flake8-comprehensions
53
+ "E", # pycodestyle errors
54
+ "F", # pyflakes errors
55
+ "I", # isort
56
+ "ISC", # flake8-implicit-str-concat
57
+ "LOG", # flake8-logging
58
+ "PGH", # pygrep-hooks
59
+ "PYI", # flake8-pyi
60
+ "RUF100", # unused noqa (yesqa)
61
+ "RUF022", # unsorted-dunder-all
62
+ "UP", # pyupgrade
63
+ "W", # pycodestyle warnings
64
+ "YTT", # flake8-2020
65
+ ]
66
+ ignore = [
67
+ "E203", # Whitespace before ':'
68
+ "E221", # Multiple spaces before operator
69
+ "E226", # Missing whitespace around arithmetic operator
70
+ "E241", # Multiple spaces after ','
71
+ ]
72
+
73
+
74
+ [tool.ruff.lint.isort]
75
+ required-imports = ["from __future__ import annotations"]
@@ -24,7 +24,7 @@ def _asset_hash(path: str) -> str:
24
24
  def _add_asset_hashes(static: list[str], add_digest_to: list[str]) -> None:
25
25
  for asset in add_digest_to:
26
26
  index = static.index(asset)
27
- static[index].filename = _asset_hash(asset) # type: ignore
27
+ static[index].filename = _asset_hash(asset) # type: ignore[attr-defined]
28
28
 
29
29
 
30
30
  def _html_page_context(
@@ -136,21 +136,35 @@
136
136
 
137
137
  {% block footer %}
138
138
  <div class="footer">
139
- &copy; {% if theme_copyright_url or hasdoc('copyright') %}<a href="{% if theme_copyright_url %}{{ theme_copyright_url }}{% else %}{{ pathto('copyright') }}{% endif %}">{% endif %}{% trans %}Copyright{% endtrans %}{% if theme_copyright_url or hasdoc('copyright') %}</a>{% endif %} {{ copyright|e }}.
139
+ &copy; {% if theme_copyright_url or hasdoc('copyright') %}
140
+ <a href="{% if theme_copyright_url %}{{ theme_copyright_url }}{% else %}{{ pathto('copyright') }}{% endif %}">
141
+ {% endif %}
142
+ {% trans %}Copyright{% endtrans %}
143
+ {% if theme_copyright_url or hasdoc('copyright') %}
144
+ </a>
145
+ {% endif %} {{ copyright|e }}.
140
146
  <br />
141
147
  {% trans %}This page is licensed under the Python Software Foundation License Version 2.{% endtrans %}
142
148
  <br />
143
149
  {% trans %}Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.{% endtrans %}
144
150
  <br />
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 %}
151
+ {% if theme_license_url %}
152
+ {% trans license_file=theme_license_url %}See <a href="{{ license_file }}">History and License</a> for more information.{% endtrans %}<br />
153
+ {% endif %}
154
+ {% if theme_hosted_on %}
155
+ {% trans hosted_on=theme_hosted_on %}Hosted on {{ hosted_on }}.{% endtrans %}<br />
156
+ {% endif %}
147
157
  <br />
148
158
 
149
159
  {% include "footerdonate.html" %}
150
160
  <br />
151
161
 
152
- {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
153
- {% if theme_issues_url %}{% trans %}<a href="{{ theme_issues_url }}">Found a bug</a>?{% endtrans %}{% endif %}
162
+ {%- if last_updated %}
163
+ {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
164
+ {%- endif %}
165
+ {% if theme_issues_url %}
166
+ {% trans %}<a href="{{ theme_issues_url }}">Found a bug</a>?{% endtrans %}
167
+ {% endif %}
154
168
  <br />
155
169
 
156
170
  {% trans sphinx_version=sphinx_version|e %}Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
@@ -1,5 +1,15 @@
1
1
  @import url('classic.css');
2
2
 
3
+ /* Common colours */
4
+ :root {
5
+ --good-color: rgb(41 100 51);
6
+ --good-border: rgb(79 196 100);
7
+ --middle-color: rgb(133 72 38);
8
+ --middle-border: rgb(244, 227, 76);
9
+ --bad-color: rgb(159 49 51);
10
+ --bad-border: rgb(244, 76, 78);
11
+ }
12
+
3
13
  /* unset some styles from the classic stylesheet */
4
14
  div.document,
5
15
  div.body,
@@ -232,7 +242,76 @@ div.body pre {
232
242
  border: 1px solid #ac9;
233
243
  }
234
244
 
235
- div.body div.admonition,
245
+ /* Admonitions */
246
+ :root {
247
+ --admonition-background: #eee;
248
+ --admonition-border: #ccc;
249
+ --admonition-color: black;
250
+ --attention-background: #bbddff5c;
251
+ --attention-border: #0000ff36;
252
+ --caution-background: #ffc;
253
+ --caution-border: #dd6;
254
+ --danger-background: #ffe4e4;
255
+ --danger-border: red;
256
+ --error-background: #ffe4e4;
257
+ --error-border: red;
258
+ --hint-background: #dfd;
259
+ --hint-border: green;
260
+ --seealso-background: #ffc;
261
+ --seealso-border: #dd6;
262
+ --tip-background: #dfd;
263
+ --tip-border: green;
264
+ --warning-background: #ffe4e4;
265
+ --warning-border: red;
266
+ }
267
+
268
+ div.body div.admonition {
269
+ background-color: var(--admonition-background);
270
+ border: 1px solid var(--admonition-border);
271
+ border-radius: 3px;
272
+ color: var(--admonition-color);
273
+ }
274
+
275
+ div.body div.admonition.attention {
276
+ background-color: var(--attention-background);
277
+ border-color: var(--attention-border);
278
+ }
279
+
280
+ div.body div.admonition.caution {
281
+ background-color: var(--caution-background);
282
+ border-color: var(--caution-border);
283
+ }
284
+
285
+ div.body div.admonition.danger {
286
+ background-color: var(--danger-background);
287
+ border-color: var(--danger-border);
288
+ }
289
+
290
+ div.body div.admonition.error {
291
+ background-color: var(--error-background);
292
+ border-color: var(--error-border);
293
+ }
294
+
295
+ div.body div.admonition.hint {
296
+ background-color: var(--hint-background);
297
+ border-color: var(--hint-border);
298
+ }
299
+
300
+ div.body div.admonition.seealso {
301
+ background-color: var(--seealso-background);
302
+ border-color: var(--seealso-border);
303
+ }
304
+
305
+ div.body div.admonition.tip {
306
+ background-color: var(--tip-background);
307
+ border-color: var(--tip-border);
308
+ }
309
+
310
+ div.body div.admonition.warning {
311
+ background-color: var(--warning-background);
312
+ border-color: var(--warning-border);
313
+ }
314
+
236
315
  div.body div.impl-detail {
237
316
  border-radius: 3px;
238
317
  }
@@ -241,10 +320,6 @@ div.body div.impl-detail > p {
241
320
  margin: 0;
242
321
  }
243
322
 
244
- div.body div.seealso {
245
- border: 1px solid #dddd66;
246
- }
247
-
248
323
  div.body a {
249
324
  color: #0072aa;
250
325
  }
@@ -323,8 +398,18 @@ div.footer a:hover {
323
398
  color: #0095c4;
324
399
  }
325
400
 
401
+ /* C API return value annotations */
402
+ :root {
403
+ --refcount: var(--good-color);
404
+ --refcount-return-borrowed-ref: var(--middle-color);
405
+ }
406
+
326
407
  .refcount {
327
- color: #060;
408
+ color: var(--refcount);
409
+ }
410
+
411
+ .refcount.return_borrowed_ref {
412
+ color: var(--refcount-return-borrowed-ref)
328
413
  }
329
414
 
330
415
  .stableabi {
@@ -333,7 +418,7 @@ div.footer a:hover {
333
418
 
334
419
  dl > dt span ~ em,
335
420
  .sig {
336
- font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", Menlo, Monaco, Consolas, monospace;
421
+ font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace;
337
422
  }
338
423
 
339
424
  .toctree-wrapper ul {
@@ -622,3 +707,50 @@ div.genindex-jumpbox a {
622
707
  margin-top: -2em;
623
708
  }
624
709
  }
710
+
711
+ /* Version change directives */
712
+ :root {
713
+ --versionadded: var(--good-color);
714
+ --versionchanged: var(--middle-color);
715
+ --deprecated: var(--bad-color);
716
+
717
+ --versionadded-border: var(--good-border);
718
+ --versionchanged-border: var(--middle-border);
719
+ --deprecated-border: var(--bad-border);
720
+ }
721
+
722
+ div.versionadded,
723
+ div.versionchanged,
724
+ div.deprecated,
725
+ div.deprecated-removed {
726
+ border-left: 3px solid;
727
+ padding: 0 1rem;
728
+ }
729
+
730
+ div.versionadded {
731
+ border-left-color: var(--versionadded-border);
732
+ }
733
+
734
+ div.versionchanged {
735
+ border-left-color: var(--versionchanged-border);
736
+ }
737
+
738
+ div.deprecated,
739
+ div.deprecated-removed,
740
+ div.versionremoved {
741
+ border-left-color: var(--deprecated-border);
742
+ }
743
+
744
+ div.versionadded .versionmodified {
745
+ color: var(--versionadded);
746
+ }
747
+
748
+ div.versionchanged .versionmodified {
749
+ color: var(--versionchanged);
750
+ }
751
+
752
+ div.deprecated .versionmodified,
753
+ div.deprecated-removed .versionmodified,
754
+ div.versionremoved .versionmodified {
755
+ color: var(--deprecated);
756
+ }
@@ -1,3 +1,13 @@
1
+ /* Common colours */
2
+ :root {
3
+ --good-color: rgb(79 196 100);
4
+ --good-border: var(--good-color);
5
+ --middle-color: rgb(244, 227, 76);
6
+ --middle-border: var(--middle-color);
7
+ --bad-color: rgb(244, 76, 78);
8
+ --bad-border: var(--bad-color);
9
+ }
10
+
1
11
 
2
12
  /* Browser elements */
3
13
  :root {
@@ -79,10 +89,6 @@ table.docutils th {
79
89
  background-color: #424242;
80
90
  }
81
91
 
82
- .refcount {
83
- color: #afa;
84
- }
85
-
86
92
  .stableabi {
87
93
  color: #bbf;
88
94
  }
@@ -107,6 +113,29 @@ div.warning {
107
113
  background-color: rgba(255, 0, 0, 0.5);
108
114
  }
109
115
 
116
+ /* Admonitions */
117
+ :root {
118
+ --admonition-background: #ffffff1a;
119
+ --admonition-border: currentColor;
120
+ --admonition-color: #ffffffde;
121
+ --attention-background: #ffffff1a;
122
+ --attention-border: currentColor;
123
+ --caution-background: #ffff001a;
124
+ --caution-border: #dd6;
125
+ --danger-background: #f003;
126
+ --danger-border: #f66;
127
+ --error-background: #f003;
128
+ --error-border: #f66;
129
+ --hint-background: #0044117a;
130
+ --hint-border: green;
131
+ --seealso-background: #ffff001a;
132
+ --seealso-border: #dd6;
133
+ --tip-background: #0044117a;
134
+ --tip-border: green;
135
+ --warning-background: #ff000033;
136
+ --warning-border: #ff6666;
137
+ }
138
+
110
139
  aside.topic,
111
140
  div.topic,
112
141
  div.note,
@@ -140,3 +169,10 @@ img.invert-in-dark-mode {
140
169
  .sig.cpp .k, .sig.cpp .kt {
141
170
  color: #5283ff;
142
171
  }
172
+
173
+ /* Version change directives */
174
+ :root {
175
+ --versionadded: var(--good-color);
176
+ --versionchanged: var(--middle-color);
177
+ --deprecated: var(--bad-color);
178
+ }