@threepenny/md2pdf 2.2.3 → 2.3.0

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 (44) hide show
  1. package/README.md +10 -6
  2. package/bin/md2pdf.js +4 -0
  3. package/lib/styles.js +4 -0
  4. package/package.json +1 -1
  5. package/styles/cyberpunk.css +694 -0
  6. package/styles/elvish.css +643 -0
  7. package/styles/fonts/chakra-petch/OFL.txt +93 -0
  8. package/styles/fonts/chakra-petch/chakra-petch-latin-400-italic.woff2 +0 -0
  9. package/styles/fonts/chakra-petch/chakra-petch-latin-400-normal.woff2 +0 -0
  10. package/styles/fonts/chakra-petch/chakra-petch-latin-700-italic.woff2 +0 -0
  11. package/styles/fonts/chakra-petch/chakra-petch-latin-700-normal.woff2 +0 -0
  12. package/styles/fonts/cormorant-garamond/OFL.txt +93 -0
  13. package/styles/fonts/cormorant-garamond/cormorant-garamond-latin-500-italic.woff2 +0 -0
  14. package/styles/fonts/cormorant-garamond/cormorant-garamond-latin-500-normal.woff2 +0 -0
  15. package/styles/fonts/cormorant-garamond/cormorant-garamond-latin-700-italic.woff2 +0 -0
  16. package/styles/fonts/cormorant-garamond/cormorant-garamond-latin-700-normal.woff2 +0 -0
  17. package/styles/fonts/cormorant-unicase/OFL.txt +93 -0
  18. package/styles/fonts/cormorant-unicase/cormorant-unicase-latin-600-normal.woff2 +0 -0
  19. package/styles/fonts/grenze-gotisch/OFL.txt +93 -0
  20. package/styles/fonts/grenze-gotisch/grenze-gotisch-latin-600-normal.woff2 +0 -0
  21. package/styles/fonts/im-fell-english/OFL.txt +93 -0
  22. package/styles/fonts/im-fell-english/im-fell-english-latin-400-italic.woff2 +0 -0
  23. package/styles/fonts/im-fell-english/im-fell-english-latin-400-normal.woff2 +0 -0
  24. package/styles/fonts/jetbrains-mono/OFL.txt +93 -0
  25. package/styles/fonts/jetbrains-mono/jetbrains-mono-latin-400-italic.woff2 +0 -0
  26. package/styles/fonts/jetbrains-mono/jetbrains-mono-latin-400-normal.woff2 +0 -0
  27. package/styles/fonts/jetbrains-mono/jetbrains-mono-latin-700-normal.woff2 +0 -0
  28. package/styles/fonts/michroma/OFL.txt +93 -0
  29. package/styles/fonts/michroma/michroma-latin-400-normal.woff2 +0 -0
  30. package/styles/fonts/space-mono/OFL.txt +93 -0
  31. package/styles/fonts/space-mono/space-mono-latin-400-italic.woff2 +0 -0
  32. package/styles/fonts/space-mono/space-mono-latin-400-normal.woff2 +0 -0
  33. package/styles/fonts/space-mono/space-mono-latin-700-normal.woff2 +0 -0
  34. package/styles/fonts/spectral/OFL.txt +93 -0
  35. package/styles/fonts/spectral/spectral-latin-400-italic.woff2 +0 -0
  36. package/styles/fonts/spectral/spectral-latin-400-normal.woff2 +0 -0
  37. package/styles/fonts/spectral/spectral-latin-600-italic.woff2 +0 -0
  38. package/styles/fonts/spectral/spectral-latin-600-normal.woff2 +0 -0
  39. package/styles/gothic.css +474 -0
  40. package/styles/print/cyberpunk.css +92 -0
  41. package/styles/print/elvish.css +69 -0
  42. package/styles/print/gothic.css +29 -0
  43. package/styles/print/sandwake.css +47 -0
  44. package/styles/sandwake.css +540 -0
