python-docs-theme 2024.4__py3-none-any.whl → 2024.10__py3-none-any.whl

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.
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import hashlib
4
4
  import os
5
- from functools import lru_cache
5
+ from functools import cache
6
6
  from pathlib import Path
7
7
  from typing import Any
8
8
 
@@ -12,7 +12,7 @@ from sphinx.builders.html import StandaloneHTMLBuilder
12
12
  THEME_PATH = Path(__file__).parent.resolve()
13
13
 
14
14
 
15
- @lru_cache(maxsize=None)
15
+ @cache
16
16
  def _asset_hash(path: str) -> str:
17
17
  """Append a `?digest=` to an url based on the file content."""
18
18
  full_path = THEME_PATH / path.replace("_static/", "static/")
@@ -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(
@@ -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 {
@@ -625,13 +710,13 @@ div.genindex-jumpbox a {
625
710
 
626
711
  /* Version change directives */
627
712
  :root {
628
- --versionadded: rgb(41 100 51);
629
- --versionchanged: rgb(133 72 38);
630
- --deprecated: rgb(159 49 51);
713
+ --versionadded: var(--good-color);
714
+ --versionchanged: var(--middle-color);
715
+ --deprecated: var(--bad-color);
631
716
 
632
- --versionadded-border: rgb(79 196 100);
633
- --versionchanged-border: rgb(244, 227, 76);
634
- --deprecated-border: rgb(244, 76, 78);
717
+ --versionadded-border: var(--good-border);
718
+ --versionchanged-border: var(--middle-border);
719
+ --deprecated-border: var(--bad-border);
635
720
  }
636
721
 
637
722
  div.versionadded,
@@ -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,
@@ -143,7 +172,7 @@ img.invert-in-dark-mode {
143
172
 
144
173
  /* Version change directives */
145
174
  :root {
146
- --versionadded: rgb(79 196 100);
147
- --versionchanged: rgb(244, 227, 76);
148
- --deprecated: rgb(244, 76, 78);
175
+ --versionadded: var(--good-color);
176
+ --versionchanged: var(--middle-color);
177
+ --deprecated: var(--bad-color);
149
178
  }
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-docs-theme
3
- Version: 2024.4
3
+ Version: 2024.10
4
4
  Summary: The Sphinx theme for the CPython docs and related projects
5
5
  Author-email: PyPA <distutils-sig@python.org>
6
- Requires-Python: >=3.8
6
+ Requires-Python: >=3.9
7
7
  Description-Content-Type: text/markdown
8
8
  Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Framework :: Sphinx :: Theme
@@ -12,7 +12,6 @@ Classifier: License :: OSI Approved :: Python Software Foundation License
12
12
  Classifier: Operating System :: OS Independent
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3 :: Only
15
- Classifier: Programming Language :: Python :: 3.8
16
15
  Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
@@ -1,4 +1,4 @@
1
- python_docs_theme/__init__.py,sha256=lohzhV2LTSRLhxi0G8Emc_TkccarW1O4aYXvFGU1HR8,1814
1
+ python_docs_theme/__init__.py,sha256=y9oW_V56hYBi9-aRpCvmHNwsbkAWeTog39_y844Aau8,1806
2
2
  python_docs_theme/footerdonate.html,sha256=SVxLBvbrliqOzjau4SdhhtkRGXxX5ZrZN6Yr6luRhIQ,184
3
3
  python_docs_theme/layout.html,sha256=W5gSelJr85H5a1uaSPUDFoONpaGscpqdJkKszq5t95E,7891
4
4
  python_docs_theme/theme.conf,sha256=y8hpLRiQymGaL7AuTvXRxmhUMk6I3ehHCh5fUWbfD88,1040
@@ -6,13 +6,13 @@ python_docs_theme/static/copybutton.js,sha256=LSeNL29gDNKg3fv4rfcb8t-8xkH6HozpCb
6
6
  python_docs_theme/static/menu.js,sha256=JmrKD08_6CiCgQH32As9AgiSiV-th1fZInVrmTCihzA,2137
7
7
  python_docs_theme/static/py.png,sha256=rhc9xIQjUfwcilUa-9tYyyspVJB4ITDapPNZpqgNclY,695
8
8
  python_docs_theme/static/py.svg,sha256=WGW-i8wK-IhZSQPqARL2yNkjxXJsQIHoyFYRDMcznO8,2041
9
- python_docs_theme/static/pydoctheme.css,sha256=86sc2-vQq1GqDK6h0Jxkgv9uWO1Za547qg_kewKf66Y,13101
10
- python_docs_theme/static/pydoctheme_dark.css,sha256=hLQOuwzSg9ccMMluYPrD3Z2Mc4yBNhPpkUb02a4YdOA,2371
9
+ python_docs_theme/static/pydoctheme.css,sha256=TBPi9HIqrSmIrMdmXpmCGsdUgjQItFm6cXB_0rviccc,15305
10
+ python_docs_theme/static/pydoctheme_dark.css,sha256=NJ3l0yMhn_hH3CPJ5f_DwxxSr6j4OHHEvaxzkM9Yy2k,3252
11
11
  python_docs_theme/static/search-focus.js,sha256=DwWV71ssKvrzagPenP7yLvFQCdyqFJirbBk1PFRvVoA,559
12
12
  python_docs_theme/static/sidebar.js_t,sha256=swTyAoy6dNGm6Ro0_iRl_9ujRrIz5nq207tMIqNnYgs,3350
13
13
  python_docs_theme/static/themetoggle.js,sha256=6D1LE0wg8DjPP776_KxPCxXdIk-gGJJX5DYpHFLG1Uw,779
14
- python_docs_theme-2024.4.dist-info/entry_points.txt,sha256=VqpxCWQkYo2DkZVV2D2vA9LKmexR1Yhicqsrff4JAag,58
15
- python_docs_theme-2024.4.dist-info/LICENSE,sha256=lx_9CsorlYBu9cw97FX-A1VnHHmrwk-H-jydZBJlWmY,2460
16
- python_docs_theme-2024.4.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
17
- python_docs_theme-2024.4.dist-info/METADATA,sha256=CreIC3i0jCE1j6slzNX4eKffMvTKl3L1gqosZ6p1Hfw,2343
18
- python_docs_theme-2024.4.dist-info/RECORD,,
14
+ python_docs_theme-2024.10.dist-info/entry_points.txt,sha256=VqpxCWQkYo2DkZVV2D2vA9LKmexR1Yhicqsrff4JAag,58
15
+ python_docs_theme-2024.10.dist-info/LICENSE,sha256=lx_9CsorlYBu9cw97FX-A1VnHHmrwk-H-jydZBJlWmY,2460
16
+ python_docs_theme-2024.10.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
17
+ python_docs_theme-2024.10.dist-info/METADATA,sha256=05pxr7bO3oIe8TP2ZxxmdtIUyECVjnyhukQeGrh_k8k,2294
18
+ python_docs_theme-2024.10.dist-info/RECORD,,