mkdocs-primer 0.4.0__tar.gz → 0.4.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 (76) hide show
  1. mkdocs_primer-0.4.2/.gitignore +13 -0
  2. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/PKG-INFO +4 -3
  3. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/README.md +2 -1
  4. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/404.html +0 -1
  5. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/base.html +1 -115
  6. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/css/pygments.css +1 -36
  7. mkdocs_primer-0.4.2/mkdocs_primer/css/theme.css +1146 -0
  8. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/js/back-to-top.js +0 -5
  9. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/js/color-mode.js +0 -25
  10. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/js/copy-code.js +0 -15
  11. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/js/disclosure.js +10 -22
  12. mkdocs_primer-0.4.2/mkdocs_primer/js/header-title.js +24 -0
  13. mkdocs_primer-0.4.2/mkdocs_primer/js/nav-sections.js +44 -0
  14. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/js/scrollable.js +0 -7
  15. mkdocs_primer-0.4.2/mkdocs_primer/js/toc-active.js +45 -0
  16. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/en/LC_MESSAGES/messages.mo +0 -0
  17. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/en/LC_MESSAGES/messages.po +1 -1
  18. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/es/LC_MESSAGES/messages.mo +0 -0
  19. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/es/LC_MESSAGES/messages.po +1 -1
  20. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/fr/LC_MESSAGES/messages.mo +0 -0
  21. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/fr/LC_MESSAGES/messages.po +1 -1
  22. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/hi/LC_MESSAGES/messages.mo +0 -0
  23. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/hi/LC_MESSAGES/messages.po +1 -1
  24. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/messages.pot +1 -1
  25. mkdocs_primer-0.4.2/mkdocs_primer/locales/pt/LC_MESSAGES/messages.mo +0 -0
  26. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/pt/LC_MESSAGES/messages.po +7 -7
  27. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/ru/LC_MESSAGES/messages.mo +0 -0
  28. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/ru/LC_MESSAGES/messages.po +1 -1
  29. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/zh/LC_MESSAGES/messages.mo +0 -0
  30. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/locales/zh/LC_MESSAGES/messages.po +1 -1
  31. mkdocs_primer-0.4.2/mkdocs_primer/mkdocs_theme.yml +41 -0
  32. mkdocs_primer-0.4.2/mkdocs_primer/partials/breadcrumbs.html +19 -0
  33. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/partials/color-mode.html +0 -1
  34. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/partials/footer.html +0 -48
  35. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/partials/header.html +3 -29
  36. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/partials/language.html +0 -16
  37. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/partials/metadata.html +0 -67
  38. mkdocs_primer-0.4.2/mkdocs_primer/partials/nav-item.html +30 -0
  39. mkdocs_primer-0.4.2/mkdocs_primer/partials/nav.html +5 -0
  40. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/partials/pagination.html +0 -5
  41. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/partials/search-box.html +0 -16
  42. mkdocs_primer-0.4.2/mkdocs_primer/partials/toc-item.html +10 -0
  43. mkdocs_primer-0.4.2/mkdocs_primer/partials/toc-list.html +6 -0
  44. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/partials/toc.html +0 -55
  45. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/search.html +0 -24
  46. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer_mike/css/version-select.css +0 -4
  47. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer_mike/js/version-select.js +0 -21
  48. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/pyproject.toml +27 -6
  49. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/scripts/vendor-css.mjs +0 -44
  50. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/scripts/vendor-icons.mjs +0 -48
  51. mkdocs_primer-0.4.0/.gitignore +0 -17
  52. mkdocs_primer-0.4.0/mkdocs_primer/css/theme.css +0 -1874
  53. mkdocs_primer-0.4.0/mkdocs_primer/js/header-title.js +0 -37
  54. mkdocs_primer-0.4.0/mkdocs_primer/js/nav-sections.js +0 -68
  55. mkdocs_primer-0.4.0/mkdocs_primer/js/toc-active.js +0 -67
  56. mkdocs_primer-0.4.0/mkdocs_primer/locales/pt/LC_MESSAGES/messages.mo +0 -0
  57. mkdocs_primer-0.4.0/mkdocs_primer/mkdocs_theme.yml +0 -103
  58. mkdocs_primer-0.4.0/mkdocs_primer/partials/breadcrumbs.html +0 -33
  59. mkdocs_primer-0.4.0/mkdocs_primer/partials/nav-item.html +0 -60
  60. mkdocs_primer-0.4.0/mkdocs_primer/partials/nav.html +0 -12
  61. mkdocs_primer-0.4.0/mkdocs_primer/partials/toc-item.html +0 -17
  62. mkdocs_primer-0.4.0/mkdocs_primer/partials/toc-list.html +0 -16
  63. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/LICENSE +0 -0
  64. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/__init__.py +0 -0
  65. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/css/vendor/LICENSE +0 -0
  66. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/css/vendor/primer-core.css +0 -0
  67. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/css/vendor/primer-markdown.css +0 -0
  68. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/css/vendor/primitives-base.css +0 -0
  69. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/css/vendor/primitives-dark.css +0 -0
  70. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/css/vendor/primitives-light.css +0 -0
  71. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/css/vendor/primitives-print.css +0 -0
  72. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/img/favicon.svg +0 -0
  73. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/main.html +0 -0
  74. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer/partials/social-icons.html +0 -0
  75. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/mkdocs_primer_mike/__init__.py +0 -0
  76. {mkdocs_primer-0.4.0 → mkdocs_primer-0.4.2}/package.json +0 -0
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ build/
5
+ dist/
6
+ .venv/
7
+
8
+ node_modules/
9
+
10
+ site/
11
+
12
+ /.agents/TODO.md
13
+ /.agents/LOOP.md
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: mkdocs-primer
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: A MkDocs theme built on GitHub's Primer design system
5
5
  Project-URL: Homepage, https://github.com/olegshulyakov/mkdocs-primer