@@ -0,0 +1,694 @@
1
+ /* Cyberpunk: a job file that leaked off somebody's terminal. Squared Chakra Petch text and JetBrains
2
+ Mono labels (both bundled), teal and hot magenta on white paper, a title panel on a faint grid
3
+ with corner brackets, numbered sections ("01 //"), intercept boxes for quotes and terminal panels
4
+ for code. */
5
+
6
+ /* Variables a page can override, on .markdown-body itself: for all its documents, or for one with
7
+ <article class="markdown-body" style="--md2pdf-font-size: 11pt">. A value set on :root or another
8
+ ancestor doesn't reach the document. :where() gives these defaults no specificity, so the page's
9
+ rule wins wherever it comes. Every style uses the same names. */
10
+ :where(.markdown-body) {
11
+ /* Size and spacing. --md2pdf-font-size is the body text size, an absolute length such as 12pt or
12
+ 16px; headings and smaller text scale with it. --md2pdf-leading scales each line height's
13
+ excess over 1, and --md2pdf-space the vertical gaps between blocks; both are 1 as designed. */
14
+ --md2pdf-font-size: 12pt;
15
+ --md2pdf-leading: 1;
16
+ --md2pdf-space: 1;
17
+ /* Colors: --md2pdf-background the paper and the inside of an unticked box, and mixed into callout
18
+ title bars, shaded table rows and the dashed quote and footnote borders; --md2pdf-text body
19
+ text, every # heading including the title, ##### headings, code-block text, the frame of code
20
+ blocks and the line under their label, and key outlines;
21
+ --md2pdf-muted h6, footnotes, quote callouts, code comments, the code-block label, the
22
+ placeholder for an embed it can't show, and the dashed quote and footnote borders;
23
+ --md2pdf-accent the magenta: the title's label, section numbers, h3, top-level bullets, inline
24
+ code, footnote references and numbers, and one segment of each # heading's bar and of the ---
25
+ rule; --md2pdf-rule the line under each ## heading, the frame and row lines of tables and the
26
+ border of inline code; --md2pdf-surface the title panel, table headings, shaded table rows and
27
+ the background of inline code and code blocks.
28
+ Colors of its own, which md2pdf.me's diagrams should follow: teal #007a8a for ## and ####
29
+ headings, links, nested bullets, list numerals, tick boxes, table headings and the line under
30
+ them, the title's brackets, the rest of each heading bar and --- rule, the quote label, note
31
+ callouts and function names in code; #d6e7ec for the title's grid; #0a4f59 for quote text;
32
+ callouts in #1e7a45 (tip),
33
+ #6a3fd0 (important), #8a6100 on a #ffd23e bar (warning) and #c21f3a (caution); code reuses
34
+ the tip, important and warning colours, with #c40f62 for keywords and #b8500a for meta and
35
+ deletions; #d8ff3e behind highlighted text; and
36
+ the title's offset in #ff2e88 and #22e3f2. */
37
+ --md2pdf-background: #fff;
38
+ --md2pdf-text: #10151c;
39
+ --md2pdf-muted: #5a6878;
40
+ --md2pdf-accent: #d4106a;
41
+ --md2pdf-rule: #c4cfda;
42
+ --md2pdf-surface: #f3f6f9;
43
+ /* Fonts: --md2pdf-font body text; --md2pdf-heading-font the title and #, ##, #### and #####
44
+ headings; --md2pdf-code-font code, keys, h3, h6, footnotes and every small label: the title's,
45
+ the quote's and the code block's labels, section numbers, list numerals, table headings,
46
+ callout titles and footnote references. */
47
+ --md2pdf-font: "md2pdf Chakra Petch", "Avenir Next", "Segoe UI", sans-serif;
48
+ --md2pdf-heading-font: "md2pdf Chakra Petch", "Avenir Next", "Segoe UI", sans-serif;
49
+ --md2pdf-code-font: "md2pdf JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
50
+ }
51
+
52
+ /* Chakra Petch (Cadson Demak) and JetBrains Mono (JetBrains), both under the SIL Open Font License;
53
+ the licences are in fonts/chakra-petch/OFL.txt and fonts/jetbrains-mono/OFL.txt. Their latin
54
+ subsets cover English and Western European languages (Basic Latin and Latin-1, plus œ and €);
55
+ other letters come from the fallbacks. */
56
+ @font-face {
57
+ font-family: "md2pdf Chakra Petch";
58
+ font-weight: 400;
59
+ font-style: normal;
60
+ src: url("fonts/chakra-petch/chakra-petch-latin-400-normal.woff2") format("woff2");
61
+ }
62
+ @font-face {
63
+ font-family: "md2pdf Chakra Petch";
64
+ font-weight: 400;
65
+ font-style: italic;
66
+ src: url("fonts/chakra-petch/chakra-petch-latin-400-italic.woff2") format("woff2");
67
+ }
68
+ @font-face {
69
+ font-family: "md2pdf Chakra Petch";
70
+ font-weight: 700;
71
+ font-style: normal;
72
+ src: url("fonts/chakra-petch/chakra-petch-latin-700-normal.woff2") format("woff2");
73
+ }
74
+ @font-face {
75
+ font-family: "md2pdf Chakra Petch";
76
+ font-weight: 700;
77
+ font-style: italic;
78
+ src: url("fonts/chakra-petch/chakra-petch-latin-700-italic.woff2") format("woff2");
79
+ }
80
+ @font-face {
81
+ font-family: "md2pdf JetBrains Mono";
82
+ font-weight: 400;
83
+ font-style: normal;
84
+ src: url("fonts/jetbrains-mono/jetbrains-mono-latin-400-normal.woff2") format("woff2");
85
+ }
86
+ @font-face {
87
+ font-family: "md2pdf JetBrains Mono";
88
+ font-weight: 400;
89
+ font-style: italic;
90
+ src: url("fonts/jetbrains-mono/jetbrains-mono-latin-400-italic.woff2") format("woff2");
91
+ }
92
+ @font-face {
93
+ font-family: "md2pdf JetBrains Mono";
94
+ font-weight: 700;
95
+ font-style: normal;
96
+ src: url("fonts/jetbrains-mono/jetbrains-mono-latin-700-normal.woff2") format("woff2");
97
+ }
98
+
99
+ .markdown-body {
100
+ font-family: var(--md2pdf-font);
101
+ background: var(--md2pdf-background);
102
+ font-size: var(--md2pdf-font-size);
103
+ line-height: calc(1 + 0.6 * var(--md2pdf-leading));
104
+ color: var(--md2pdf-text);
105
+ counter-reset: md2pdf-section;
106
+ /* A long web address wraps at the margin instead of making Chrome shrink the page to fit it. */
107
+ overflow-wrap: break-word;
108
+ -webkit-print-color-adjust: exact;
109
+ print-color-adjust: exact;
110
+ }
111
+
112
+ .markdown-body p {
113
+ margin: 0 0 calc(0.8em * var(--md2pdf-space));
114
+ text-wrap: pretty;
115
+ orphans: 3;
116
+ widows: 3;
117
+ }
118
+
119
+ /* Headings */
120
+
121
+ .markdown-body h1,
122
+ .markdown-body h2,
123
+ .markdown-body h3,
124
+ .markdown-body h4,
125
+ .markdown-body h5,
126
+ .markdown-body h6 {
127
+ font-family: var(--md2pdf-heading-font);
128
+ font-weight: 700;
129
+ line-height: calc(1 + 0.3 * var(--md2pdf-leading));
130
+ break-after: avoid;
131
+ }
132
+
133
+ /* A later # heading: capitals over a segmented bar, teal with one magenta segment. */
134
+ .markdown-body h1 {
135
+ font-size: calc(21 / 12 * var(--md2pdf-font-size));
136
+ line-height: calc(1 + 0.15 * var(--md2pdf-leading));
137
+ letter-spacing: 0.02em;
138
+ text-transform: uppercase;
139
+ text-wrap: balance;
140
+ margin: calc(1.6em * var(--md2pdf-space)) 0 calc(0.8em * var(--md2pdf-space));
141
+ /* The bar and the title's label are blocks inside the heading; without this a page can break between them. */
142
+ break-inside: avoid;
143
+ }
144
+ .markdown-body h1::after {
145
+ content: "";
146
+ display: block;
147
+ width: 212px;
148
+ max-width: 100%;
149
+ height: 4px;
150
+ margin-top: calc(0.35em * var(--md2pdf-space));
151
+ /* Each segment is a solid layer of its own: Safari prints a gradient's transparent stops black. */
152
+ background:
153
+ linear-gradient(#007a8a, #007a8a) 0 0 / 140px 100% no-repeat,
154
+ linear-gradient(var(--md2pdf-accent), var(--md2pdf-accent)) 146px 0 / 28px 100% no-repeat,
155
+ linear-gradient(#007a8a, #007a8a) 180px 0 / 8px 100% no-repeat,
156
+ linear-gradient(#007a8a, #007a8a) 194px 0 / 8px 100% no-repeat,
157
+ linear-gradient(#007a8a, #007a8a) 208px 0 / 4px 100% no-repeat;
158
+ }
159
+
160
+ /* The title: the first heading, on a panel with a faint grid and a bracket at each corner, under an
161
+ "incoming transmission" label. Its letters carry a cyan and magenta offset, like a misregistered
162
+ screen. */
163
+ .markdown-body > h1:first-child {
164
+ font-size: calc(30 / 12 * var(--md2pdf-font-size));
165
+ margin: 0 0 calc(0.7em * var(--md2pdf-space));
166
+ padding: 0.7em 0.7em 0.65em;
167
+ text-shadow: 2px 0 #ff2e88, -2px 0 #22e3f2;
168
+ background:
169
+ linear-gradient(#007a8a, #007a8a) top left / 18px 2px no-repeat,
170
+ linear-gradient(#007a8a, #007a8a) top left / 2px 18px no-repeat,
171
+ linear-gradient(#007a8a, #007a8a) top right / 18px 2px no-repeat,
172
+ linear-gradient(#007a8a, #007a8a) top right / 2px 18px no-repeat,
173
+ linear-gradient(#007a8a, #007a8a) bottom left / 18px 2px no-repeat,
174
+ linear-gradient(#007a8a, #007a8a) bottom left / 2px 18px no-repeat,
175
+ linear-gradient(#007a8a, #007a8a) bottom right / 18px 2px no-repeat,
176
+ linear-gradient(#007a8a, #007a8a) bottom right / 2px 18px no-repeat,
177
+ /* The grid is an SVG tile in a solid colour: Safari drops a gradient grid's horizontal lines. */
178
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M0 .5H24M.5 0V24' fill='none' stroke='%23d6e7ec'/%3E%3C/svg%3E") 0 0 / 24px 24px,
179
+ var(--md2pdf-surface);
180
+ }
181
+ .markdown-body > h1:first-child::before {
182
+ font-variant-ligatures: none;
183
+ content: "// Incoming transmission";
184
+ display: block;
185
+ margin-bottom: calc(0.3em * var(--md2pdf-space));
186
+ font-family: var(--md2pdf-code-font);
187
+ font-size: 0.3em;
188
+ line-height: calc(1 + 0.4 * var(--md2pdf-leading));
189
+ letter-spacing: 0.16em;
190
+ color: var(--md2pdf-accent);
191
+ text-shadow: none;
192
+ }
193
+
194
+ /* Sections: teal capitals after the section's number, over a hairline. */
195
+ .markdown-body h2 {
196
+ font-size: calc(15 / 12 * var(--md2pdf-font-size));
197
+ letter-spacing: 0.06em;
198
+ text-transform: uppercase;
199
+ color: #007a8a;
200
+ margin: calc(1.8em * var(--md2pdf-space)) 0 calc(0.8em * var(--md2pdf-space));
201
+ padding-bottom: 0.4em;
202
+ border-bottom: 0.75pt solid var(--md2pdf-rule);
203
+ }
204
+ /* Only top-level sections are numbered: a ## inside a quote or callout is not one. */
205
+ .markdown-body > h2 {
206
+ counter-increment: md2pdf-section;
207
+ }
208
+ .markdown-body > h2::before {
209
+ font-variant-ligatures: none;
210
+ content: counter(md2pdf-section, decimal-leading-zero) " //";
211
+ margin-right: 0.9em;
212
+ font-family: var(--md2pdf-code-font);
213
+ font-size: 0.65em;
214
+ letter-spacing: 0.1em;
215
+ color: var(--md2pdf-accent);
216
+ }
217
+
218
+ /* A terminal prompt. */
219
+ .markdown-body h3 {
220
+ font-variant-ligatures: none;
221
+ font-family: var(--md2pdf-code-font);
222
+ font-size: calc(9.75 / 12 * var(--md2pdf-font-size));
223
+ line-height: calc(1 + 0.5 * var(--md2pdf-leading));
224
+ letter-spacing: 0.16em;
225
+ text-transform: uppercase;
226
+ color: var(--md2pdf-accent);
227
+ margin: calc(2em * var(--md2pdf-space)) 0 calc(0.75em * var(--md2pdf-space));
228
+ }
229
+ .markdown-body h3::before {
230
+ content: "> ";
231
+ }
232
+ .markdown-body h4 {
233
+ font-size: calc(10.5 / 12 * var(--md2pdf-font-size));
234
+ letter-spacing: 0.08em;
235
+ text-transform: uppercase;
236
+ color: #007a8a;
237
+ margin: calc(1.6em * var(--md2pdf-space)) 0 calc(0.5em * var(--md2pdf-space));
238
+ }
239
+ .markdown-body h5,
240
+ .markdown-body h6 {
241
+ font-size: var(--md2pdf-font-size);
242
+ margin: calc(1.2em * var(--md2pdf-space)) 0 calc(0.3em * var(--md2pdf-space));
243
+ }
244
+ .markdown-body h6 {
245
+ font-family: var(--md2pdf-code-font);
246
+ font-size: calc(10 / 12 * var(--md2pdf-font-size));
247
+ font-weight: 400;
248
+ font-variant-ligatures: none;
249
+ color: var(--md2pdf-muted);
250
+ }
251
+
252
+ /* Links */
253
+
254
+ .markdown-body a {
255
+ color: #007a8a;
256
+ text-decoration: underline dotted;
257
+ text-decoration-thickness: 1px;
258
+ text-underline-offset: 3px;
259
+ }
260
+ .markdown-body a.header-anchor {
261
+ display: none;
262
+ }
263
+ /* A footnote number doesn't push its line apart. */
264
+ .markdown-body sup {
265
+ line-height: 0;
266
+ }
267
+ .markdown-body .footnote-ref a {
268
+ font-family: var(--md2pdf-code-font);
269
+ font-size: 0.85em;
270
+ font-weight: 700;
271
+ color: var(--md2pdf-accent);
272
+ text-decoration: none;
273
+ }
274
+
275
+ /* Lists: magenta chevrons, teal when nested, and boxed two-digit numerals. */
276
+
277
+ .markdown-body ul,
278
+ .markdown-body ol {
279
+ margin: 0 0 calc(0.8em * var(--md2pdf-space));
280
+ padding-left: 1.3em;
281
+ list-style-type: none;
282
+ }
283
+ .markdown-body ol {
284
+ padding-left: 2.6em;
285
+ }
286
+ .markdown-body li {
287
+ position: relative;
288
+ margin: calc(0.3em * var(--md2pdf-space)) 0;
289
+ }
290
+ .markdown-body li > ul,
291
+ .markdown-body li > ol {
292
+ margin: calc(0.3em * var(--md2pdf-space)) 0 0;
293
+ }
294
+ .markdown-body ul > li:not(.task-list-item)::before {
295
+ content: "";
296
+ position: absolute;
297
+ top: 0.55em;
298
+ left: -1.25em;
299
+ box-sizing: border-box;
300
+ width: 0.5em;
301
+ height: 0.5em;
302
+ border-top: 2px solid var(--md2pdf-accent);
303
+ border-right: 2px solid var(--md2pdf-accent);
304
+ transform: rotate(45deg);
305
+ }
306
+ .markdown-body li ul > li:not(.task-list-item)::before {
307
+ border-color: #007a8a;
308
+ }
309
+ /* The numeral is the list's own counter, so a list that starts at another number still counts right. */
310
+ .markdown-body ol > li:not(.task-list-item)::before {
311
+ content: counter(list-item, decimal-leading-zero);
312
+ position: absolute;
313
+ top: 0.22em;
314
+ right: 100%;
315
+ margin-right: 0.9em;
316
+ padding: 0 0.4em;
317
+ border: 1px solid #007a8a;
318
+ font-family: var(--md2pdf-code-font);
319
+ font-size: 0.75em;
320
+ font-weight: 700;
321
+ line-height: calc(1 + 0.5 * var(--md2pdf-leading));
322
+ color: #007a8a;
323
+ }
324
+ /* Square boxes drawn here at the text's size: the browser's own are greyed out, as they're disabled. */
325
+ .markdown-body .task-list-item input {
326
+ appearance: none;
327
+ font-size: inherit;
328
+ width: 0.85em;
329
+ height: 0.85em;
330
+ margin: 0 0.5em 0.15em -1.3em;
331
+ vertical-align: middle;
332
+ border: 2px solid #007a8a;
333
+ border-radius: 0;
334
+ background: var(--md2pdf-background);
335
+ }
336
+ .markdown-body .task-list-item input:checked {
337
+ background: #007a8a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.2l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.4'/%3E%3C/svg%3E") center / 100% no-repeat;
338
+ }
339
+
340
+ /* Emphasis */
341
+
342
+ .markdown-body strong {
343
+ font-weight: 700;
344
+ }
345
+ .markdown-body mark {
346
+ padding: 0 0.15em;
347
+ background: #d8ff3e;
348
+ color: inherit;
349
+ }
350
+
351
+ /* Quotes: an intercepted message in a dashed box, labelled at its top. */
352
+
353
+ .markdown-body blockquote {
354
+ margin: calc(1.3em * var(--md2pdf-space)) 0;
355
+ padding: 0.7em 1.25em 0.9em;
356
+ border: 1px dashed color-mix(in srgb, var(--md2pdf-muted) 75%, var(--md2pdf-background));
357
+ color: #0a4f59;
358
+ break-inside: avoid;
359
+ }
360
+ .markdown-body blockquote::before {
361
+ font-variant-ligatures: none;
362
+ content: "// Intercept";
363
+ display: block;
364
+ margin-bottom: calc(0.6em * var(--md2pdf-space));
365
+ font-family: var(--md2pdf-code-font);
366
+ font-size: 0.75em;
367
+ font-weight: 700;
368
+ line-height: calc(1 + 0.5 * var(--md2pdf-leading));
369
+ letter-spacing: 0.16em;
370
+ text-transform: uppercase;
371
+ color: #007a8a;
372
+ }
373
+ .markdown-body blockquote blockquote::before {
374
+ content: none;
375
+ }
376
+ .markdown-body blockquote > :last-child {
377
+ margin-bottom: 0;
378
+ }
379
+ /* A heading, or anything else, at the top of a quote or callout: the container already gives it
380
+ room. */
381
+ .markdown-body blockquote > :first-child,
382
+ .markdown-body .markdown-alert > .markdown-alert-title + * {
383
+ margin-top: 0;
384
+ }
385
+
386
+
387
+ /* Callouts (GitHub alerts and Obsidian callouts): a system alert, with a label bar tinted in the
388
+ callout's color over an outlined box. */
389
+
390
+ .markdown-body .markdown-alert {
391
+ --md2pdf-callout: #007a8a;
392
+ margin: calc(1.4em * var(--md2pdf-space)) 0;
393
+ padding: 0 14pt 11pt;
394
+ border: 1px solid var(--md2pdf-callout);
395
+ break-inside: avoid;
396
+ }
397
+ .markdown-body .markdown-alert-tip {
398
+ --md2pdf-callout: #1e7a45;
399
+ }
400
+ .markdown-body .markdown-alert-important {
401
+ --md2pdf-callout: #6a3fd0;
402
+ }
403
+ .markdown-body .markdown-alert-warning {
404
+ --md2pdf-callout: #8a6100;
405
+ }
406
+ .markdown-body .markdown-alert-caution {
407
+ --md2pdf-callout: #c21f3a;
408
+ }
409
+ .markdown-body .markdown-alert-quote {
410
+ --md2pdf-callout: var(--md2pdf-muted);
411
+ }
412
+ .markdown-body .markdown-alert-title {
413
+ font-variant-ligatures: none;
414
+ margin: 0 -14pt calc(0.9em * var(--md2pdf-space));
415
+ padding: 4pt 14pt;
416
+ border-bottom: 1px solid var(--md2pdf-callout);
417
+ background: color-mix(in srgb, var(--md2pdf-callout) 16%, var(--md2pdf-background));
418
+ color: var(--md2pdf-callout);
419
+ font-family: var(--md2pdf-code-font);
420
+ font-size: 0.75em;
421
+ font-weight: 700;
422
+ letter-spacing: 0.16em;
423
+ text-transform: uppercase;
424
+ }
425
+ .markdown-body .markdown-alert-warning .markdown-alert-title {
426
+ background: #ffd23e;
427
+ }
428
+ .markdown-body .markdown-alert-title .octicon {
429
+ margin-right: 0.8em;
430
+ vertical-align: -0.15em;
431
+ width: 1.15em;
432
+ height: 1.15em;
433
+ fill: currentColor;
434
+ }
435
+ .markdown-body .markdown-alert > :last-child {
436
+ margin-bottom: 0;
437
+ }
438
+ /* A callout that is only a title: the bar is the whole box, with no empty strip under it. */
439
+ .markdown-body .markdown-alert:has(> .markdown-alert-title:last-child) {
440
+ padding-bottom: 0;
441
+ }
442
+ .markdown-body .markdown-alert-title:last-child {
443
+ border-bottom: 0;
444
+ }
445
+
446
+ /* Code: magenta inline, and terminal panels for blocks. */
447
+
448
+ /* No ligatures in JetBrains Mono: its "//" and "->" are single glyphs, and copy from a PDF as "/" and
449
+ ">". The same goes for h3, h6, footnotes, table headings, callout titles and the labels. */
450
+ .markdown-body code,
451
+ .markdown-body kbd {
452
+ font-family: var(--md2pdf-code-font);
453
+ font-size: 0.82em;
454
+ font-variant-ligatures: none;
455
+ }
456
+ .markdown-body :not(pre) > code {
457
+ padding: 0.1em 0.4em;
458
+ border: 1px solid var(--md2pdf-rule);
459
+ background: var(--md2pdf-surface);
460
+ color: var(--md2pdf-accent);
461
+ }
462
+ /* Code inside a link: a box of its own, framed in the link's color, so the link's underline doesn't
463
+ run through it. inline-block can't shrink below its longest word, so it may break anywhere. */
464
+ .markdown-body a code {
465
+ display: inline-block;
466
+ max-width: 100%;
467
+ overflow-wrap: anywhere;
468
+ border-color: currentColor;
469
+ color: inherit;
470
+ }
471
+
472
+ .markdown-body kbd {
473
+ padding: 0.1em 0.45em;
474
+ border: 1px solid var(--md2pdf-text);
475
+ border-bottom-width: 3px;
476
+ }
477
+ .markdown-body pre {
478
+ margin: 0 0 calc(1.2em * var(--md2pdf-space));
479
+ border: 1px solid var(--md2pdf-text);
480
+ background: var(--md2pdf-surface);
481
+ line-height: calc(1 + 0.6 * var(--md2pdf-leading));
482
+ white-space: pre-wrap;
483
+ word-break: break-word;
484
+ break-inside: avoid;
485
+ }
486
+ .markdown-body pre::before {
487
+ font-variant-ligatures: none;
488
+ content: "// Terminal";
489
+ display: block;
490
+ padding: 4pt 14pt;
491
+ border-bottom: 1px solid var(--md2pdf-text);
492
+ font-family: var(--md2pdf-code-font);
493
+ font-size: calc(9 / 12 * var(--md2pdf-font-size));
494
+ letter-spacing: 0.16em;
495
+ text-transform: uppercase;
496
+ color: var(--md2pdf-muted);
497
+ }
498
+ .markdown-body pre code {
499
+ font-size: calc(9.75 / 12 * var(--md2pdf-font-size));
500
+ line-height: calc(1 + 0.85 * var(--md2pdf-leading));
501
+ }
502
+ /* A highlight.js theme on the host page styles .hljs too; keep code blocks this style's own. The
503
+ code is a block here, so the panel's padding sits under the label. */
504
+ .markdown-body pre code,
505
+ .markdown-body pre code.hljs {
506
+ display: block;
507
+ overflow: visible;
508
+ padding: 10pt 14pt 11pt;
509
+ color: inherit;
510
+ background: none;
511
+ }
512
+ /* And its tokens: this outranks a theme's token rules, and this style's colors come after it. */
513
+ .markdown-body [class*="hljs-"] {
514
+ color: inherit;
515
+ background: none;
516
+ font-style: inherit;
517
+ font-weight: inherit;
518
+ text-decoration: none;
519
+ }
520
+
521
+ .markdown-body .hljs-comment,
522
+ .markdown-body .hljs-quote {
523
+ color: var(--md2pdf-muted);
524
+ font-style: italic;
525
+ }
526
+ .markdown-body .hljs-keyword,
527
+ .markdown-body .hljs-selector-tag,
528
+ .markdown-body .hljs-literal,
529
+ .markdown-body .hljs-doctag {
530
+ color: #c40f62;
531
+ font-weight: 700;
532
+ }
533
+ .markdown-body .hljs-string,
534
+ .markdown-body .hljs-regexp,
535
+ .markdown-body .hljs-addition {
536
+ color: #1e7a45;
537
+ }
538
+ .markdown-body .hljs-number,
539
+ .markdown-body .hljs-symbol,
540
+ .markdown-body .hljs-bullet {
541
+ color: #8a6100;
542
+ }
543
+ .markdown-body .hljs-title,
544
+ .markdown-body .hljs-section,
545
+ .markdown-body .hljs-name {
546
+ color: #007a8a;
547
+ font-weight: 700;
548
+ }
549
+ .markdown-body .hljs-built_in,
550
+ .markdown-body .hljs-type,
551
+ .markdown-body .hljs-attr,
552
+ .markdown-body .hljs-attribute,
553
+ .markdown-body .hljs-variable,
554
+ .markdown-body .hljs-template-variable {
555
+ color: #6a3fd0;
556
+ }
557
+ .markdown-body .hljs-meta,
558
+ .markdown-body .hljs-deletion {
559
+ color: #b8500a;
560
+ }
561
+ .markdown-body .hljs-emphasis {
562
+ font-style: italic;
563
+ }
564
+ .markdown-body .hljs-strong {
565
+ font-weight: bold;
566
+ }
567
+
568
+ /* Math */
569
+
570
+ .markdown-body .katex-display {
571
+ margin: calc(0.9em * var(--md2pdf-space)) 0;
572
+ }
573
+
574
+ /* Tables: a data grid with small teal headings over a teal line, and every other row shaded. */
575
+
576
+ .markdown-body table {
577
+ width: 100%;
578
+ border-collapse: collapse;
579
+ margin: calc(1.2em * var(--md2pdf-space)) 0 calc(1.4em * var(--md2pdf-space));
580
+ border: 1px solid var(--md2pdf-rule);
581
+ font-size: calc(11.25 / 12 * var(--md2pdf-font-size));
582
+ line-height: calc(1 + 0.4 * var(--md2pdf-leading));
583
+ font-variant-numeric: tabular-nums;
584
+ }
585
+ .markdown-body th,
586
+ .markdown-body td {
587
+ padding: 0.5em 0.7em;
588
+ text-align: left;
589
+ vertical-align: top;
590
+ }
591
+ .markdown-body th {
592
+ font-variant-ligatures: none;
593
+ padding-top: 0.75em;
594
+ padding-bottom: 0.75em;
595
+ vertical-align: bottom;
596
+ /* Side padding in the cells' units, so headings stay over their columns. */
597
+ padding-right: calc(0.7em / 0.8);
598
+ padding-left: calc(0.7em / 0.8);
599
+ border-bottom: 1px solid #007a8a;
600
+ background: var(--md2pdf-surface);
601
+ font-family: var(--md2pdf-code-font);
602
+ font-size: 0.8em;
603
+ font-weight: 700;
604
+ letter-spacing: 0.16em;
605
+ text-transform: uppercase;
606
+ color: #007a8a;
607
+ }
608
+ .markdown-body tr:not(:last-child) > td {
609
+ border-bottom: 1px solid var(--md2pdf-rule);
610
+ }
611
+ .markdown-body tbody tr:nth-child(even) {
612
+ background: color-mix(in srgb, var(--md2pdf-surface) 55%, var(--md2pdf-background));
613
+ }
614
+ .markdown-body tr {
615
+ break-inside: avoid;
616
+ }
617
+
618
+ /* Rules, images and diagrams */
619
+
620
+ /* A teal line that breaks up into segments at its right end, one of them magenta. */
621
+ .markdown-body hr {
622
+ height: 2px;
623
+ /* Firefox otherwise splits the rule across pages. */
624
+ break-inside: avoid;
625
+ margin: calc(1.8em * var(--md2pdf-space)) 0;
626
+ border: 0;
627
+ /* Solid layers, as under the # headings. */
628
+ background:
629
+ linear-gradient(#007a8a, #007a8a) 0 0 / calc(100% - 72px) 100% no-repeat,
630
+ linear-gradient(var(--md2pdf-accent), var(--md2pdf-accent)) right 38px top 0 / 28px 100% no-repeat,
631
+ linear-gradient(#007a8a, #007a8a) right 24px top 0 / 8px 100% no-repeat,
632
+ linear-gradient(#007a8a, #007a8a) right 10px top 0 / 8px 100% no-repeat,
633
+ linear-gradient(#007a8a, #007a8a) right 0 top 0 / 4px 100% no-repeat;
634
+ }
635
+
636
+ .markdown-body img {
637
+ display: block;
638
+ max-width: 100%;
639
+ margin: calc(1.2em * var(--md2pdf-space)) auto;
640
+ break-inside: avoid;
641
+ }
642
+
643
+ .markdown-body .mermaid-diagram {
644
+ margin: calc(1.4em * var(--md2pdf-space)) 0;
645
+ }
646
+
647
+ /* Footnotes */
648
+
649
+ .markdown-body hr.footnotes-sep {
650
+ display: none;
651
+ }
652
+ .markdown-body .footnotes {
653
+ margin-top: calc(2.4em * var(--md2pdf-space));
654
+ padding-top: 0.8em;
655
+ border-top: 1px dashed color-mix(in srgb, var(--md2pdf-muted) 75%, var(--md2pdf-background));
656
+ font-family: var(--md2pdf-code-font);
657
+ font-size: calc(9 / 12 * var(--md2pdf-font-size));
658
+ font-variant-ligatures: none;
659
+ color: var(--md2pdf-muted);
660
+ }
661
+ .markdown-body .footnotes ol {
662
+ /* Room for "[99]" and its gap, inside the document box. */
663
+ padding-left: 3.6em;
664
+ }
665
+ .markdown-body .footnotes ol > li::before {
666
+ content: "[" counter(list-item) "]";
667
+ top: 0;
668
+ padding: 0;
669
+ border: 0;
670
+ font-size: 1em;
671
+ line-height: inherit;
672
+ color: var(--md2pdf-accent);
673
+ }
674
+ .markdown-body .footnotes li {
675
+ margin: calc(0.2em * var(--md2pdf-space)) 0;
676
+ }
677
+ .markdown-body .footnotes p {
678
+ margin: 0;
679
+ }
680
+ .markdown-body .footnotes .footnote-backref {
681
+ color: inherit;
682
+ text-decoration: none;
683
+ }
684
+
685
+ /* An Obsidian embed (![[Other note]]) that can't be shown: a muted placeholder. */
686
+ .markdown-body .markdown-embed {
687
+ color: var(--md2pdf-muted);
688
+ font-style: italic;
689
+ }
690
+
691
+ /* <div class="page-break"></div> starts a new page. */
692
+ .markdown-body .page-break {
693
+ break-after: page;
694
+ }