@threepenny/md2pdf 2.6.0 → 2.8.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 (65) hide show
  1. package/README.md +24 -10
  2. package/bin/md2pdf.js +60 -16
  3. package/lib/address-links.js +38 -0
  4. package/lib/attributions.js +69 -0
  5. package/lib/fit.js +50 -9
  6. package/lib/italic-lines.js +27 -0
  7. package/lib/render.js +6 -0
  8. package/lib/styles.js +2 -0
  9. package/package.json +1 -1
  10. package/styles/academic.css +14 -0
  11. package/styles/classic.css +88 -2
  12. package/styles/fiendish.css +671 -0
  13. package/styles/fonts/andika/Andika-Bold.woff2 +0 -0
  14. package/styles/fonts/andika/Andika-BoldItalic.woff2 +0 -0
  15. package/styles/fonts/andika/Andika-Italic.woff2 +0 -0
  16. package/styles/fonts/andika/Andika-Regular.woff2 +0 -0
  17. package/styles/fonts/andika/OFL.txt +94 -93
  18. package/styles/fonts/bodoni-moda/OFL.txt +93 -0
  19. package/styles/fonts/bodoni-moda/bodoni-moda-latin-900-normal.woff2 +0 -0
  20. package/styles/fonts/cinzel/OFL.txt +93 -0
  21. package/styles/fonts/cinzel/cinzel-latin-400-normal.woff2 +0 -0
  22. package/styles/fonts/cinzel/cinzel-latin-700-normal.woff2 +0 -0
  23. package/styles/fonts/courier-prime/OFL.txt +93 -0
  24. package/styles/fonts/courier-prime/courier-prime-latin-400-italic.woff2 +0 -0
  25. package/styles/fonts/courier-prime/courier-prime-latin-400-normal.woff2 +0 -0
  26. package/styles/fonts/courier-prime/courier-prime-latin-700-normal.woff2 +0 -0
  27. package/styles/fonts/libre-caslon-text/OFL.txt +93 -0
  28. package/styles/fonts/libre-caslon-text/libre-caslon-text-latin-400-italic.woff2 +0 -0
  29. package/styles/fonts/libre-caslon-text/libre-caslon-text-latin-400-normal.woff2 +0 -0
  30. package/styles/fonts/libre-caslon-text/libre-caslon-text-latin-700-normal.woff2 +0 -0
  31. package/styles/fonts/literata/OFL.txt +93 -0
  32. package/styles/fonts/literata/literata-latin-400-italic.woff2 +0 -0
  33. package/styles/fonts/literata/literata-latin-400-normal.woff2 +0 -0
  34. package/styles/fonts/literata/literata-latin-700-italic.woff2 +0 -0
  35. package/styles/fonts/literata/literata-latin-700-normal.woff2 +0 -0
  36. package/styles/fonts/literata/literata-latin-ext-400-italic.woff2 +0 -0
  37. package/styles/fonts/literata/literata-latin-ext-400-normal.woff2 +0 -0
  38. package/styles/fonts/literata/literata-latin-ext-700-italic.woff2 +0 -0
  39. package/styles/fonts/literata/literata-latin-ext-700-normal.woff2 +0 -0
  40. package/styles/fonts/nunito-sans/OFL.txt +93 -0
  41. package/styles/fonts/nunito-sans/nunito-sans-latin-400-italic.woff2 +0 -0
  42. package/styles/fonts/nunito-sans/nunito-sans-latin-400-normal.woff2 +0 -0
  43. package/styles/fonts/nunito-sans/nunito-sans-latin-700-italic.woff2 +0 -0
  44. package/styles/fonts/nunito-sans/nunito-sans-latin-700-normal.woff2 +0 -0
  45. package/styles/fonts/nunito-sans/nunito-sans-latin-ext-400-italic.woff2 +0 -0
  46. package/styles/fonts/nunito-sans/nunito-sans-latin-ext-400-normal.woff2 +0 -0
  47. package/styles/fonts/nunito-sans/nunito-sans-latin-ext-700-italic.woff2 +0 -0
  48. package/styles/fonts/nunito-sans/nunito-sans-latin-ext-700-normal.woff2 +0 -0
  49. package/styles/fonts/old-standard-tt/OFL.txt +93 -0
  50. package/styles/fonts/old-standard-tt/old-standard-tt-latin-400-italic.woff2 +0 -0
  51. package/styles/fonts/old-standard-tt/old-standard-tt-latin-400-normal.woff2 +0 -0
  52. package/styles/fonts/old-standard-tt/old-standard-tt-latin-700-normal.woff2 +0 -0
  53. package/styles/gothic.css +15 -0
  54. package/styles/modern.css +62 -1
  55. package/styles/newspaper.css +899 -0
  56. package/styles/print/classic.css +1 -1
  57. package/styles/print/fiendish.css +92 -0
  58. package/styles/print/modern.css +1 -1
  59. package/styles/print/newspaper.css +95 -0
  60. package/styles/sandwake.css +14 -0
  61. package/styles/worksheet.css +10 -8
  62. package/styles/fonts/andika/andika-latin-400-italic.woff2 +0 -0
  63. package/styles/fonts/andika/andika-latin-400-normal.woff2 +0 -0
  64. package/styles/fonts/andika/andika-latin-700-italic.woff2 +0 -0
  65. package/styles/fonts/andika/andika-latin-700-normal.woff2 +0 -0