6
6
  Project-URL: Source, https://github.com/olegshulyakov/mkdocs-primer
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
20
20
  Classifier: Topic :: Documentation
21
21
  Classifier: Topic :: Software Development :: Documentation
22
22
  Requires-Python: >=3.9
23
- Requires-Dist: mkdocs>=1.6
23
+ Requires-Dist: mkdocs<2,>=1.6
24
24
  Requires-Dist: pygments>=2.16
25
25
  Description-Content-Type: text/markdown
26
26
 
@@ -61,6 +61,7 @@ theme:
61
61
  | `favicon` | `img/favicon.svg` | Site icon. |
62
62
  | `locale` | `en` | Language of the theme's own text. Catalogs ship for `en`, `es`, `fr`, `hi`, `pt`, `ru` and `zh`. |
63
63
  | `include_sidebar` | `true` | Render the navigation sidebar. |
64
+ | `nav_expand` | `all` | Navigation sections to render with their pages: `all`, or `active` to render only the section holding the current page and sections without their own page. Use `active` on large sites to cut page size and build time. |
64
65
  | `show_footer` | `true` | Render the footer bar. |
65
66
  | `show_footer_generator` | `true` | Show "Made with mkdocs-primer and MkDocs" in the footer. |
66
67
  | `social` | `[]` | Icon links shown in the footer. |
@@ -105,7 +106,7 @@ CI fails if those committed files drift from the pinned versions.
105
106
  To preview the demo site:
106
107
 
107
108
  ```console
108
- $ pip install -e . -r requirements-docs.txt
109
+ $ pip install -e . --group docs # pip 25.1+, or `uv sync`
109
110
  $ mkdocs serve --watch-theme
110
111
  ```
111
112
 
@@ -35,6 +35,7 @@ theme:
35
35
  | `favicon` | `img/favicon.svg` | Site icon. |
36
36
  | `locale` | `en` | Language of the theme's own text. Catalogs ship for `en`, `es`, `fr`, `hi`, `pt`, `ru` and `zh`. |
37
37
  | `include_sidebar` | `true` | Render the navigation sidebar. |
38
+ | `nav_expand` | `all` | Navigation sections to render with their pages: `all`, or `active` to render only the section holding the current page and sections without their own page. Use `active` on large sites to cut page size and build time. |
38
39
  | `show_footer` | `true` | Render the footer bar. |
39
40
  | `show_footer_generator` | `true` | Show "Made with mkdocs-primer and MkDocs" in the footer. |
40
41
  | `social` | `[]` | Icon links shown in the footer. |
@@ -79,7 +80,7 @@ CI fails if those committed files drift from the pinned versions.
79
80
  To preview the demo site:
80
81
 
81
82
  ```console
82
- $ pip install -e . -r requirements-docs.txt
83
+ $ pip install -e . --group docs # pip 25.1+, or `uv sync`
83
84
  $ mkdocs serve --watch-theme
84
85
  ```
