@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,47 @@
1
+ /* Sandwake: the print-only rules (page margins, running headers and page numbers). Load after
2
+ ../sandwake.css when printing; a page that only shows the document on screen leaves this out. */
3
+
4
+ :root {
5
+ /* The document's first heading, for the running header; set by the renderer or the page showing it. */
6
+ --document-title: "";
7
+ }
8
+
9
+ /* Margin boxes don't see the document's variables, so these repeat sandwake.css's label font and
10
+ muted color. The title page has its own title, so it has no running header, and no folio. */
11
+ @page {
12
+ margin: 1in 0.9in 0.9in;
13
+ @top-left {
14
+ content: var(--document-title);
15
+ font-family: "md2pdf Space Mono", "SF Mono", Menlo, Consolas, monospace;
16
+ font-size: 7.5pt;
17
+ letter-spacing: 0.14em;
18
+ text-transform: uppercase;
19
+ color: #5e5140;
20
+ }
21
+ /* An empty box stops browsers from adding their own date/title header. */
22
+ @top-center {
23
+ content: "";
24
+ }
25
+ @bottom-right {
26
+ content: "Folio " counter(page, decimal-leading-zero);
27
+ font-family: "md2pdf Space Mono", "SF Mono", Menlo, Consolas, monospace;
28
+ font-size: 7.5pt;
29
+ letter-spacing: 0.14em;
30
+ text-transform: uppercase;
31
+ color: #5e5140;
32
+ }
33
+ }
34
+ @page :first {
35
+ @top-left {
36
+ content: "";
37
+ }
38
+ @bottom-right {
39
+ content: "";
40
+ }
41
+ }
42
+
43
+ html,
44
+ body {
45
+ margin: 0;
46
+ background: #fff;
47
+ }
@@ -0,0 +1,540 @@
1
+ /* Sandwake: a space-opera codex, as if filed by a desert chancery. Wide Michroma capitals for the
2
+ title and sections, Spectral text and Space Mono labels (all bundled), rust section numbers and
3
+ drop cap, later titles numbered as books ("Liber II"), and a sun setting on the horizon for rules.
4
+ White paper: no tinted panels, and nothing printed behind the text. */
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: 12pt">. 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 11pt or 15px; headings and smaller text scale with
12
+ it. --md2pdf-leading scales each line height's excess over 1, and --md2pdf-space the vertical
13
+ gaps between blocks; both are 1 as designed. */
14
+ --md2pdf-font-size: 11pt;
15
+ --md2pdf-leading: 1;
16
+ --md2pdf-space: 1;
17
+ /* Colors: --md2pdf-background the document's background; --md2pdf-text body text, headings and
18
+ table rules; --md2pdf-muted secondary text; --md2pdf-accent section and book numbers, the drop
19
+ cap, list markers, quote bars, code edges, the caution callout's edge, footnote marks, tick boxes
20
+ and label headings;
21
+ --md2pdf-rule hairlines: outlines, rows and the footnote rule; --md2pdf-surface the inside of
22
+ code blocks, callouts and inline code, white as designed. Links are the navy of their own, and
23
+ the horizon ornament stays rust. */
24
+ --md2pdf-background: #fff;
25
+ --md2pdf-text: #1f1a14;
26
+ --md2pdf-muted: #5e5140;
27
+ --md2pdf-accent: #9a3f0e;
28
+ --md2pdf-rule: #c7b89c;
29
+ --md2pdf-surface: #fff;
30
+ /* Fonts: --md2pdf-font body text, h3, h5 and h6; --md2pdf-heading-font the title, h1, h2 and the
31
+ drop cap; --md2pdf-code-font code and the small capital labels: section and book numbers, h4,
32
+ table headings, callout titles and ordered-list numbers. */
33
+ --md2pdf-font: "md2pdf Spectral", "Iowan Old Style", Charter, Georgia, serif;
34
+ --md2pdf-heading-font: "md2pdf Michroma", "Helvetica Neue", Arial, sans-serif;
35
+ --md2pdf-code-font: "md2pdf Space Mono", "SF Mono", Menlo, Consolas, monospace;
36
+ }
37
+
38
+ /* Michroma (Vernon Adams), Spectral (Production Type) and Space Mono (Colophon), all under the SIL
39
+ Open Font License; the licences are in fonts/michroma/OFL.txt, fonts/spectral/OFL.txt and
40
+ fonts/space-mono/OFL.txt. Their latin subsets cover English and Western European languages (Basic
41
+ Latin and Latin-1, plus œ and €); other letters come from the fallbacks. */
42
+ @font-face {
43
+ font-family: "md2pdf Michroma";
44
+ font-weight: 400;
45
+ font-style: normal;
46
+ src: url("fonts/michroma/michroma-latin-400-normal.woff2") format("woff2");
47
+ }
48
+ @font-face {
49
+ font-family: "md2pdf Spectral";
50
+ font-weight: 400;
51
+ font-style: normal;
52
+ src: url("fonts/spectral/spectral-latin-400-normal.woff2") format("woff2");
53
+ }
54
+ @font-face {
55
+ font-family: "md2pdf Spectral";
56
+ font-weight: 400;
57
+ font-style: italic;
58
+ src: url("fonts/spectral/spectral-latin-400-italic.woff2") format("woff2");
59
+ }
60
+ @font-face {
61
+ font-family: "md2pdf Spectral";
62
+ font-weight: 600;
63
+ font-style: normal;
64
+ src: url("fonts/spectral/spectral-latin-600-normal.woff2") format("woff2");
65
+ }
66
+ @font-face {
67
+ font-family: "md2pdf Spectral";
68
+ font-weight: 600;
69
+ font-style: italic;
70
+ src: url("fonts/spectral/spectral-latin-600-italic.woff2") format("woff2");
71
+ }
72
+ @font-face {
73
+ font-family: "md2pdf Space Mono";
74
+ font-weight: 400;
75
+ font-style: normal;
76
+ src: url("fonts/space-mono/space-mono-latin-400-normal.woff2") format("woff2");
77
+ }
78
+ @font-face {
79
+ font-family: "md2pdf Space Mono";
80
+ font-weight: 400;
81
+ font-style: italic;
82
+ src: url("fonts/space-mono/space-mono-latin-400-italic.woff2") format("woff2");
83
+ }
84
+ @font-face {
85
+ font-family: "md2pdf Space Mono";
86
+ font-weight: 700;
87
+ font-style: normal;
88
+ src: url("fonts/space-mono/space-mono-latin-700-normal.woff2") format("woff2");
89
+ }
90
+
91
+ .markdown-body {
92
+ font-family: var(--md2pdf-font);
93
+ background: var(--md2pdf-background);
94
+ font-size: var(--md2pdf-font-size);
95
+ line-height: calc(1 + 0.55 * var(--md2pdf-leading));
96
+ color: var(--md2pdf-text);
97
+ counter-reset: md2pdf-book md2pdf-section;
98
+ /* A long web address wraps at the margin instead of making Chrome shrink the page to fit it. */
99
+ overflow-wrap: break-word;
100
+ font-kerning: normal;
101
+ -webkit-print-color-adjust: exact;
102
+ print-color-adjust: exact;
103
+ }
104
+
105
+ .markdown-body p,
106
+ .markdown-body li {
107
+ text-align: justify;
108
+ hyphens: auto;
109
+ orphans: 3;
110
+ widows: 3;
111
+ }
112
+
113
+ .markdown-body p {
114
+ margin: 0 0 calc(0.75em * var(--md2pdf-space));
115
+ }
116
+
117
+ /* Headings */
118
+
119
+ .markdown-body h1,
120
+ .markdown-body h2,
121
+ .markdown-body h3,
122
+ .markdown-body h4,
123
+ .markdown-body h5,
124
+ .markdown-body h6 {
125
+ font-weight: normal;
126
+ line-height: calc(1 + 0.25 * var(--md2pdf-leading));
127
+ break-after: avoid;
128
+ }
129
+
130
+ /* Every # heading: wide capitals over a rule. */
131
+ .markdown-body h1 {
132
+ font-family: var(--md2pdf-heading-font);
133
+ font-size: calc(21 / 11 * var(--md2pdf-font-size));
134
+ line-height: calc(1 + 0.2 * var(--md2pdf-leading));
135
+ letter-spacing: 0.03em;
136
+ text-transform: uppercase;
137
+ margin: 0 0 calc(1em * var(--md2pdf-space));
138
+ padding-bottom: 0.4em;
139
+ border-bottom: 1.5pt solid var(--md2pdf-text);
140
+ /* A later title's book number is a block inside the heading; without this a page can break between them. */
141
+ break-inside: avoid;
142
+ }
143
+ /* Only the document's own titles count as books; a # heading inside a quote or callout doesn't. */
144
+ .markdown-body > h1 {
145
+ counter-increment: md2pdf-book;
146
+ counter-set: md2pdf-section 0;
147
+ }
148
+ .markdown-body > h1:not(:first-child) {
149
+ margin-top: calc(2.2em * var(--md2pdf-space));
150
+ }
151
+ .markdown-body > h1:not(:first-child)::before {
152
+ content: "Liber " counter(md2pdf-book, upper-roman);
153
+ display: block;
154
+ margin-bottom: calc(0.7em * var(--md2pdf-space));
155
+ font-family: var(--md2pdf-code-font);
156
+ font-weight: 700;
157
+ font-size: calc(8 / 21 * 1em);
158
+ letter-spacing: 0.16em;
159
+ color: var(--md2pdf-accent);
160
+ }
161
+
162
+ /* Sections: tracked capitals, numbered in rust. */
163
+ .markdown-body h2 {
164
+ font-family: var(--md2pdf-heading-font);
165
+ font-size: calc(11.5 / 11 * var(--md2pdf-font-size));
166
+ letter-spacing: 0.08em;
167
+ text-transform: uppercase;
168
+ margin: calc(2em * var(--md2pdf-space)) 0 calc(0.8em * var(--md2pdf-space));
169
+ }
170
+ .markdown-body > h2 {
171
+ counter-increment: md2pdf-section;
172
+ }
173
+ .markdown-body > h2::before {
174
+ content: counter(md2pdf-section, decimal-leading-zero);
175
+ margin-right: 1em;
176
+ font-family: var(--md2pdf-code-font);
177
+ font-weight: 700;
178
+ letter-spacing: 0.06em;
179
+ color: var(--md2pdf-accent);
180
+ }
181
+
182
+ .markdown-body h3 {
183
+ font-size: calc(13.5 / 11 * var(--md2pdf-font-size));
184
+ font-weight: 600;
185
+ margin: calc(1.5em * var(--md2pdf-space)) 0 calc(0.4em * var(--md2pdf-space));
186
+ }
187
+
188
+ .markdown-body h4 {
189
+ font-family: var(--md2pdf-code-font);
190
+ font-weight: 700;
191
+ font-size: calc(8.5 / 11 * var(--md2pdf-font-size));
192
+ letter-spacing: 0.14em;
193
+ text-transform: uppercase;
194
+ color: var(--md2pdf-accent);
195
+ margin: calc(1.5em * var(--md2pdf-space)) 0 calc(0.4em * var(--md2pdf-space));
196
+ }
197
+
198
+ .markdown-body h5,
199
+ .markdown-body h6 {
200
+ font-size: var(--md2pdf-font-size);
201
+ font-style: italic;
202
+ margin: calc(1.2em * var(--md2pdf-space)) 0 calc(0.3em * var(--md2pdf-space));
203
+ }
204
+ .markdown-body h6 {
205
+ color: var(--md2pdf-muted);
206
+ }
207
+
208
+ /* The drop cap: the first letter of the paragraph under the document's title, sunk three lines deep
209
+ where the browser can size it to the lines (Chrome and Safari). Elsewhere (Firefox) it's a raised
210
+ initial, standing on the first line, since sinking it by hand depends on the font's measurements.
211
+ A paragraph whose first element is code or a key, directly or inside a link or other wrapper, has none:
212
+ its first letter would leave the code's box behind, empty. CSS can't tell whether text comes
213
+ before it, so that paragraph loses the drop cap too. */
214
+ .markdown-body > h1:first-child + p:not(:has(> code:first-child)):not(:has(> kbd:first-child)):not(:has(> :first-child > code:first-child)):not(:has(> :first-child > kbd:first-child))::first-letter {
215
+ font-family: var(--md2pdf-heading-font);
216
+ color: var(--md2pdf-accent);
217
+ }
218
+ @supports not ((initial-letter: 3) or (-webkit-initial-letter: 3)) {
219
+ .markdown-body > h1:first-child + p:not(:has(> code:first-child)):not(:has(> kbd:first-child)):not(:has(> :first-child > code:first-child)):not(:has(> :first-child > kbd:first-child))::first-letter {
220
+ font-size: 2.6em;
221
+ line-height: 1;
222
+ margin-right: 0.05em;
223
+ }
224
+ }
225
+ @supports (initial-letter: 3) or (-webkit-initial-letter: 3) {
226
+ /* A paragraph shorter than the letter grows to hold it, so the next block doesn't wrap around it. */
227
+ .markdown-body > h1:first-child + p:not(:has(> code:first-child)):not(:has(> kbd:first-child)):not(:has(> :first-child > code:first-child)):not(:has(> :first-child > kbd:first-child)) {
228
+ display: flow-root;
229
+ }
230
+ .markdown-body > h1:first-child + p:not(:has(> code:first-child)):not(:has(> kbd:first-child)):not(:has(> :first-child > code:first-child)):not(:has(> :first-child > kbd:first-child))::first-letter {
231
+ -webkit-initial-letter: 3;
232
+ initial-letter: 3;
233
+ /* Michroma's wide letters run to their edge; this keeps the text clear of it. Chrome ignores a
234
+ sunk letter's margin, so it's padding, in body-text units. */
235
+ padding-right: calc(0.5 * var(--md2pdf-font-size));
236
+ }
237
+ }
238
+
239
+ /* Links */
240
+
241
+ .markdown-body a {
242
+ color: #1d4a86;
243
+ text-decoration: none;
244
+ }
245
+ .markdown-body a.header-anchor {
246
+ display: none;
247
+ }
248
+
249
+ /* Lists */
250
+
251
+ .markdown-body ul,
252
+ .markdown-body ol {
253
+ margin: 0 0 calc(0.75em * var(--md2pdf-space));
254
+ padding-left: 1.7em;
255
+ }
256
+ .markdown-body li {
257
+ margin: calc(0.15em * var(--md2pdf-space)) 0;
258
+ }
259
+ .markdown-body li > ul,
260
+ .markdown-body li > ol {
261
+ margin: calc(0.15em * var(--md2pdf-space)) 0 0;
262
+ }
263
+ .markdown-body li::marker {
264
+ color: var(--md2pdf-accent);
265
+ }
266
+ .markdown-body ol > li::marker {
267
+ font-family: var(--md2pdf-code-font);
268
+ font-weight: 700;
269
+ font-size: 0.8em;
270
+ }
271
+ .markdown-body .task-list-item {
272
+ list-style-type: none;
273
+ }
274
+ /* Boxes drawn here at the browser's size: its own are greyed out, as they're disabled. */
275
+ .markdown-body .task-list-item input {
276
+ appearance: none;
277
+ width: 12px;
278
+ height: 12px;
279
+ margin: 0 0.45em 0.2em -1.5em;
280
+ vertical-align: middle;
281
+ border: 1px solid var(--md2pdf-accent);
282
+ border-radius: 0;
283
+ background: var(--md2pdf-background);
284
+ }
285
+ .markdown-body .task-list-item input:checked {
286
+ background: var(--md2pdf-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='square'/%3E%3C/svg%3E") center / 100% no-repeat;
287
+ }
288
+
289
+ /* Quotes */
290
+
291
+ .markdown-body blockquote {
292
+ margin: calc(1.1em * var(--md2pdf-space)) 1.5em;
293
+ padding: 0 0 0 1em;
294
+ border-left: 2px solid var(--md2pdf-accent);
295
+ font-style: italic;
296
+ color: var(--md2pdf-muted);
297
+ break-inside: avoid;
298
+ }
299
+ .markdown-body blockquote p {
300
+ text-align: left;
301
+ }
302
+
303
+ /* Callouts (GitHub alerts and Obsidian callouts): an outlined box with a colored edge, its title a
304
+ small capital label. */
305
+
306
+ .markdown-body .markdown-alert {
307
+ --md2pdf-callout: #2e5878;
308
+ margin: calc(1.1em * var(--md2pdf-space)) 0;
309
+ padding: 0.6em 1em 0.65em;
310
+ border: 0.75pt solid var(--md2pdf-rule);
311
+ border-left: 3px solid var(--md2pdf-callout);
312
+ background: var(--md2pdf-surface);
313
+ break-inside: avoid;
314
+ }
315
+ .markdown-body .markdown-alert-tip {
316
+ --md2pdf-callout: #4a6339;
317
+ }
318
+ .markdown-body .markdown-alert-important {
319
+ --md2pdf-callout: #5f4470;
320
+ }
321
+ .markdown-body .markdown-alert-warning {
322
+ --md2pdf-callout: #85560a;
323
+ }
324
+ .markdown-body .markdown-alert-caution {
325
+ --md2pdf-callout: var(--md2pdf-accent);
326
+ }
327
+ .markdown-body .markdown-alert-quote {
328
+ --md2pdf-callout: var(--md2pdf-muted);
329
+ }
330
+ .markdown-body .markdown-alert-title {
331
+ margin-bottom: calc(0.35em * var(--md2pdf-space));
332
+ font-family: var(--md2pdf-code-font);
333
+ font-weight: 700;
334
+ font-size: 0.75em;
335
+ letter-spacing: 0.14em;
336
+ text-transform: uppercase;
337
+ color: var(--md2pdf-callout);
338
+ text-align: left;
339
+ hyphens: manual;
340
+ }
341
+ .markdown-body .markdown-alert-title .octicon {
342
+ margin-right: 0.5em;
343
+ vertical-align: -0.15em;
344
+ width: 1.15em;
345
+ height: 1.15em;
346
+ fill: currentColor;
347
+ }
348
+ .markdown-body .markdown-alert > :last-child {
349
+ margin-bottom: 0;
350
+ }
351
+
352
+ /* Code: outlined, with a rust edge. */
353
+
354
+ .markdown-body code,
355
+ .markdown-body kbd {
356
+ font-family: var(--md2pdf-code-font);
357
+ font-size: 0.8em;
358
+ }
359
+ .markdown-body :not(pre) > code {
360
+ background: var(--md2pdf-surface);
361
+ padding: 0.05em 0.3em;
362
+ border: 0.75pt solid var(--md2pdf-rule);
363
+ }
364
+ .markdown-body kbd {
365
+ padding: 0.05em 0.35em;
366
+ border: 0.75pt solid var(--md2pdf-rule);
367
+ border-bottom-width: 2px;
368
+ background: var(--md2pdf-background);
369
+ }
370
+ .markdown-body pre {
371
+ background: var(--md2pdf-surface);
372
+ border: 0.75pt solid var(--md2pdf-rule);
373
+ border-left: 3px solid var(--md2pdf-accent);
374
+ padding: 0.9em 1.1em;
375
+ margin: 0 0 calc(1em * var(--md2pdf-space));
376
+ line-height: calc(1 + 0.5 * var(--md2pdf-leading));
377
+ white-space: pre-wrap;
378
+ word-break: break-word;
379
+ break-inside: avoid;
380
+ }
381
+ .markdown-body pre code {
382
+ font-size: calc(8.5 / 11 * var(--md2pdf-font-size));
383
+ }
384
+ /* A highlight.js theme on the host page styles .hljs too; keep code blocks this style's own. */
385
+ .markdown-body pre code.hljs {
386
+ display: inline;
387
+ overflow: visible;
388
+ padding: 0;
389
+ color: inherit;
390
+ background: none;
391
+ }
392
+ /* And its tokens: this outranks a theme's token rules, and this style's colors come after it. */
393
+ .markdown-body [class*="hljs-"] {
394
+ color: inherit;
395
+ background: none;
396
+ font-style: inherit;
397
+ font-weight: inherit;
398
+ text-decoration: none;
399
+ }
400
+
401
+ /* Desert syntax colors: rust keywords, navy names, sage strings. */
402
+ .markdown-body .hljs-comment,
403
+ .markdown-body .hljs-quote {
404
+ color: #7a6d5a;
405
+ font-style: italic;
406
+ }
407
+ .markdown-body .hljs-keyword,
408
+ .markdown-body .hljs-selector-tag,
409
+ .markdown-body .hljs-literal,
410
+ .markdown-body .hljs-doctag {
411
+ color: #9a3f0e;
412
+ font-weight: 700;
413
+ }
414
+ .markdown-body .hljs-string,
415
+ .markdown-body .hljs-regexp,
416
+ .markdown-body .hljs-addition {
417
+ color: #4a6339;
418
+ }
419
+ .markdown-body .hljs-number,
420
+ .markdown-body .hljs-symbol,
421
+ .markdown-body .hljs-bullet {
422
+ color: #85560a;
423
+ }
424
+ .markdown-body .hljs-title,
425
+ .markdown-body .hljs-section,
426
+ .markdown-body .hljs-name {
427
+ color: #1d4a86;
428
+ }
429
+ .markdown-body .hljs-built_in,
430
+ .markdown-body .hljs-type,
431
+ .markdown-body .hljs-attr,
432
+ .markdown-body .hljs-attribute,
433
+ .markdown-body .hljs-variable,
434
+ .markdown-body .hljs-template-variable {
435
+ color: #5f4470;
436
+ }
437
+ .markdown-body .hljs-meta,
438
+ .markdown-body .hljs-deletion {
439
+ color: #9a3f0e;
440
+ }
441
+ .markdown-body .hljs-emphasis {
442
+ font-style: italic;
443
+ }
444
+ .markdown-body .hljs-strong {
445
+ font-weight: bold;
446
+ }
447
+
448
+ /* Tables: heavy rules above and below, label-style headings, hairlines between rows. */
449
+
450
+ .markdown-body table {
451
+ border-collapse: collapse;
452
+ margin: calc(1.2em * var(--md2pdf-space)) 0 calc(1.4em * var(--md2pdf-space));
453
+ border-top: 1.5pt solid var(--md2pdf-text);
454
+ border-bottom: 1.5pt solid var(--md2pdf-text);
455
+ font-variant-numeric: tabular-nums;
456
+ }
457
+ .markdown-body th,
458
+ .markdown-body td {
459
+ padding: 0.4em 0.9em 0.4em 0;
460
+ text-align: left;
461
+ }
462
+ .markdown-body td {
463
+ border-top: 0.5pt solid var(--md2pdf-rule);
464
+ }
465
+ .markdown-body th {
466
+ font-family: var(--md2pdf-code-font);
467
+ font-weight: 700;
468
+ font-size: 0.72em;
469
+ letter-spacing: 0.14em;
470
+ text-transform: uppercase;
471
+ border-bottom: 0.75pt solid var(--md2pdf-text);
472
+ }
473
+ .markdown-body tr {
474
+ break-inside: avoid;
475
+ }
476
+
477
+ /* Rules: a sun setting on the horizon, in rust. The fonts have no ornaments of their own. It's an
478
+ image, so it keeps its color when --md2pdf-accent changes: a mask would follow the variable, but
479
+ Chrome prints a solid block beside a masked element. */
480
+
481
+ .markdown-body hr {
482
+ border: 0;
483
+ margin: calc(1.5em * var(--md2pdf-space)) 0;
484
+ /* Firefox otherwise splits the ornament across a page break. */
485
+ break-inside: avoid;
486
+ }
487
+ .markdown-body hr::after {
488
+ content: "";
489
+ display: block;
490
+ width: 10em;
491
+ height: 1em;
492
+ margin: 0 auto;
493
+ background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 16'%3E%3Cpath d='M70 12A10 10 0 0 1 90 12Z' fill='%239a3f0e'/%3E%3Cpath d='M0 12H160' stroke='%239a3f0e' stroke-width='1' fill='none'/%3E%3Cpath d='M30 15.5H130' stroke='%239a3f0e' stroke-width='1' stroke-dasharray='1 5' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
494
+ }
495
+
496
+ .markdown-body img {
497
+ display: block;
498
+ max-width: 100%;
499
+ margin: calc(1em * var(--md2pdf-space)) auto;
500
+ break-inside: avoid;
501
+ }
502
+
503
+ /* Footnotes */
504
+
505
+ .markdown-body hr.footnotes-sep {
506
+ display: none;
507
+ }
508
+ .markdown-body .footnotes {
509
+ margin-top: calc(2.5em * var(--md2pdf-space));
510
+ font-size: calc(9 / 11 * var(--md2pdf-font-size));
511
+ color: var(--md2pdf-muted);
512
+ }
513
+ .markdown-body .footnotes::before {
514
+ content: "";
515
+ display: block;
516
+ width: 30%;
517
+ border-top: 0.75pt solid var(--md2pdf-rule);
518
+ margin-bottom: calc(0.8em * var(--md2pdf-space));
519
+ /* Keep the line on the page with the first footnote. */
520
+ break-after: avoid;
521
+ }
522
+ .markdown-body .footnotes ol {
523
+ /* Room for the numbers, which Safari sets further left than Chrome. */
524
+ padding-left: 2em;
525
+ }
526
+ .markdown-body .footnote-ref a,
527
+ .markdown-body .footnote-backref {
528
+ color: var(--md2pdf-accent);
529
+ }
530
+
531
+ /* An Obsidian embed (![[Other note]]) that can't be shown: a muted placeholder. */
532
+ .markdown-body .markdown-embed {
533
+ color: var(--md2pdf-muted);
534
+ font-style: italic;
535
+ }
536
+
537
+ /* <div class="page-break"></div> starts a new page. */
538
+ .markdown-body .page-break {
539
+ break-after: page;
540
+ }