@@ -0,0 +1,671 @@
1
+ /* Fiendish: an infernal contract drawn up in good order. Black ink and seal-wax vermilion on white
2
+ paper; Cinzel Roman capitals for headings over Libre Caslon Text set justified like a legal
3
+ instrument (both bundled). The first heading is the instrument's title, under "By these presents"
4
+ and over a wax seal, and the paragraph after it the preamble; each ## is a numbered clause, a later
5
+ # an addendum, ordered lists are lettered sub-clauses and the footnotes the fine print. No page
6
+ background: the paper stays white up to its edges. */
7
+
8
+ /* Variables a page can override, on .markdown-body itself: for all its documents, or for one with
9
+ <article class="markdown-body" style="--md2pdf-font-size: 13pt">. A value set on :root or another
10
+ ancestor doesn't reach the document. :where() gives these defaults no specificity, so the page's
11
+ rule wins wherever it comes. Every style uses the same names. */
12
+ :where(.markdown-body) {
13
+ /* Size and spacing. --md2pdf-font-size is the body text size, an absolute length such as 12pt or
14
+ 16px; headings and smaller text scale with it. --md2pdf-leading scales each line height's excess
15
+ over 1, and --md2pdf-space the vertical gaps between blocks; both are 1 as designed. */
16
+ --md2pdf-font-size: 11.5pt;
17
+ --md2pdf-leading: 1;
18
+ --md2pdf-space: 1;
19
+ /* Colors: --md2pdf-background the document's background; --md2pdf-text body text, headings and
20
+ rules; --md2pdf-muted secondary text and the fine print; --md2pdf-accent clause and addendum
21
+ numbers, the title's eyebrow, link underlines, list markers, tick boxes, table headings, footnote
22
+ marks and caution callouts (the seal, quotation mark, crosses and flame stay vermilion);
23
+ --md2pdf-rule thin rules; --md2pdf-surface the inside of code. */
24
+ --md2pdf-background: #fff;
25
+ --md2pdf-text: #141210;
26
+ --md2pdf-muted: #5c5650;
27
+ --md2pdf-accent: #b8210f;
28
+ --md2pdf-rule: #c9c2ba;
29
+ --md2pdf-surface: #fff;
30
+ /* Fonts: --md2pdf-font body text, --md2pdf-heading-font headings, callout titles, table headings
31
+ and the fine print's heading, --md2pdf-code-font code. */
32
+ --md2pdf-font: "md2pdf Libre Caslon Text", "Big Caslon", Georgia, serif;
33
+ --md2pdf-heading-font: "md2pdf Cinzel", Trajan, Optima, var(--md2pdf-font);
34
+ --md2pdf-code-font: "md2pdf Courier Prime", "Courier New", Courier, monospace;
35
+ }
36
+
37
+ /* Libre Caslon Text (Pablo Impallari, Rodrigo Fuenzalida), Cinzel (Natanael Gama) and Courier Prime
38
+ (Alan Dague-Greene), all under the SIL Open Font License; the licences are in fonts/libre-caslon-text/OFL.txt,
39
+ fonts/cinzel/OFL.txt and fonts/courier-prime/OFL.txt. Their latin subsets cover English and Western
40
+ European languages; other letters come from the fallbacks. Libre Caslon has no bold italic, and a
41
+ browser would fake one by thickening the italic, which Safari does by drawing each letter three
42
+ times, putting the text in the PDF three times. So bold italic is set in the bold. */
43
+ @font-face {
44
+ font-family: "md2pdf Libre Caslon Text";
45
+ font-weight: 400;
46
+ font-style: normal;
47
+ src: url("fonts/libre-caslon-text/libre-caslon-text-latin-400-normal.woff2") format("woff2");
48
+ }
49
+ @font-face {
50
+ font-family: "md2pdf Libre Caslon Text";
51
+ font-weight: 400;
52
+ font-style: italic;
53
+ src: url("fonts/libre-caslon-text/libre-caslon-text-latin-400-italic.woff2") format("woff2");
54
+ }
55
+ @font-face {
56
+ font-family: "md2pdf Libre Caslon Text";
57
+ font-weight: 700;
58
+ font-style: normal;
59
+ src: url("fonts/libre-caslon-text/libre-caslon-text-latin-700-normal.woff2") format("woff2");
60
+ }
61
+ @font-face {
62
+ font-family: "md2pdf Libre Caslon Text";
63
+ font-weight: 700;
64
+ font-style: italic;
65
+ src: url("fonts/libre-caslon-text/libre-caslon-text-latin-700-normal.woff2") format("woff2");
66
+ }
67
+ @font-face {
68
+ font-family: "md2pdf Cinzel";
69
+ font-weight: 400;
70
+ font-style: normal;
71
+ src: url("fonts/cinzel/cinzel-latin-400-normal.woff2") format("woff2");
72
+ }
73
+ @font-face {
74
+ font-family: "md2pdf Cinzel";
75
+ font-weight: 700;
76
+ font-style: normal;
77
+ src: url("fonts/cinzel/cinzel-latin-700-normal.woff2") format("woff2");
78
+ }
79
+ @font-face {
80
+ font-family: "md2pdf Courier Prime";
81
+ font-weight: 400;
82
+ font-style: normal;
83
+ src: url("fonts/courier-prime/courier-prime-latin-400-normal.woff2") format("woff2");
84
+ }
85
+ @font-face {
86
+ font-family: "md2pdf Courier Prime";
87
+ font-weight: 400;
88
+ font-style: italic;
89
+ src: url("fonts/courier-prime/courier-prime-latin-400-italic.woff2") format("woff2");
90
+ }
91
+ @font-face {
92
+ font-family: "md2pdf Courier Prime";
93
+ font-weight: 700;
94
+ font-style: normal;
95
+ src: url("fonts/courier-prime/courier-prime-latin-700-normal.woff2") format("woff2");
96
+ }
97
+
98
+ .markdown-body {
99
+ /* One point at the designed size: the design's measurements are in these, so they scale with the text. */
100
+ --fiendish-pt: calc(var(--md2pdf-font-size) / 11.5);
101
+ font-family: var(--md2pdf-font);
102
+ background: var(--md2pdf-background);
103
+ font-size: var(--md2pdf-font-size);
104
+ line-height: calc(1 + 0.6 * var(--md2pdf-leading));
105
+ color: var(--md2pdf-text);
106
+ /* Not fiendish-clause too: Chrome then ignores a later # restarting the clauses. Each # resets it. */
107
+ counter-reset: fiendish-addendum;
108
+ /* A long web address wraps at the margin instead of making Chrome shrink the page to fit it. */
109
+ overflow-wrap: break-word;
110
+ /* Whether a long address may break anywhere, set beside each text-align: only in justified text. */
111
+ --md2pdf-address-break: normal;
112
+ font-kerning: normal;
113
+ -webkit-print-color-adjust: exact;
114
+ print-color-adjust: exact;
115
+ }
116
+
117
+ .markdown-body p,
118
+ .markdown-body li {
119
+ text-align: justify;
120
+ --md2pdf-address-break: break-all;
121
+ hyphens: auto;
122
+ orphans: 3;
123
+ widows: 3;
124
+ }
125
+
126
+ .markdown-body p {
127
+ margin: 0 0 calc(9 * var(--fiendish-pt) * var(--md2pdf-space));
128
+ }
129
+
130
+ /* Headings */
131
+
132
+ .markdown-body h1,
133
+ .markdown-body h2,
134
+ .markdown-body h3,
135
+ .markdown-body h4,
136
+ .markdown-body h5,
137
+ .markdown-body h6 {
138
+ font-weight: 400;
139
+ line-height: calc(1 + 0.3 * var(--md2pdf-leading));
140
+ text-wrap: balance;
141
+ break-after: avoid;
142
+ }
143
+
144
+ .markdown-body h1,
145
+ .markdown-body h2,
146
+ .markdown-body h4,
147
+ .markdown-body h5 {
148
+ font-family: var(--md2pdf-heading-font);
149
+ font-weight: 700;
150
+ }
151
+
152
+ .markdown-body h1 {
153
+ font-size: calc(20 * var(--fiendish-pt));
154
+ text-align: center;
155
+ --md2pdf-address-break: normal;
156
+ margin: calc(27 * var(--fiendish-pt) * var(--md2pdf-space)) 0 calc(12 * var(--fiendish-pt) * var(--md2pdf-space));
157
+ /* The eyebrow and ornaments are blocks inside the heading; without this a page can break between them. */
158
+ break-inside: avoid;
159
+ }
160
+ .markdown-body > h1:first-child {
161
+ margin-top: 0;
162
+ }
163
+ /* Each # starts the clauses again at I. */
164
+ .markdown-body > h1 {
165
+ counter-reset: fiendish-clause;
166
+ }
167
+ .markdown-body > h1::before {
168
+ display: block;
169
+ font-size: calc(9 * var(--fiendish-pt));
170
+ line-height: calc(1 + 0.5 * var(--md2pdf-leading));
171
+ letter-spacing: 0.24em;
172
+ color: var(--md2pdf-accent);
173
+ margin-bottom: calc(5 * var(--fiendish-pt) * var(--md2pdf-space));
174
+ }
175
+
176
+ /* The document's first # is the instrument's title: under a double rule and "By these presents",
177
+ over the wax seal between two rules. */
178
+ .markdown-body > h1:first-of-type {
179
+ font-size: calc(27 * var(--fiendish-pt));
180
+ padding-top: calc(15 * var(--fiendish-pt));
181
+ border-top: calc(4.5 * var(--fiendish-pt)) double var(--md2pdf-text);
182
+ }
183
+ .markdown-body > h1:first-of-type::before {
184
+ content: "By these presents";
185
+ }
186
+ .markdown-body > h1:first-of-type::after {
187
+ content: "";
188
+ display: block;
189
+ height: calc(40.5 * var(--fiendish-pt));
190
+ margin-top: calc(10.5 * var(--fiendish-pt) * var(--md2pdf-space));
191
+ /* The seal is an image in vermilion, so it keeps that color when --md2pdf-accent changes. The rules
192
+ are solid gradients: Safari prints those whole. */
193
+ background:
194
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23b8210f'%3E%3Ccircle cx='60.4' cy='32' r='3.2'/%3E%3Ccircle cx='59.25' cy='40' r='3.2'/%3E%3Ccircle cx='55.89' cy='47.35' r='3.2'/%3E%3Ccircle cx='50.6' cy='53.46' r='3.2'/%3E%3Ccircle cx='43.8' cy='57.83' r='3.2'/%3E%3Ccircle cx='36.04' cy='60.11' r='3.2'/%3E%3Ccircle cx='27.96' cy='60.11' r='3.2'/%3E%3Ccircle cx='20.2' cy='57.83' r='3.2'/%3E%3Ccircle cx='13.4' cy='53.46' r='3.2'/%3E%3Ccircle cx='8.11' cy='47.35' r='3.2'/%3E%3Ccircle cx='4.75' cy='40' r='3.2'/%3E%3Ccircle cx='3.6' cy='32' r='3.2'/%3E%3Ccircle cx='4.75' cy='24' r='3.2'/%3E%3Ccircle cx='8.11' cy='16.65' r='3.2'/%3E%3Ccircle cx='13.4' cy='10.54' r='3.2'/%3E%3Ccircle cx='20.2' cy='6.17' r='3.2'/%3E%3Ccircle cx='27.96' cy='3.89' r='3.2'/%3E%3Ccircle cx='36.04' cy='3.89' r='3.2'/%3E%3Ccircle cx='43.8' cy='6.17' r='3.2'/%3E%3Ccircle cx='50.6' cy='10.54' r='3.2'/%3E%3Ccircle cx='55.89' cy='16.65' r='3.2'/%3E%3Ccircle cx='59.25' cy='24' r='3.2'/%3E%3Ccircle cx='32' cy='32' r='28.4'/%3E%3C/g%3E%3Ccircle cx='32' cy='32' r='22.5' fill='none' stroke='%23f1bcb5' stroke-width='1'/%3E%3Cg fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M24 25C21 21 21 16 24 13'/%3E%3Cpath d='M40 25C43 21 43 16 40 13'/%3E%3Cpath d='M24 25C26 29 38 29 40 25'/%3E%3C/g%3E%3Cpath d='M32 30C36 35 37 39 32 46C27 39 28 35 32 30Z' fill='%23fff'/%3E%3Cpath d='M32 37C33.8 39.5 33.8 41.5 32 44C30.2 41.5 30.2 39.5 32 37Z' fill='%23b8210f'/%3E%3C/svg%3E") center / contain no-repeat,
195
+ linear-gradient(var(--md2pdf-text), var(--md2pdf-text)) left center / calc(50% - 30 * var(--fiendish-pt)) 0.75pt no-repeat,
196
+ linear-gradient(var(--md2pdf-text), var(--md2pdf-text)) right center / calc(50% - 30 * var(--fiendish-pt)) 0.75pt no-repeat;
197
+ }
198
+
199
+ /* The preamble: the paragraph under the title, centred in italic. */
200
+ .markdown-body > h1:first-of-type + p {
201
+ margin: calc(13.5 * var(--fiendish-pt) * var(--md2pdf-space)) 8% calc(9 * var(--fiendish-pt) * var(--md2pdf-space));
202
+ font-size: calc(12.2 * var(--fiendish-pt));
203
+ font-style: italic;
204
+ text-align: center;
205
+ text-wrap: balance;
206
+ --md2pdf-address-break: normal;
207
+ hyphens: manual;
208
+ }
209
+
210
+ /* A later # is an addendum, numbered, between a heavy rule and a thin one. */
211
+ .markdown-body > h1 ~ h1 {
212
+ counter-increment: fiendish-addendum;
213
+ padding: calc(7 * var(--fiendish-pt)) 0 calc(6 * var(--fiendish-pt));
214
+ border-top: calc(2.25 * var(--fiendish-pt)) solid var(--md2pdf-text);
215
+ border-bottom: 0.75pt solid var(--md2pdf-text);
216
+ }
217
+ .markdown-body > h1 ~ h1::before {
218
+ content: "Addendum " counter(fiendish-addendum, upper-roman);
219
+ font-size: calc(8.4 * var(--fiendish-pt));
220
+ margin-bottom: calc(3 * var(--fiendish-pt) * var(--md2pdf-space));
221
+ }
222
+
223
+ /* Each ## is a clause, over a hairline. Only the document's own are numbered: a ## inside a quote or
224
+ callout is not one. */
225
+ .markdown-body h2 {
226
+ font-size: calc(13 * var(--fiendish-pt));
227
+ letter-spacing: 0.06em;
228
+ padding-bottom: calc(4 * var(--fiendish-pt));
229
+ border-bottom: 0.75pt solid var(--md2pdf-rule);
230
+ margin: calc(22.5 * var(--fiendish-pt) * var(--md2pdf-space)) 0 calc(9 * var(--fiendish-pt) * var(--md2pdf-space));
231
+ }
232
+ .markdown-body > h2 {
233
+ counter-increment: fiendish-clause;
234
+ }
235
+ .markdown-body > h2::before {
236
+ content: "Clause " counter(fiendish-clause, upper-roman) ".";
237
+ margin-right: 0.58em;
238
+ font-size: 0.78em;
239
+ letter-spacing: 0.14em;
240
+ color: var(--md2pdf-accent);
241
+ }
242
+
243
+ .markdown-body h3 {
244
+ font-size: calc(12.5 * var(--fiendish-pt));
245
+ font-style: italic;
246
+ margin: calc(18 * var(--fiendish-pt) * var(--md2pdf-space)) 0 calc(6 * var(--fiendish-pt) * var(--md2pdf-space));
247
+ }
248
+
249
+ .markdown-body h4,
250
+ .markdown-body h5 {
251
+ font-size: calc(10 * var(--fiendish-pt));
252
+ letter-spacing: 0.16em;
253
+ margin: calc(18 * var(--fiendish-pt) * var(--md2pdf-space)) 0 calc(5 * var(--fiendish-pt) * var(--md2pdf-space));
254
+ }
255
+ .markdown-body h5 {
256
+ font-weight: 400;
257
+ font-size: calc(9.5 * var(--fiendish-pt));
258
+ }
259
+
260
+ .markdown-body h6 {
261
+ font-size: var(--md2pdf-font-size);
262
+ font-style: italic;
263
+ color: var(--md2pdf-muted);
264
+ margin: calc(15 * var(--fiendish-pt) * var(--md2pdf-space)) 0 calc(4 * var(--fiendish-pt) * var(--md2pdf-space));
265
+ }
266
+
267
+ .markdown-body > :first-child {
268
+ margin-top: 0;
269
+ }
270
+
271
+ /* Links: in ink, underlined in vermilion. */
272
+
273
+ .markdown-body a {
274
+ color: inherit;
275
+ text-decoration: underline;
276
+ text-decoration-color: var(--md2pdf-accent);
277
+ text-decoration-thickness: 0.75pt;
278
+ text-underline-offset: 0.18em;
279
+ hyphens: manual;
280
+ }
281
+ .markdown-body a.header-anchor {
282
+ display: none;
283
+ }
284
+ /* A long address in justified text may break anywhere, without a hyphen, so it starts on the line where it
285
+ falls rather than dropping whole and leaving wide gaps in the line before (#150). */
286
+ .markdown-body a.markdown-address {
287
+ word-break: var(--md2pdf-address-break);
288
+ }
289
+
290
+ .markdown-body strong,
291
+ .markdown-body b {
292
+ font-weight: 700;
293
+ }
294
+
295
+ /* Lists: ordered lists are lettered sub-clauses, (a), then (i), then (1); bullets are vermilion
296
+ crosses, a double cross for a nested list. Safari ignores a marker's content and prints its list
297
+ style instead, "a." and "i.", so both are set. */
298
+
299
+ .markdown-body ul,
300
+ .markdown-body ol {
301
+ margin: 0 0 calc(9 * var(--fiendish-pt) * var(--md2pdf-space));
302
+ }
303
+ .markdown-body ul {
304
+ padding-left: 1.5em;
305
+ list-style-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='14' viewBox='0 0 10 18'%3E%3Cpath fill='%23b8210f' d='M4.2 0.5H5.8V4.2H9V5.8H5.8V14L5 17.5L4.2 14V5.8H1V4.2H4.2Z'/%3E%3C/svg%3E");
306
+ }
307
+ .markdown-body li ul {
308
+ list-style-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='14' viewBox='0 0 10 18'%3E%3Cpath fill='%23b8210f' d='M4.2 0.5H5.8V3.7H9V5.3H5.8V12.7H9V14.3H5.8V17.5H4.2V14.3H1V12.7H4.2V5.3H1V3.7H4.2Z'/%3E%3C/svg%3E");
309
+ }
310
+ .markdown-body ol {
311
+ padding-left: 2.4em;
312
+ list-style-type: lower-alpha;
313
+ }
314
+ .markdown-body ol > li::marker {
315
+ content: "(" counter(list-item, lower-alpha) ")\00a0\00a0";
316
+ }
317
+ .markdown-body li ol {
318
+ list-style-type: lower-roman;
319
+ }
320
+ .markdown-body li ol > li::marker {
321
+ content: "(" counter(list-item, lower-roman) ")\00a0\00a0";
322
+ }
323
+ .markdown-body li li ol {
324
+ list-style-type: decimal;
325
+ }
326
+ .markdown-body li li ol > li::marker {
327
+ content: "(" counter(list-item) ")\00a0\00a0";
328
+ }
329
+ .markdown-body li {
330
+ margin: calc(3 * var(--fiendish-pt) * var(--md2pdf-space)) 0;
331
+ }
332
+ .markdown-body li > ul,
333
+ .markdown-body li > ol {
334
+ margin: calc(3 * var(--fiendish-pt) * var(--md2pdf-space)) 0 0;
335
+ }
336
+ .markdown-body li::marker {
337
+ color: var(--md2pdf-accent);
338
+ }
339
+ .markdown-body .task-list-item {
340
+ list-style: none;
341
+ }
342
+ .markdown-body .task-list-item::marker {
343
+ content: none;
344
+ }
345
+ /* Boxes drawn here at the browser's size: its own are greyed out, as they're disabled. */
346
+ .markdown-body .task-list-item input {
347
+ appearance: none;
348
+ width: 13px;
349
+ height: 13px;
350
+ margin: 0 0.5em 0.2em -1.5em;
351
+ vertical-align: middle;
352
+ border: 1.1px solid var(--md2pdf-text);
353
+ border-radius: 0;
354
+ background: var(--md2pdf-background);
355
+ }
356
+ .markdown-body .task-list-item input:checked {
357
+ border-color: var(--md2pdf-accent);
358
+ 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.2l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2'/%3E%3C/svg%3E") center / 100% no-repeat;
359
+ }
360
+
361
+ /* Quotes: italic, under a vermilion quotation mark. */
362
+
363
+ .markdown-body blockquote {
364
+ position: relative;
365
+ margin: calc(15 * var(--fiendish-pt) * var(--md2pdf-space)) 0;
366
+ padding: 0 calc(17 * var(--fiendish-pt)) 0 calc(28 * var(--fiendish-pt));
367
+ font-style: italic;
368
+ break-inside: avoid;
369
+ }
370
+ .markdown-body blockquote::before {
371
+ content: "";
372
+ position: absolute;
373
+ top: calc(4 * var(--fiendish-pt));
374
+ left: calc(1.5 * var(--fiendish-pt));
375
+ width: calc(17 * var(--fiendish-pt));
376
+ height: calc(12.5 * var(--fiendish-pt));
377
+ background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 18'%3E%3Cpath fill='%23b8210f' d='M10 0C4 2 0 6 0 11C0 15 2 18 5.5 18C8.5 18 10.5 16 10.5 13C10.5 10 8.5 8.5 6 8.5C5.3 8.5 4.8 8.6 4.4 8.8C5 5.5 7.5 3 11 1.6ZM23.5 0C17.5 2 13.5 6 13.5 11C13.5 15 15.5 18 19 18C22 18 24 16 24 13C24 10 22 8.5 19.5 8.5C18.8 8.5 18.3 8.6 17.9 8.8C18.5 5.5 21 3 24.5 1.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
378
+ }
379
+ .markdown-body blockquote p {
380
+ text-align: left;
381
+ --md2pdf-address-break: normal;
382
+ }
383
+ .markdown-body blockquote > :last-child {
384
+ margin-bottom: 0;
385
+ }
386
+
387
+ /* Callouts (GitHub alerts and Obsidian callouts): a double-ruled box, its title centred in capitals. */
388
+
389
+ .markdown-body .markdown-alert {
390
+ --md2pdf-callout: #2e4a62;
391
+ margin: calc(15 * var(--fiendish-pt) * var(--md2pdf-space)) 0;
392
+ padding: calc(8 * var(--fiendish-pt)) calc(13 * var(--fiendish-pt)) calc(9 * var(--fiendish-pt));
393
+ border: calc(2.25 * var(--fiendish-pt)) double var(--md2pdf-callout);
394
+ break-inside: avoid;
395
+ }
396
+ .markdown-body .markdown-alert-tip {
397
+ --md2pdf-callout: #3f5a2e;
398
+ }
399
+ .markdown-body .markdown-alert-important {
400
+ --md2pdf-callout: #5b2c6f;
401
+ }
402
+ .markdown-body .markdown-alert-warning {
403
+ --md2pdf-callout: #8a4b00;
404
+ }
405
+ .markdown-body .markdown-alert-caution {
406
+ --md2pdf-callout: var(--md2pdf-accent);
407
+ }
408
+ .markdown-body .markdown-alert-quote {
409
+ --md2pdf-callout: var(--md2pdf-muted);
410
+ }
411
+ .markdown-body .markdown-alert-title {
412
+ margin-bottom: calc(4 * var(--fiendish-pt) * var(--md2pdf-space));
413
+ font-family: var(--md2pdf-heading-font);
414
+ font-weight: 700;
415
+ font-size: calc(9.9 * var(--fiendish-pt));
416
+ letter-spacing: 0.18em;
417
+ line-height: calc(1 + 0.4 * var(--md2pdf-leading));
418
+ color: var(--md2pdf-callout);
419
+ text-align: center;
420
+ --md2pdf-address-break: normal;
421
+ hyphens: manual;
422
+ }
423
+ .markdown-body .markdown-alert-title .octicon {
424
+ margin-right: 0.6em;
425
+ vertical-align: -0.1em;
426
+ width: 1.05em;
427
+ height: 1.05em;
428
+ fill: currentColor;
429
+ }
430
+ .markdown-body .markdown-alert > :last-child {
431
+ margin-bottom: 0;
432
+ }
433
+
434
+ /* Code: Courier Prime, blocks in a frame with a heavy top edge. */
435
+
436
+ .markdown-body code,
437
+ .markdown-body kbd {
438
+ font-family: var(--md2pdf-code-font);
439
+ hyphens: manual;
440
+ font-size: calc(10.5 / 11.5 * 1em);
441
+ }
442
+ .markdown-body :not(pre) > code {
443
+ padding: 0 0.25em;
444
+ border: 0.75pt solid var(--md2pdf-rule);
445
+ background: var(--md2pdf-surface);
446
+ }
447
+ .markdown-body kbd {
448
+ padding: 0 0.3em;
449
+ border: 0.75pt solid var(--md2pdf-text);
450
+ border-bottom-width: 1.5pt;
451
+ background: var(--md2pdf-background);
452
+ }
453
+ .markdown-body pre {
454
+ margin: 0 0 calc(12 * var(--fiendish-pt) * var(--md2pdf-space));
455
+ padding: calc(9 * var(--fiendish-pt)) calc(13.5 * var(--fiendish-pt)) calc(10 * var(--fiendish-pt));
456
+ border: 0.75pt solid var(--md2pdf-text);
457
+ border-top-width: calc(2.25 * var(--fiendish-pt));
458
+ background: var(--md2pdf-surface);
459
+ line-height: calc(1 + 0.5 * var(--md2pdf-leading));
460
+ white-space: pre-wrap;
461
+ word-break: break-word;
462
+ text-align: left;
463
+ break-inside: avoid;
464
+ }
465
+ .markdown-body pre code {
466
+ font-size: calc(10 * var(--fiendish-pt));
467
+ }
468
+ /* A highlight.js theme on the host page styles .hljs too; keep code blocks this style's own. */
469
+ .markdown-body pre code.hljs {
470
+ display: inline;
471
+ overflow: visible;
472
+ padding: 0;
473
+ color: inherit;
474
+ background: none;
475
+ }
476
+ /* And its tokens: this outranks a theme's token rules, and this style's colors come after it. */
477
+ .markdown-body [class*="hljs-"] {
478
+ color: inherit;
479
+ background: none;
480
+ font-style: inherit;
481
+ font-weight: inherit;
482
+ text-decoration: none;
483
+ }
484
+
485
+ /* Ink and sealing-wax syntax colors. */
486
+ .markdown-body .hljs-comment,
487
+ .markdown-body .hljs-quote {
488
+ color: #6f6862;
489
+ font-style: italic;
490
+ }
491
+ .markdown-body .hljs-keyword,
492
+ .markdown-body .hljs-selector-tag,
493
+ .markdown-body .hljs-literal,
494
+ .markdown-body .hljs-doctag,
495
+ .markdown-body .hljs-meta,
496
+ .markdown-body .hljs-deletion {
497
+ color: #a01d0d;
498
+ }
499
+ .markdown-body .hljs-string,
500
+ .markdown-body .hljs-regexp,
501
+ .markdown-body .hljs-addition {
502
+ color: #4d5e2a;
503
+ }
504
+ .markdown-body .hljs-number,
505
+ .markdown-body .hljs-symbol,
506
+ .markdown-body .hljs-bullet {
507
+ color: #8a4b00;
508
+ }
509
+ .markdown-body .hljs-title,
510
+ .markdown-body .hljs-section,
511
+ .markdown-body .hljs-name {
512
+ color: #2e4a62;
513
+ }
514
+ .markdown-body .hljs-built_in,
515
+ .markdown-body .hljs-type,
516
+ .markdown-body .hljs-attr,
517
+ .markdown-body .hljs-attribute,
518
+ .markdown-body .hljs-variable,
519
+ .markdown-body .hljs-template-variable {
520
+ color: #5b2c6f;
521
+ }
522
+ .markdown-body .hljs-emphasis {
523
+ font-style: italic;
524
+ }
525
+ .markdown-body .hljs-strong {
526
+ font-weight: bold;
527
+ }
528
+
529
+ /* Tables: a schedule between heavy rules, its headings in vermilion capitals. */
530
+
531
+ .markdown-body table {
532
+ width: 100%;
533
+ border-collapse: collapse;
534
+ margin: calc(13 * var(--fiendish-pt) * var(--md2pdf-space)) 0 calc(15 * var(--fiendish-pt) * var(--md2pdf-space));
535
+ border-top: 1.5pt solid var(--md2pdf-text);
536
+ border-bottom: 1.5pt solid var(--md2pdf-text);
537
+ font-size: calc(10.5 * var(--fiendish-pt));
538
+ line-height: calc(1 + 0.4 * var(--md2pdf-leading));
539
+ }
540
+ .markdown-body th,
541
+ .markdown-body td {
542
+ text-align: left;
543
+ --md2pdf-address-break: normal;
544
+ hyphens: manual;
545
+ }
546
+ .markdown-body th {
547
+ vertical-align: bottom;
548
+ border-bottom: 0.75pt solid var(--md2pdf-text);
549
+ font-family: var(--md2pdf-heading-font);
550
+ font-weight: 700;
551
+ font-size: calc(8.6 / 10.5 * 1em);
552
+ letter-spacing: 0.12em;
553
+ color: var(--md2pdf-accent);
554
+ }
555
+ /* The heading's padding in its smaller size's ems, scaled back to the cell's. */
556
+ .markdown-body th {
557
+ padding: calc(0.65em / 0.82) calc(0.7em / 0.82) calc(0.5em / 0.82);
558
+ }
559
+ .markdown-body td {
560
+ padding: 0.4em 0.7em;
561
+ border-bottom: 0.75pt solid var(--md2pdf-rule);
562
+ }
563
+ .markdown-body tr:last-child > td {
564
+ border-bottom: 0;
565
+ }
566
+ .markdown-body :is(th, td):first-child {
567
+ padding-left: 0.15em;
568
+ }
569
+ .markdown-body tr {
570
+ break-inside: avoid;
571
+ }
572
+
573
+ /* Rules: a vermilion flame between two rules. */
574
+
575
+ .markdown-body hr {
576
+ border: 0;
577
+ margin: calc(19.5 * var(--fiendish-pt) * var(--md2pdf-space)) 0;
578
+ /* Firefox otherwise splits the ornament across a page break. */
579
+ break-inside: avoid;
580
+ }
581
+ .markdown-body hr::after {
582
+ content: "";
583
+ display: block;
584
+ width: calc(206 * var(--fiendish-pt));
585
+ max-width: 100%;
586
+ height: calc(16.5 * var(--fiendish-pt));
587
+ margin: 0 auto;
588
+ background:
589
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 22'%3E%3Cpath fill='%23b8210f' d='M8 0C11 5 16 9 16 14A8 8 0 0 1 0 14C0 10 3 8 4 4C5 7 6 8 7 8C8 5 8 3 8 0Z'/%3E%3Cpath fill='%23fff' d='M8 11C10 13.5 11 15 11 17A3 3 0 0 1 5 17C5 15 6 13.5 8 11Z'/%3E%3C/svg%3E") center / contain no-repeat,
590
+ linear-gradient(var(--md2pdf-text), var(--md2pdf-text)) left center / calc(50% - 20 * var(--fiendish-pt)) 0.75pt no-repeat,
591
+ linear-gradient(var(--md2pdf-text), var(--md2pdf-text)) right center / calc(50% - 20 * var(--fiendish-pt)) 0.75pt no-repeat;
592
+ }
593
+
594
+ .markdown-body img {
595
+ display: block;
596
+ max-width: 100%;
597
+ margin: calc(12 * var(--fiendish-pt) * var(--md2pdf-space)) auto;
598
+ break-inside: avoid;
599
+ }
600
+
601
+ /* Footnotes: the fine print, small and grey under a rule. */
602
+
603
+ .markdown-body hr.footnotes-sep {
604
+ display: none;
605
+ }
606
+ .markdown-body .footnotes {
607
+ margin-top: calc(30 * var(--fiendish-pt) * var(--md2pdf-space));
608
+ padding-top: calc(8 * var(--fiendish-pt));
609
+ border-top: 0.75pt solid var(--md2pdf-text);
610
+ font-size: calc(9 * var(--fiendish-pt));
611
+ line-height: calc(1 + 0.45 * var(--md2pdf-leading));
612
+ color: var(--md2pdf-muted);
613
+ }
614
+ .markdown-body .footnotes::before {
615
+ content: "The fine print";
616
+ display: block;
617
+ margin-bottom: calc(4.5 * var(--fiendish-pt) * var(--md2pdf-space));
618
+ font-family: var(--md2pdf-heading-font);
619
+ font-weight: 700;
620
+ font-size: calc(9.5 / 9 * 1em);
621
+ letter-spacing: 0.2em;
622
+ color: var(--md2pdf-text);
623
+ /* Keep the heading on the page with the first footnote. */
624
+ break-after: avoid;
625
+ }
626
+ .markdown-body .footnotes ol {
627
+ /* Room for the numbers, which Safari sets further left than Chrome. */
628
+ padding-left: 2em;
629
+ list-style-type: decimal;
630
+ }
631
+ .markdown-body .footnotes ol > li::marker {
632
+ content: counter(list-item) ".\00a0\00a0";
633
+ font-weight: 700;
634
+ color: var(--md2pdf-text);
635
+ }
636
+ .markdown-body .footnote-ref a {
637
+ font-weight: 700;
638
+ color: var(--md2pdf-accent);
639
+ text-decoration: none;
640
+ }
641
+ .markdown-body .footnote-backref {
642
+ color: var(--md2pdf-accent);
643
+ text-decoration: none;
644
+ }
645
+
646
+ /* A word joiner keeps a footnote mark on the line with the word before it. */
647
+ .markdown-body .footnote-ref::before {
648
+ content: "\2060";
649
+ }
650
+
651
+ /* An Obsidian embed (![[Other note]]) that can't be shown: a muted placeholder. */
652
+ .markdown-body .markdown-embed {
653
+ color: var(--md2pdf-muted);
654
+ font-style: italic;
655
+ }
656
+
657
+ /* <div class="page-break"></div> starts a new page. */
658
+ .markdown-body .page-break {
659
+ break-after: page;
660
+ }
661
+
662
+ /* Safari's PDFs copy a ligature as the wrong characters ("The" pastes as "!e", "ffi" as "ffi"), so it
663
+ prints without them. An element's own font-feature-settings or `font` shorthand undoes this; set
664
+ its features with font-variant-* instead. */
665
+ @media print {
666
+ @supports (font: -apple-system-body) {
667
+ .markdown-body {
668
+ font-feature-settings: "liga" 0, "clig" 0;
669
+ }
670
+ }
671
+ }