85
86
 
@@ -5,7 +5,6 @@
5
5
  {% block content %}
6
6
  <h1>404</h1>
7
7
  <p>{% trans %}Sorry, this page could not be found.{% endtrans %}</p>
8
- {# See partials/header.html: `nav` is not locale-safe in a static template. #}
9
8
  <p><a href="{{ base_url }}">{% trans %}Back to the home page{% endtrans %}</a></p>
10
9
  {% endblock %}
11
10
 
@@ -1,16 +1,4 @@
1
1
  <!DOCTYPE html>
2
- {#
3
- The three data-* attributes are all required: @primer/primitives scopes each
4
- theme with selectors like
5
- [data-color-mode="auto"][data-light-theme="light"]
6
- so setting data-color-mode alone leaves every variable undefined.
7
- #}
8
- {#
9
- `i18n_page_locale` is put on the page context by mkdocs-static-i18n. That
10
- plugin only rewrites `theme.locale` for the themes it ships support for, so a
11
- third-party theme that reads `theme.locale` alone labels every translated
12
- page as the default language.
13
- #}
14
2
  <html lang="{{ i18n_page_locale | default(config.theme.locale, true) }}"
15
3
  dir="{{ config.theme.direction }}"
16
4
  data-color-mode="{{ config.theme.color_mode }}"
@@ -34,7 +22,6 @@
34
22
  {%- if page and page.canonical_url %}
35
23
  <link rel="canonical" href="{{ page.canonical_url }}">
36
24
  {%- endif %}
37
- {# Social crawlers generally do not infer a page title or description. #}
38
25
  <meta property="og:type" content="website">
39
26
  <meta property="og:site_name" content="{{ config.site_name }}">
40
27
  <meta property="og:title" content="{{ page_title }}">
@@ -54,11 +41,6 @@
54
41
  {%- if config.theme.favicon %}
55
42
  <link rel="icon" href="{{ config.theme.favicon | url }}">
56
43
  {%- endif %}
57
- {#
58
- mkdocs-rss-plugin writes the feeds but leaves discovery to the theme,
59
- so without these a reader has no way to find them. The filenames are a
60
- plugin option, hence reading them back off the plugin config.
61
- #}
62
44
  {%- set rss_plugin = config.plugins.get('rss') %}
63
45
  {%- if rss_plugin %}
64
46
  <link rel="alternate" type="application/rss+xml"
@@ -70,13 +52,6 @@
70
52
  {%- endif %}
71
53
  {%- endblock %}
72
54
 
73
- {#
74
- `page.is_homepage` is true of one page on the site: the one at the root.
75
- A translated site has a home page per language, and mkdocs-static-i18n
76
- puts every one but the default's under /<locale>/ — so without the second
77
- test those read "<site name> - <site name>" in a tab, a bookmark and a
78
- search result, a home page being normally titled after the site it opens.
79
- #}
80
55
  <title>{% block htmltitle %}
81
56
  {%- set locale_home = i18n_page_locale is defined and page and page.url in [i18n_page_locale ~ '/', i18n_page_locale ~ '/index.html'] %}
82
57
  {%- if page and page.title and not page.is_homepage and not locale_home %}{{ page.title }} - {% endif %}
@@ -84,20 +59,12 @@
84
59
  {%- endblock %}</title>
85
60
 
86
61
  {%- block styles %}
87
- {# Size/spacing/typography tokens first: Primer consumes them without fallbacks. #}
88
62
  {%- if config.theme.font and config.theme.font.source %}
89
63
  <link rel="stylesheet" href="{{ config.theme.font.source | url }}">
90
64
  {%- endif %}
91
65
  <link rel="stylesheet" href="{{ 'css/vendor/primitives-base.css' | url }}">
92
66
  <link rel="stylesheet" href="{{ 'css/vendor/primitives-light.css' | url }}">
93
67
  <link rel="stylesheet" href="{{ 'css/vendor/primitives-dark.css' | url }}">
94
- {#
95
- Paper is white whichever mode the page was being read in, and the mode
96
- is an attribute on <html> that the print stylesheet inherits along with
97
- every dark token it selects. This hands back the light value of each
98
- token the two themes disagree on. The file scopes itself to `print`;
99
- the attribute here only tells the browser it can wait for it.
100
- #}
101
68
  <link rel="stylesheet" media="print" href="{{ 'css/vendor/primitives-print.css' | url }}">
102
69
  <link rel="stylesheet" href="{{ 'css/vendor/primer-core.css' | url }}">
103
70
  <link rel="stylesheet" href="{{ 'css/vendor/primer-markdown.css' | url }}">
@@ -122,10 +89,6 @@
122
89
  {%- endfor %}
123
90
  {%- endblock %}
124
91
 
125
- {#
126
- Applies the stored color mode before first paint. Must stay inline and
127
- blocking, otherwise a dark-mode visitor gets a flash of the light theme.
128
- #}
129
92
  <script>
130
93
  (function () {
131
94
  // Marks the document as scriptable before anything is painted, so the
@@ -151,42 +114,22 @@
151
114
  {% include "partials/header.html" %}
152
115
  {%- endblock %}
153
116
 
154
- {#
155
- Suppressed in a static template on a translated site: `nav` there is the
156
- last locale mkdocs-static-i18n built, so every link would point out of the
157
- locale the visitor is actually in. See partials/header.html.
158
- #}
159
117
  {%- set show_sidebar = config.theme.include_sidebar and nav and (page or not config.plugins.get('i18n')) %}
160
118
  <div class="primer-layout{{ ' primer-layout-with-sidebar' if show_sidebar }}">
161
119
  {%- block site_nav %}
162
120
  {%- if show_sidebar %}
163
- {#
164
- A plain box: the column holds the navigation and nothing else, and
165
- the name now sits on the <nav> inside it. As an <aside> it was a
166
- complementary landmark wrapping a navigation landmark, and a screen
167
- reader announced the same name twice on the way in.
168
- #}
169
- <div class="primer-sidebar">
121
+ <div class="primer-sidebar" id="primer-sidebar">
170
122
  {% include "partials/nav.html" %}
171
123
  </div>
172
124
  {%- endif %}
173
125
  {%- endblock %}
174
126
 
175
127
  <div class="primer-content">
176
- {#
177
- Above the columns rather than beside them, so the trail starts where
178
- the page title does and shares the reading column's width.
179
- #}
180
128
  {%- block breadcrumbs %}
181
129
  {% include "partials/breadcrumbs.html" %}
182
130
  {%- endblock %}
183
131
 
184
132
  <div class="primer-columns">
185
- {#
186
- tabindex="-1" is what makes the skip link work: without it the browser
187
- scrolls but leaves focus at the top of the document, so the next Tab
188
- goes straight back into the header the visitor just skipped.
189
- #}
190
133
  <main class="primer-main" id="primer-content" tabindex="-1">
191
134
  <article class="markdown-body">
192
135
  {%- block content %}
@@ -194,17 +137,6 @@
194
137
  {%- endblock %}
195
138
  </article>
196
139
 
197
- {#
198
- Page facts belong to the reading column, under the title they
199
- describe. The title comes from the Markdown, inside page.content,
200
- where a template cannot reach -- so this is rendered after the
201
- article and its own script lifts it into place while the parser is
202
- still running. After the article rather than before it for the same
203
- reason the outline is: the title has to exist by the time that
204
- script runs. A reader with no scripts gets the facts here instead,
205
- below the prose and above the pagination, which reads as the page
206
- footnote it then is.
207
- #}
208
140
  {%- block metadata %}
209
141
  {% include "partials/metadata.html" %}
210
142
  {%- endblock %}
@@ -214,18 +146,6 @@
214
146
  {%- endblock %}
215
147
  </main>
216
148
 
217
- {#
218
- A sibling of the article, not a child of it: on a wide window the
219
- stylesheet lifts it into the third column, and where there is no room
220
- for one it stays here, beside the prose in source order and above it
221
- on screen. See partials/toc.html.
222
-
223
- After the article rather than before it, so that the script inside
224
- partials/toc.html can put the outline where it belongs while the
225
- parser is still working -- the page title it goes under has to exist
226
- by then, and nothing has been painted yet. `order` in the stylesheet
227
- is what keeps it above the prose for a reader whose scripts never run.
228
- #}
229
149
  <div class="primer-rail">
230
150
  {%- block toc %}
231
151
  {% include "partials/toc.html" %}
@@ -235,11 +155,6 @@
235
155
  </div>
236
156
  </div>
237
157
 
238
- {#
239
- Outside .primer-layout, so the bar runs the full width of the window under
240
- navigation, article and outline alike -- it belongs to the site, not to
241
- the reading column. Same placement .primer-header has at the other end.
242
- #}
243
158
  {%- block footer %}
244
159
  {%- if config.theme.show_footer %}
245
160
  {% include "partials/footer.html" %}
@@ -261,43 +176,15 @@
261
176
  </button>
262
177
 
263
178
  {%- block scripts %}
264
- {#
265
- Unconditional: the search plugin is not the only consumer. Anything
266
- added through `extra_javascript` reads it too — mike's version selector
267
- is one — and those scripts have no way to know whether search happens to
268
- be enabled.
269
- #}
270
179
  <script>var base_url = {{ base_url | tojson }}</script>
271
- {#
272
- Strings for the controls the scripts build at runtime. A .js file is
273
- served as-is and never passes through Jinja, so it cannot reach the
274
- translation catalog itself.
275
180
 
276
- `theme.icon` is here for the same reason: the copy button is built by a
277
- script, and every other control in the theme picks its icon set in a
278
- template. The set's glyphs stay in the .js file, where they are fetched
279
- once, rather than being inlined into every page that has a code block.
280
- #}
281
181
  <script>
282
182
  var primer_strings = {
283
183
  copy: {{ gettext('Copy code') | tojson }},
284
184
  copied: {{ gettext('Code copied') | tojson }},
285
185
  copied_announcement: {{ gettext('Code copied to clipboard') | tojson }},
286
186
  copy_failed: {{ gettext('Could not copy code to clipboard') | tojson }},
287
- {#
288
- mike's version selector, which is not part of this package but
289
- reaches the page through the same header. It shows a version number
290
- and carries no visible label, so this string is the only name it
291
- has. See mkdocs_primer_mike/js/version-select.js.
292
- #}
293
187
  version_select: {{ gettext('Select documentation version') | tojson }},
294
- {#
295
- The colour-mode control cycles three modes through one button, and
296
- the mode it is showing has to reach its accessible name. Named in
297
- the script rather than here: the mode this template knows is the one
298
- the site configured, which the inline script in <head> may already
299
- have replaced with the visitor's stored choice.
300
- #}
301
188
  color_mode_label: {{ gettext('Change color mode (%(mode)s)') | tojson }},
302
189
  color_mode_auto: {{ gettext('Automatic') | tojson }},
303
190
  color_mode_light: {{ gettext('Light') | tojson }},
@@ -312,7 +199,6 @@
312
199
  <script src="{{ 'js/nav-sections.js' | url }}" defer></script>
313
200
  <script src="{{ 'js/toc-active.js' | url }}" defer></script>
314
201
  <script src="{{ 'js/header-title.js' | url }}" defer></script>
315
- {# Unconditional: the language and navigation popovers exist with or without search. #}
316
202
  <script src="{{ 'js/disclosure.js' | url }}" defer></script>
317
203
  {%- if config.theme.offline %}
318
204
  <script>
@@ -1,16 +1,4 @@
1
- /*
2
- * Pygments tokens mapped onto Primer's --color-prettylights-syntax-* variables.
3
- *
4
- * Those variables are defined in both the light and dark primitives, so this
5
- * single file gives GitHub's exact syntax colors in either color mode — there
6
- * is no separate dark stylesheet to keep in sync.
7
- *
8
- * Both wrappers are covered because which one appears depends on the user's
9
- * markdown_extensions: `.highlight` (pymdownx.highlight, fenced_code) and
10
- * `.codehilite` (codehilite).
11
- */
12
-
13
- /* Primer styles `.markdown-body .highlight pre` already; match it for codehilite. */
1
+
14
2
  .markdown-body .codehilite {
15
3
  margin-bottom: var(--base-size-16);
16
4
  }
@@ -27,39 +15,32 @@
27
15
  border-radius: 6px;
28
16
  }
29
17
 
30
- /* Highlighted line (pymdownx `hl_lines`). */
31
18
  :is(.highlight, .codehilite) .hll {
32
19
  background-color: var(--bgColor-attention-muted);
33
20
  }
34
21
 
35
- /* Line numbers. */
36
22
  :is(.highlight, .codehilite) :is(.lineno, .linenos, .gl) {
37
23
  color: var(--fgColor-muted);
38
24
  user-select: none;
39
25
  }
40
26
 
41
- /* Comments. */
42
27
  :is(.highlight, .codehilite) :is(.c, .ch, .cd, .cm, .cp, .cpf, .c1, .cs, .gp) {
43
28
  color: var(--color-prettylights-syntax-comment);
44
29
  }
45
30
 
46
- /* Keywords. */
47
31
  :is(.highlight, .codehilite) :is(.k, .kd, .kp, .kr, .kt) {
48
32
  color: var(--color-prettylights-syntax-keyword);
49
33
  }
50
34
 
51
- /* Imports and other storage modifiers. */
52
35
  :is(.highlight, .codehilite) .kn {
53
36
  color: var(--color-prettylights-syntax-storage-modifier-import);
54
37
  }
55
38
 
56
- /* Constants: numbers, booleans, builtins, symbols. */
57
39
  :is(.highlight, .codehilite)
58
40
  :is(.kc, .m, .mb, .mf, .mh, .mi, .il, .mo, .nb, .bp, .no, .ni, .na, .ss, .o, .ow) {
59
41
  color: var(--color-prettylights-syntax-constant);
60
42
  }
61
43
 
62
- /* Strings. */
63
44
  :is(.highlight, .codehilite) :is(.s, .sa, .sb, .sc, .dl, .sd, .s2, .se, .sh, .si, .sx, .s1) {
64
45
  color: var(--color-prettylights-syntax-string);
65
46
  }
@@ -68,28 +49,23 @@
68
49
  color: var(--color-prettylights-syntax-string-regexp);
69
50
  }
70
51
 
71
- /* Entities: function, class, decorator and exception names. */
72
52
  :is(.highlight, .codehilite) :is(.nf, .fm, .nc, .nd, .ne) {
73
53
  color: var(--color-prettylights-syntax-entity);
74
54
  }
75
55
 
76
- /* Markup tags (HTML/XML). */
77
56
  :is(.highlight, .codehilite) .nt {
78
57
  color: var(--color-prettylights-syntax-entity-tag);
79
58
  }
80
59
 
81
- /* Variables and namespaces. */
82
60
  :is(.highlight, .codehilite) :is(.nv, .vc, .vg, .vi, .vm, .nn, .nl) {
83
61
  color: var(--color-prettylights-syntax-variable);
84
62
  }
85
63
 
86
- /* Errors. */
87
64
  :is(.highlight, .codehilite) :is(.err, .gr) {
88
65
  color: var(--color-prettylights-syntax-invalid-illegal-text);
89
66
  background-color: var(--color-prettylights-syntax-invalid-illegal-bg);
90
67
  }
91
68
 
92
- /* Diff output. */
93
69
  :is(.highlight, .codehilite) .gd {
94
70
  color: var(--color-prettylights-syntax-markup-deleted-text);
95
71
  background-color: var(--color-prettylights-syntax-markup-deleted-bg);
@@ -105,20 +81,10 @@
105
81
  font-weight: var(--base-text-weight-semibold, 600);
106
82
  }
107
83
 
108
- /*
109
- * The one place this file departs from GitHub's palette. In dark mode
110
- * --color-prettylights-syntax-markup-heading is #1f6feb, which against the
111
- * code background is 3.74:1 — under the 4.5:1 WCAG AA needs at this size.
112
- * --fgColor-accent is the same hue two steps lighter and reaches 5.7:1.
113
- * A diff hunk header (`@@ -1,3 +1,3 @@`) is the common case, and it carries
114
- * the line numbers, so it has to be readable.
115
- */
116
84
  [data-color-mode='dark'] :is(.highlight, .codehilite) :is(.gh, .gu) {
117
85
  color: var(--fgColor-accent);
118
86
  }
119
87
 
120
- /* Same rule for `auto`, but only once the system has resolved to dark: in
121
- light the vendored token is already 7.4:1 and stays GitHub-exact. */
122
88
  @media (prefers-color-scheme: dark) {
123
89
  [data-color-mode='auto'] :is(.highlight, .codehilite) :is(.gh, .gu) {
124
90
  color: var(--fgColor-accent);
@@ -129,7 +95,6 @@
129
95
  color: var(--color-prettylights-syntax-meta-diff-range);
130
96
  }
131
97
 
132
- /* Emphasis in markup lexers. */
133
98
  :is(.highlight, .codehilite) .ge {
134
99
  color: var(--color-prettylights-syntax-markup-italic);
135
100
  font-style: italic;