@threepenny/md2pdf 2.2.3 → 2.4.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.
- package/README.md +22 -14
- package/bin/md2pdf.js +75 -8
- package/lib/math.js +15 -8
- package/lib/render.js +24 -3
- package/lib/styles.js +4 -0
- package/package.json +2 -2
- package/styles/academic.css +18 -1
- package/styles/classic.css +18 -1
- package/styles/cyberpunk.css +710 -0
- package/styles/elvish.css +659 -0
- package/styles/fonts/chakra-petch/OFL.txt +93 -0
- package/styles/fonts/chakra-petch/chakra-petch-latin-400-italic.woff2 +0 -0
- package/styles/fonts/chakra-petch/chakra-petch-latin-400-normal.woff2 +0 -0
- package/styles/fonts/chakra-petch/chakra-petch-latin-700-italic.woff2 +0 -0
- package/styles/fonts/chakra-petch/chakra-petch-latin-700-normal.woff2 +0 -0
- package/styles/fonts/cormorant-garamond/OFL.txt +93 -0
- package/styles/fonts/cormorant-garamond/cormorant-garamond-latin-500-italic.woff2 +0 -0
- package/styles/fonts/cormorant-garamond/cormorant-garamond-latin-500-normal.woff2 +0 -0
- package/styles/fonts/cormorant-garamond/cormorant-garamond-latin-700-italic.woff2 +0 -0
- package/styles/fonts/cormorant-garamond/cormorant-garamond-latin-700-normal.woff2 +0 -0
- package/styles/fonts/cormorant-unicase/OFL.txt +93 -0
- package/styles/fonts/cormorant-unicase/cormorant-unicase-latin-600-normal.woff2 +0 -0
- package/styles/fonts/grenze-gotisch/OFL.txt +93 -0
- package/styles/fonts/grenze-gotisch/grenze-gotisch-latin-600-normal.woff2 +0 -0
- package/styles/fonts/im-fell-english/OFL.txt +93 -0
- package/styles/fonts/im-fell-english/im-fell-english-latin-400-italic.woff2 +0 -0
- package/styles/fonts/im-fell-english/im-fell-english-latin-400-normal.woff2 +0 -0
- package/styles/fonts/jetbrains-mono/OFL.txt +93 -0
- package/styles/fonts/jetbrains-mono/jetbrains-mono-latin-400-italic.woff2 +0 -0
- package/styles/fonts/jetbrains-mono/jetbrains-mono-latin-400-normal.woff2 +0 -0
- package/styles/fonts/jetbrains-mono/jetbrains-mono-latin-700-normal.woff2 +0 -0
- package/styles/fonts/michroma/OFL.txt +93 -0
- package/styles/fonts/michroma/michroma-latin-400-normal.woff2 +0 -0
- package/styles/fonts/space-mono/OFL.txt +93 -0
- package/styles/fonts/space-mono/space-mono-latin-400-italic.woff2 +0 -0
- package/styles/fonts/space-mono/space-mono-latin-400-normal.woff2 +0 -0
- package/styles/fonts/space-mono/space-mono-latin-700-normal.woff2 +0 -0
- package/styles/fonts/spectral/OFL.txt +93 -0
- package/styles/fonts/spectral/spectral-latin-400-italic.woff2 +0 -0
- package/styles/fonts/spectral/spectral-latin-400-normal.woff2 +0 -0
- package/styles/fonts/spectral/spectral-latin-600-italic.woff2 +0 -0
- package/styles/fonts/spectral/spectral-latin-600-normal.woff2 +0 -0
- package/styles/github.css +30 -0
- package/styles/gothic.css +503 -0
- package/styles/modern.css +18 -1
- package/styles/print/academic.css +9 -0
- package/styles/print/classic.css +9 -0
- package/styles/print/cyberpunk.css +101 -0
- package/styles/print/elvish.css +78 -0
- package/styles/print/github.css +9 -0
- package/styles/print/gothic.css +38 -0
- package/styles/print/modern.css +9 -0
- package/styles/print/report.css +9 -0
- package/styles/print/resume.css +9 -0
- package/styles/print/sandwake.css +56 -0
- package/styles/print/worksheet.css +9 -0
- package/styles/report.css +18 -1
- package/styles/resume.css +18 -1
- package/styles/sandwake.css +556 -0
- package/styles/worksheet.css +18 -1
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
/* Elvish: a quiet, symmetrical manuscript, as if copied out in a house under the trees. White
|
|
2
|
+
paper, the unicase cut of Cormorant for the title and section headings and Cormorant Garamond for
|
|
3
|
+
text (both bundled), a gold star between two leafed sprigs above the title, leaves for bullets,
|
|
4
|
+
verse-like quotes and Roman numerals. */
|
|
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 13.5pt
|
|
12
|
+
or 18px; headings and smaller text scale with it. Cormorant is a small face, so the default is
|
|
13
|
+
larger than most styles'. --md2pdf-leading scales each line height's excess over 1, and
|
|
14
|
+
--md2pdf-space the vertical gaps between blocks; both are 1 as designed. */
|
|
15
|
+
--md2pdf-font-size: 13.5pt;
|
|
16
|
+
--md2pdf-leading: 1;
|
|
17
|
+
--md2pdf-space: 1;
|
|
18
|
+
/* Colors: --md2pdf-background the paper; --md2pdf-text body text, tick boxes and key outlines;
|
|
19
|
+
--md2pdf-muted secondary text: h6, footnotes, the quote callout and embed placeholders;
|
|
20
|
+
--md2pdf-accent the drop capital, h3, list numerals, table headings, footnote references and
|
|
21
|
+
highlighted text; --md2pdf-rule hairlines: table rows, inline code (outside links) and
|
|
22
|
+
code-block borders, the inner frame of callouts, the --- rule and the footnote rule;
|
|
23
|
+
--md2pdf-surface the background of code. The title, h1, h2, h4 and h5, links, quotes, the
|
|
24
|
+
note callout and the table's rules are a forest green of their own, and the ornaments
|
|
25
|
+
(sprigs, leaves and stars) keep their own colors. */
|
|
26
|
+
--md2pdf-background: #fff;
|
|
27
|
+
--md2pdf-text: #1f2e2a;
|
|
28
|
+
--md2pdf-muted: #56635d;
|
|
29
|
+
--md2pdf-accent: #7a5c12;
|
|
30
|
+
--md2pdf-rule: #8fa39a;
|
|
31
|
+
--md2pdf-surface: #eef1ea;
|
|
32
|
+
/* Fonts: --md2pdf-font body text and the smaller headings; --md2pdf-heading-font the title, h1,
|
|
33
|
+
h2 and the drop capital, in Cormorant's unicase cut; --md2pdf-code-font code and keys. */
|
|
34
|
+
--md2pdf-font: "md2pdf Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
|
|
35
|
+
--md2pdf-heading-font: "md2pdf Cormorant Unicase", "md2pdf Cormorant Garamond", "Iowan Old Style", Georgia, serif;
|
|
36
|
+
--md2pdf-code-font: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Cormorant Unicase and Cormorant Garamond (the Cormorant Project Authors), both under the SIL Open
|
|
40
|
+
Font License; the licences are in fonts/cormorant-unicase/OFL.txt and fonts/cormorant-garamond/OFL.txt.
|
|
41
|
+
Their latin subsets cover English and Western European languages (Basic Latin and Latin-1, plus œ
|
|
42
|
+
and €); other letters come from the fallbacks. Body text is the medium weight, 500. */
|
|
43
|
+
@font-face {
|
|
44
|
+
font-family: "md2pdf Cormorant Unicase";
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
font-style: normal;
|
|
47
|
+
src: url("fonts/cormorant-unicase/cormorant-unicase-latin-600-normal.woff2") format("woff2");
|
|
48
|
+
}
|
|
49
|
+
@font-face {
|
|
50
|
+
font-family: "md2pdf Cormorant Garamond";
|
|
51
|
+
font-weight: 500;
|
|
52
|
+
font-style: normal;
|
|
53
|
+
src: url("fonts/cormorant-garamond/cormorant-garamond-latin-500-normal.woff2") format("woff2");
|
|
54
|
+
}
|
|
55
|
+
@font-face {
|
|
56
|
+
font-family: "md2pdf Cormorant Garamond";
|
|
57
|
+
font-weight: 500;
|
|
58
|
+
font-style: italic;
|
|
59
|
+
src: url("fonts/cormorant-garamond/cormorant-garamond-latin-500-italic.woff2") format("woff2");
|
|
60
|
+
}
|
|
61
|
+
@font-face {
|
|
62
|
+
font-family: "md2pdf Cormorant Garamond";
|
|
63
|
+
font-weight: 700;
|
|
64
|
+
font-style: normal;
|
|
65
|
+
src: url("fonts/cormorant-garamond/cormorant-garamond-latin-700-normal.woff2") format("woff2");
|
|
66
|
+
}
|
|
67
|
+
@font-face {
|
|
68
|
+
font-family: "md2pdf Cormorant Garamond";
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
font-style: italic;
|
|
71
|
+
src: url("fonts/cormorant-garamond/cormorant-garamond-latin-700-italic.woff2") format("woff2");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.markdown-body {
|
|
75
|
+
font-family: var(--md2pdf-font);
|
|
76
|
+
font-weight: 500;
|
|
77
|
+
background: var(--md2pdf-background);
|
|
78
|
+
font-size: var(--md2pdf-font-size);
|
|
79
|
+
line-height: calc(1 + 0.55 * var(--md2pdf-leading));
|
|
80
|
+
color: var(--md2pdf-text);
|
|
81
|
+
/* A long web address wraps at the margin instead of making Chrome shrink the page to fit it. */
|
|
82
|
+
overflow-wrap: break-word;
|
|
83
|
+
-webkit-print-color-adjust: exact;
|
|
84
|
+
print-color-adjust: exact;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.markdown-body p {
|
|
88
|
+
margin: 0 0 calc(0.75em * var(--md2pdf-space));
|
|
89
|
+
text-wrap: pretty;
|
|
90
|
+
orphans: 3;
|
|
91
|
+
widows: 3;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Headings */
|
|
95
|
+
|
|
96
|
+
.markdown-body h1,
|
|
97
|
+
.markdown-body h2,
|
|
98
|
+
.markdown-body h3,
|
|
99
|
+
.markdown-body h4,
|
|
100
|
+
.markdown-body h5,
|
|
101
|
+
.markdown-body h6 {
|
|
102
|
+
font-weight: 700;
|
|
103
|
+
/* Upright even inside an italic quote, as the unicase face has no italic; h4 and h6 set their own. */
|
|
104
|
+
font-style: normal;
|
|
105
|
+
line-height: calc(1 + 0.3 * var(--md2pdf-leading));
|
|
106
|
+
color: #2f5244;
|
|
107
|
+
break-after: avoid;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* A later # heading: centred under a single star. */
|
|
111
|
+
.markdown-body h1 {
|
|
112
|
+
font-family: var(--md2pdf-heading-font);
|
|
113
|
+
font-size: calc(22.5 / 13.5 * var(--md2pdf-font-size));
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
line-height: calc(1 + 0.2 * var(--md2pdf-leading));
|
|
116
|
+
text-align: center;
|
|
117
|
+
text-wrap: balance;
|
|
118
|
+
margin: calc(1.8em * var(--md2pdf-space)) 0 calc(0.8em * var(--md2pdf-space));
|
|
119
|
+
/* The ornaments are blocks inside the heading; without this a page can break between them. */
|
|
120
|
+
break-inside: avoid;
|
|
121
|
+
}
|
|
122
|
+
.markdown-body h1::before {
|
|
123
|
+
content: "";
|
|
124
|
+
display: block;
|
|
125
|
+
height: 12px;
|
|
126
|
+
margin-bottom: calc(0.5em * var(--md2pdf-space));
|
|
127
|
+
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0L10 6L16 8L10 10L8 16L6 10L0 8L6 6Z' fill='%23b8923a'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* The title: the first heading, under a gold star between two leafed sprigs, with a small rule
|
|
131
|
+
beneath. */
|
|
132
|
+
.markdown-body > h1:first-child {
|
|
133
|
+
font-size: calc(28.5 / 13.5 * var(--md2pdf-font-size));
|
|
134
|
+
margin: 0 0 calc(0.65em * var(--md2pdf-space));
|
|
135
|
+
}
|
|
136
|
+
.markdown-body > h1:first-child::before {
|
|
137
|
+
height: 28px;
|
|
138
|
+
margin-bottom: calc(0.35em * var(--md2pdf-space));
|
|
139
|
+
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 0 256 28'%3E%3Cg%3E%3Cpath d='M136 14Q184 5 232 13' fill='none' stroke='%232f5244' stroke-width='1.2'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%232f5244' transform='translate(152.3 11.4) rotate(-45)'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%235e8573' transform='translate(170.6 9.7) rotate(40)'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%232f5244' transform='translate(188.8 9.2) rotate(-45)'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%235e8573' transform='translate(207 10) rotate(40)'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%232f5244' transform='translate(224.3 11.8) rotate(-40)'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%232f5244' transform='translate(232 13) rotate(12)'/%3E%3C/g%3E%3Cg transform='translate(240 0) scale(-1 1)'%3E%3Cpath d='M136 14Q184 5 232 13' fill='none' stroke='%232f5244' stroke-width='1.2'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%232f5244' transform='translate(152.3 11.4) rotate(-45)'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%235e8573' transform='translate(170.6 9.7) rotate(40)'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%232f5244' transform='translate(188.8 9.2) rotate(-45)'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%235e8573' transform='translate(207 10) rotate(40)'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%232f5244' transform='translate(224.3 11.8) rotate(-40)'/%3E%3Cpath d='M0 0C4-5 11-5 16 0C11 5 4 5 0 0Z' fill='%232f5244' transform='translate(232 13) rotate(12)'/%3E%3C/g%3E%3Cpath d='M120 6L121.2 12.8L128 14L121.2 15.2L120 22L118.8 15.2L112 14L118.8 12.8Z' fill='%23d9be78' transform='rotate(45 120 14)'/%3E%3Cpath d='M120 1L122 12L133 14L122 16L120 27L118 16L107 14L118 12Z' fill='%23b8923a'/%3E%3Ccircle cx='120' cy='14' r='1.6' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
140
|
+
}
|
|
141
|
+
.markdown-body > h1:first-child::after {
|
|
142
|
+
content: "";
|
|
143
|
+
display: block;
|
|
144
|
+
height: 10px;
|
|
145
|
+
margin-top: calc(0.45em * var(--md2pdf-space));
|
|
146
|
+
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 264 10'%3E%3Cpath d='M0 5H120M144 5H264' stroke='%238fa39a'/%3E%3Cpath d='M132 0L137 5L132 10L127 5Z' fill='%23b8923a'/%3E%3C/svg%3E") center / 264px 10px no-repeat;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Sections: centred, with a leaf on a short stem at either side. */
|
|
150
|
+
.markdown-body h2 {
|
|
151
|
+
font-family: var(--md2pdf-heading-font);
|
|
152
|
+
font-size: calc(17.25 / 13.5 * var(--md2pdf-font-size));
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
text-align: center;
|
|
155
|
+
text-wrap: balance;
|
|
156
|
+
margin: calc(1.6em * var(--md2pdf-space)) 0 calc(0.6em * var(--md2pdf-space));
|
|
157
|
+
}
|
|
158
|
+
.markdown-body h2::before,
|
|
159
|
+
.markdown-body h2::after {
|
|
160
|
+
content: "";
|
|
161
|
+
display: inline-block;
|
|
162
|
+
width: 34px;
|
|
163
|
+
height: 10px;
|
|
164
|
+
vertical-align: 0.1em;
|
|
165
|
+
}
|
|
166
|
+
.markdown-body h2::before {
|
|
167
|
+
margin-right: 0.6em;
|
|
168
|
+
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 10'%3E%3Cpath d='M0 5H16' stroke='%238fa39a'/%3E%3Cpath d='M18 5C22 0 30 0 34 5C30 10 22 10 18 5Z' fill='%235e8573'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
169
|
+
}
|
|
170
|
+
.markdown-body h2::after {
|
|
171
|
+
margin-left: 0.6em;
|
|
172
|
+
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 10'%3E%3Cpath d='M18 5H34' stroke='%238fa39a'/%3E%3Cpath d='M16 5C12 0 4 0 0 5C4 10 12 10 16 5Z' fill='%235e8573'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.markdown-body h3 {
|
|
176
|
+
font-size: calc(11.25 / 13.5 * var(--md2pdf-font-size));
|
|
177
|
+
line-height: calc(1 + 0.5 * var(--md2pdf-leading));
|
|
178
|
+
letter-spacing: 0.18em;
|
|
179
|
+
text-transform: uppercase;
|
|
180
|
+
color: var(--md2pdf-accent);
|
|
181
|
+
margin: calc(2em * var(--md2pdf-space)) 0 calc(0.6em * var(--md2pdf-space));
|
|
182
|
+
}
|
|
183
|
+
.markdown-body h4 {
|
|
184
|
+
font-size: calc(14.5 / 13.5 * var(--md2pdf-font-size));
|
|
185
|
+
font-style: italic;
|
|
186
|
+
margin: calc(1.3em * var(--md2pdf-space)) 0 calc(0.35em * var(--md2pdf-space));
|
|
187
|
+
}
|
|
188
|
+
.markdown-body h5,
|
|
189
|
+
.markdown-body h6 {
|
|
190
|
+
font-size: var(--md2pdf-font-size);
|
|
191
|
+
margin: calc(1.2em * var(--md2pdf-space)) 0 calc(0.3em * var(--md2pdf-space));
|
|
192
|
+
}
|
|
193
|
+
.markdown-body h6 {
|
|
194
|
+
font-weight: 500;
|
|
195
|
+
font-style: italic;
|
|
196
|
+
color: var(--md2pdf-muted);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* The paragraph straight after the title or a later # heading opens with a capital sunk three
|
|
200
|
+
lines, unless its first element is a link, code or a key: a link's underline would run under the
|
|
201
|
+
capital. Text before that element doesn't count, so "See [the docs](…)" gets no capital either.
|
|
202
|
+
flow-root keeps a short paragraph from letting the next block wrap around the capital. Chrome ignores a margin on the sunk letter, so the gap is padding,
|
|
203
|
+
in body-text units. */
|
|
204
|
+
.markdown-body > h1 + p:not(:has(> a:first-child)):not(:has(> code:first-child)):not(:has(> kbd:first-child)):not(:has(> :first-child > code:first-child)):not(:has(> :first-child > kbd:first-child)) {
|
|
205
|
+
display: flow-root;
|
|
206
|
+
}
|
|
207
|
+
.markdown-body > h1 + p:not(:has(> a:first-child)):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 {
|
|
208
|
+
-webkit-initial-letter: 3;
|
|
209
|
+
initial-letter: 3;
|
|
210
|
+
padding-right: calc(0.2 * var(--md2pdf-font-size));
|
|
211
|
+
font-family: var(--md2pdf-heading-font);
|
|
212
|
+
font-weight: 600;
|
|
213
|
+
color: var(--md2pdf-accent);
|
|
214
|
+
}
|
|
215
|
+
/* Firefox can't sink a letter: a raised capital instead. */
|
|
216
|
+
@supports not ((initial-letter: 3) or (-webkit-initial-letter: 3)) {
|
|
217
|
+
.markdown-body > h1 + p:not(:has(> a:first-child)):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 {
|
|
218
|
+
font-size: 2.4em;
|
|
219
|
+
line-height: 1;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* Links */
|
|
224
|
+
|
|
225
|
+
.markdown-body a {
|
|
226
|
+
color: #2f5244;
|
|
227
|
+
text-decoration: underline;
|
|
228
|
+
text-decoration-thickness: 0.5pt;
|
|
229
|
+
text-underline-offset: 2pt;
|
|
230
|
+
}
|
|
231
|
+
.markdown-body a.header-anchor {
|
|
232
|
+
display: none;
|
|
233
|
+
}
|
|
234
|
+
/* Code in a link: its box is drawn in the link's color, and as an inline-block it doesn't take the
|
|
235
|
+
link's underline, which would run through the box. The rest of the link stays underlined. */
|
|
236
|
+
.markdown-body a > code {
|
|
237
|
+
display: inline-block;
|
|
238
|
+
/* An inline-block can't shrink below its longest word; these let a long one wrap inside it. */
|
|
239
|
+
max-width: 100%;
|
|
240
|
+
overflow-wrap: anywhere;
|
|
241
|
+
}
|
|
242
|
+
.markdown-body a:has(> code) > code {
|
|
243
|
+
border-color: currentColor;
|
|
244
|
+
}
|
|
245
|
+
.markdown-body .footnote-ref a {
|
|
246
|
+
font-style: italic;
|
|
247
|
+
color: var(--md2pdf-accent);
|
|
248
|
+
text-decoration: none;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* Lists: leaves for bullets, paler when nested, and italic Roman numerals. */
|
|
252
|
+
|
|
253
|
+
.markdown-body ul,
|
|
254
|
+
.markdown-body ol {
|
|
255
|
+
margin: 0 0 calc(0.75em * var(--md2pdf-space));
|
|
256
|
+
padding-left: 1.5em;
|
|
257
|
+
}
|
|
258
|
+
.markdown-body ol {
|
|
259
|
+
padding-left: 2em;
|
|
260
|
+
/* Safari ignores content on ::marker, so the numbering is set here too. */
|
|
261
|
+
list-style-type: lower-roman;
|
|
262
|
+
}
|
|
263
|
+
.markdown-body li ol {
|
|
264
|
+
list-style-type: lower-alpha;
|
|
265
|
+
}
|
|
266
|
+
.markdown-body li {
|
|
267
|
+
margin: calc(0.15em * var(--md2pdf-space)) 0;
|
|
268
|
+
}
|
|
269
|
+
.markdown-body li > ul,
|
|
270
|
+
.markdown-body li > ol {
|
|
271
|
+
margin: calc(0.15em * var(--md2pdf-space)) 0 0;
|
|
272
|
+
}
|
|
273
|
+
.markdown-body ul {
|
|
274
|
+
list-style-type: none;
|
|
275
|
+
}
|
|
276
|
+
.markdown-body ul > li {
|
|
277
|
+
position: relative;
|
|
278
|
+
}
|
|
279
|
+
.markdown-body ul > li:not(.task-list-item)::before {
|
|
280
|
+
content: "";
|
|
281
|
+
position: absolute;
|
|
282
|
+
top: 0.58em;
|
|
283
|
+
left: -1.45em;
|
|
284
|
+
width: 0.78em;
|
|
285
|
+
height: 0.45em;
|
|
286
|
+
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 8'%3E%3Cpath d='M0 4C3 0 10 0 14 4C10 8 3 8 0 4Z' fill='%232f5244'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
287
|
+
transform: rotate(-20deg);
|
|
288
|
+
}
|
|
289
|
+
.markdown-body li ul > li:not(.task-list-item)::before {
|
|
290
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 8'%3E%3Cpath d='M0 4C3 0 10 0 14 4C10 8 3 8 0 4Z' fill='%235e8573'/%3E%3C/svg%3E");
|
|
291
|
+
}
|
|
292
|
+
.markdown-body ol > li::marker {
|
|
293
|
+
content: counter(list-item, lower-roman) ".\a0";
|
|
294
|
+
font-style: italic;
|
|
295
|
+
color: var(--md2pdf-accent);
|
|
296
|
+
}
|
|
297
|
+
.markdown-body li ol > li::marker {
|
|
298
|
+
content: counter(list-item, lower-alpha) ".\a0";
|
|
299
|
+
}
|
|
300
|
+
/* Square boxes drawn here at the text's size: the browser's own are greyed out, as they're disabled. */
|
|
301
|
+
.markdown-body .task-list-item input {
|
|
302
|
+
appearance: none;
|
|
303
|
+
font-size: inherit;
|
|
304
|
+
width: 0.8em;
|
|
305
|
+
height: 0.8em;
|
|
306
|
+
margin: 0 0.55em 0.15em -1.35em;
|
|
307
|
+
vertical-align: middle;
|
|
308
|
+
border: 1.5px solid var(--md2pdf-text);
|
|
309
|
+
border-radius: 0;
|
|
310
|
+
background: var(--md2pdf-background);
|
|
311
|
+
}
|
|
312
|
+
.markdown-body .task-list-item input:checked {
|
|
313
|
+
background: var(--md2pdf-text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2L7 11L12 5' fill='none' stroke='%23fff' stroke-width='1.8'/%3E%3C/svg%3E") center / 100% no-repeat;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/* Emphasis */
|
|
317
|
+
|
|
318
|
+
.markdown-body strong {
|
|
319
|
+
font-weight: 700;
|
|
320
|
+
}
|
|
321
|
+
.markdown-body mark {
|
|
322
|
+
padding: 0 0.15em;
|
|
323
|
+
background: color-mix(in srgb, var(--md2pdf-accent) 22%, var(--md2pdf-background));
|
|
324
|
+
color: inherit;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/* Quotes: verse, centred in italics between two stars. End a line with two spaces or a backslash
|
|
328
|
+
to keep a poem's line breaks. */
|
|
329
|
+
|
|
330
|
+
.markdown-body blockquote {
|
|
331
|
+
margin: calc(1.4em * var(--md2pdf-space)) 0;
|
|
332
|
+
padding: 0 2em;
|
|
333
|
+
font-size: 1.06em;
|
|
334
|
+
font-style: italic;
|
|
335
|
+
text-align: center;
|
|
336
|
+
text-wrap: balance;
|
|
337
|
+
color: #2f5244;
|
|
338
|
+
break-inside: avoid;
|
|
339
|
+
}
|
|
340
|
+
.markdown-body blockquote::before,
|
|
341
|
+
.markdown-body blockquote::after {
|
|
342
|
+
content: "";
|
|
343
|
+
display: block;
|
|
344
|
+
height: 12px;
|
|
345
|
+
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0L10 6L16 8L10 10L8 16L6 10L0 8L6 6Z' fill='%23b8923a'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
|
|
346
|
+
}
|
|
347
|
+
.markdown-body blockquote::before {
|
|
348
|
+
margin-bottom: calc(0.5em * var(--md2pdf-space));
|
|
349
|
+
break-after: avoid;
|
|
350
|
+
}
|
|
351
|
+
.markdown-body blockquote::after {
|
|
352
|
+
margin-top: calc(0.5em * var(--md2pdf-space));
|
|
353
|
+
}
|
|
354
|
+
.markdown-body blockquote > :first-child {
|
|
355
|
+
margin-top: 0;
|
|
356
|
+
}
|
|
357
|
+
/* The quote's own star stands over a heading at its top. */
|
|
358
|
+
.markdown-body blockquote > h1:first-child::before {
|
|
359
|
+
display: none;
|
|
360
|
+
}
|
|
361
|
+
.markdown-body blockquote blockquote {
|
|
362
|
+
font-size: 1em;
|
|
363
|
+
}
|
|
364
|
+
.markdown-body blockquote > :last-child {
|
|
365
|
+
margin-bottom: 0;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/* Callouts (GitHub alerts and Obsidian callouts): a double-ruled box, the outer line and the title
|
|
369
|
+
in the callout's color. */
|
|
370
|
+
|
|
371
|
+
.markdown-body .markdown-alert {
|
|
372
|
+
--md2pdf-callout: #2f5244;
|
|
373
|
+
margin: calc(1.4em * var(--md2pdf-space)) 0;
|
|
374
|
+
padding: calc(0.6em + 3.75pt) calc(1em + 3.75pt) calc(0.7em + 3.75pt);
|
|
375
|
+
border: 0.75pt solid var(--md2pdf-callout);
|
|
376
|
+
/* The inner frame, 3pt inside the border. It stays inside the box: outside, Chrome prints its top
|
|
377
|
+
edge at the foot of the previous page when the callout moves to the next. An inset box-shadow
|
|
378
|
+
prints unevenly from Firefox. */
|
|
379
|
+
outline: 0.75pt solid var(--md2pdf-rule);
|
|
380
|
+
outline-offset: -4.5pt;
|
|
381
|
+
break-inside: avoid;
|
|
382
|
+
}
|
|
383
|
+
.markdown-body .markdown-alert-tip {
|
|
384
|
+
--md2pdf-callout: #3d6b1f;
|
|
385
|
+
}
|
|
386
|
+
.markdown-body .markdown-alert-important {
|
|
387
|
+
--md2pdf-callout: #5a3a7a;
|
|
388
|
+
}
|
|
389
|
+
.markdown-body .markdown-alert-warning {
|
|
390
|
+
--md2pdf-callout: #7a5c12;
|
|
391
|
+
}
|
|
392
|
+
.markdown-body .markdown-alert-caution {
|
|
393
|
+
--md2pdf-callout: #7a2338;
|
|
394
|
+
}
|
|
395
|
+
.markdown-body .markdown-alert-quote {
|
|
396
|
+
--md2pdf-callout: var(--md2pdf-muted);
|
|
397
|
+
}
|
|
398
|
+
.markdown-body .markdown-alert-title {
|
|
399
|
+
margin-bottom: calc(0.25em * var(--md2pdf-space));
|
|
400
|
+
color: var(--md2pdf-callout);
|
|
401
|
+
font-size: 0.78em;
|
|
402
|
+
font-weight: 700;
|
|
403
|
+
letter-spacing: 0.18em;
|
|
404
|
+
text-transform: uppercase;
|
|
405
|
+
}
|
|
406
|
+
.markdown-body .markdown-alert-title .octicon {
|
|
407
|
+
margin-right: 0.7em;
|
|
408
|
+
vertical-align: -0.12em;
|
|
409
|
+
width: 1.1em;
|
|
410
|
+
height: 1.1em;
|
|
411
|
+
fill: currentColor;
|
|
412
|
+
}
|
|
413
|
+
.markdown-body .markdown-alert-title + * {
|
|
414
|
+
margin-top: calc(0.6em * var(--md2pdf-space));
|
|
415
|
+
}
|
|
416
|
+
.markdown-body .markdown-alert > :last-child {
|
|
417
|
+
margin-bottom: 0;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/* Code: plain and quiet, on a slightly darker leaf of the paper. */
|
|
421
|
+
|
|
422
|
+
.markdown-body code,
|
|
423
|
+
.markdown-body kbd {
|
|
424
|
+
font-family: var(--md2pdf-code-font);
|
|
425
|
+
font-size: 0.72em;
|
|
426
|
+
font-style: normal;
|
|
427
|
+
font-weight: 400;
|
|
428
|
+
}
|
|
429
|
+
.markdown-body :not(pre) > code {
|
|
430
|
+
padding: 0.1em 0.4em;
|
|
431
|
+
border: 0.75pt solid var(--md2pdf-rule);
|
|
432
|
+
background: var(--md2pdf-surface);
|
|
433
|
+
}
|
|
434
|
+
.markdown-body kbd {
|
|
435
|
+
padding: 0.1em 0.45em;
|
|
436
|
+
border: 0.75pt solid var(--md2pdf-text);
|
|
437
|
+
border-bottom-width: 1.5pt;
|
|
438
|
+
}
|
|
439
|
+
.markdown-body pre {
|
|
440
|
+
margin: 0 0 calc(1.1em * var(--md2pdf-space));
|
|
441
|
+
padding: 0.9em 1.3em;
|
|
442
|
+
border-top: 0.75pt solid var(--md2pdf-rule);
|
|
443
|
+
border-bottom: 0.75pt solid var(--md2pdf-rule);
|
|
444
|
+
background: var(--md2pdf-surface);
|
|
445
|
+
line-height: calc(1 + 0.45 * var(--md2pdf-leading));
|
|
446
|
+
white-space: pre-wrap;
|
|
447
|
+
word-break: break-word;
|
|
448
|
+
break-inside: avoid;
|
|
449
|
+
}
|
|
450
|
+
.markdown-body pre code {
|
|
451
|
+
font-size: calc(9.75 / 13.5 * var(--md2pdf-font-size));
|
|
452
|
+
}
|
|
453
|
+
/* A highlight.js theme on the host page styles .hljs too; keep code blocks this style's own. */
|
|
454
|
+
.markdown-body pre code.hljs {
|
|
455
|
+
display: inline;
|
|
456
|
+
overflow: visible;
|
|
457
|
+
padding: 0;
|
|
458
|
+
color: inherit;
|
|
459
|
+
background: none;
|
|
460
|
+
}
|
|
461
|
+
/* And its tokens: this outranks a theme's token rules, and this style's colors come after it. */
|
|
462
|
+
.markdown-body [class*="hljs-"] {
|
|
463
|
+
color: inherit;
|
|
464
|
+
background: none;
|
|
465
|
+
font-style: inherit;
|
|
466
|
+
font-weight: inherit;
|
|
467
|
+
text-decoration: none;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.markdown-body .hljs-comment,
|
|
471
|
+
.markdown-body .hljs-quote {
|
|
472
|
+
color: #56635d;
|
|
473
|
+
font-style: italic;
|
|
474
|
+
}
|
|
475
|
+
.markdown-body .hljs-keyword,
|
|
476
|
+
.markdown-body .hljs-selector-tag,
|
|
477
|
+
.markdown-body .hljs-literal,
|
|
478
|
+
.markdown-body .hljs-doctag {
|
|
479
|
+
color: #2f5244;
|
|
480
|
+
font-weight: 700;
|
|
481
|
+
}
|
|
482
|
+
.markdown-body .hljs-string,
|
|
483
|
+
.markdown-body .hljs-regexp,
|
|
484
|
+
.markdown-body .hljs-addition {
|
|
485
|
+
color: #7a5c12;
|
|
486
|
+
}
|
|
487
|
+
.markdown-body .hljs-number,
|
|
488
|
+
.markdown-body .hljs-symbol,
|
|
489
|
+
.markdown-body .hljs-bullet {
|
|
490
|
+
color: #7a2338;
|
|
491
|
+
}
|
|
492
|
+
.markdown-body .hljs-title,
|
|
493
|
+
.markdown-body .hljs-section,
|
|
494
|
+
.markdown-body .hljs-name {
|
|
495
|
+
color: #2f4a7a;
|
|
496
|
+
}
|
|
497
|
+
.markdown-body .hljs-built_in,
|
|
498
|
+
.markdown-body .hljs-type,
|
|
499
|
+
.markdown-body .hljs-attr,
|
|
500
|
+
.markdown-body .hljs-attribute,
|
|
501
|
+
.markdown-body .hljs-variable,
|
|
502
|
+
.markdown-body .hljs-template-variable {
|
|
503
|
+
color: #5a3a7a;
|
|
504
|
+
}
|
|
505
|
+
.markdown-body .hljs-meta,
|
|
506
|
+
.markdown-body .hljs-deletion {
|
|
507
|
+
color: #8a3b1c;
|
|
508
|
+
}
|
|
509
|
+
.markdown-body .hljs-emphasis {
|
|
510
|
+
font-style: italic;
|
|
511
|
+
}
|
|
512
|
+
.markdown-body .hljs-strong {
|
|
513
|
+
font-weight: bold;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/* Math */
|
|
517
|
+
|
|
518
|
+
.markdown-body .katex {
|
|
519
|
+
font-size: 0.95em;
|
|
520
|
+
}
|
|
521
|
+
.markdown-body .katex-display {
|
|
522
|
+
margin: calc(0.9em * var(--md2pdf-space)) 0;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/* Tables: a double rule above and below, small capital headings, hairlines between rows. */
|
|
526
|
+
|
|
527
|
+
.markdown-body table {
|
|
528
|
+
width: 100%;
|
|
529
|
+
border-collapse: collapse;
|
|
530
|
+
margin: calc(1.1em * var(--md2pdf-space)) 0 calc(1.3em * var(--md2pdf-space));
|
|
531
|
+
border-top: 2.25pt double #2f5244;
|
|
532
|
+
border-bottom: 2.25pt double #2f5244;
|
|
533
|
+
font-size: calc(12.75 / 13.5 * var(--md2pdf-font-size));
|
|
534
|
+
line-height: calc(1 + 0.4 * var(--md2pdf-leading));
|
|
535
|
+
font-style: normal;
|
|
536
|
+
text-align: left;
|
|
537
|
+
font-variant-numeric: lining-nums tabular-nums;
|
|
538
|
+
}
|
|
539
|
+
.markdown-body th,
|
|
540
|
+
.markdown-body td {
|
|
541
|
+
padding: 0.4em 0.7em;
|
|
542
|
+
text-align: left;
|
|
543
|
+
vertical-align: top;
|
|
544
|
+
}
|
|
545
|
+
.markdown-body th:first-child,
|
|
546
|
+
.markdown-body td:first-child {
|
|
547
|
+
padding-left: 0;
|
|
548
|
+
}
|
|
549
|
+
.markdown-body th:last-child,
|
|
550
|
+
.markdown-body td:last-child {
|
|
551
|
+
padding-right: 0;
|
|
552
|
+
}
|
|
553
|
+
.markdown-body th {
|
|
554
|
+
padding-top: 0.75em;
|
|
555
|
+
padding-bottom: 0.6em;
|
|
556
|
+
/* The cells' side padding at the table's text size, so the smaller headings line up with their
|
|
557
|
+
columns; 0.76 is the headings' font-size below. */
|
|
558
|
+
padding-left: calc(0.7em / 0.76);
|
|
559
|
+
padding-right: calc(0.7em / 0.76);
|
|
560
|
+
vertical-align: bottom;
|
|
561
|
+
border-bottom: 0.75pt solid #2f5244;
|
|
562
|
+
font-size: 0.76em;
|
|
563
|
+
font-weight: 700;
|
|
564
|
+
letter-spacing: 0.18em;
|
|
565
|
+
text-transform: uppercase;
|
|
566
|
+
color: var(--md2pdf-accent);
|
|
567
|
+
}
|
|
568
|
+
.markdown-body tr:not(:last-child) > td {
|
|
569
|
+
border-bottom: 0.75pt solid color-mix(in srgb, var(--md2pdf-rule) 50%, var(--md2pdf-background));
|
|
570
|
+
}
|
|
571
|
+
.markdown-body tr {
|
|
572
|
+
break-inside: avoid;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/* Rules, images and diagrams */
|
|
576
|
+
|
|
577
|
+
/* A gold star between two leaves, on a hairline. */
|
|
578
|
+
.markdown-body hr {
|
|
579
|
+
height: 20px;
|
|
580
|
+
/* Firefox otherwise splits the ornament across pages. */
|
|
581
|
+
break-inside: avoid;
|
|
582
|
+
margin: calc(1.5em * var(--md2pdf-space)) 0;
|
|
583
|
+
border: 0;
|
|
584
|
+
background:
|
|
585
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 20'%3E%3Cpath d='M0 0C6-8 18-8 26 0C18 8 6 8 0 0Z' fill='%235e8573' transform='translate(26 10) rotate(180) scale(.7)'/%3E%3Cpath d='M0 0C6-8 18-8 26 0C18 8 6 8 0 0Z' fill='%235e8573' transform='translate(54 10) scale(.7)'/%3E%3Cpath d='M40 2L42 8L48 10L42 12L40 18L38 12L32 10L38 8Z' fill='%23b8923a'/%3E%3C/svg%3E") center / 80px 20px no-repeat,
|
|
586
|
+
linear-gradient(var(--md2pdf-rule), var(--md2pdf-rule)) left center / calc(50% - 40px) 0.75pt no-repeat,
|
|
587
|
+
linear-gradient(var(--md2pdf-rule), var(--md2pdf-rule)) right center / calc(50% - 40px) 0.75pt no-repeat;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.markdown-body img {
|
|
591
|
+
display: block;
|
|
592
|
+
max-width: 100%;
|
|
593
|
+
margin: calc(1.2em * var(--md2pdf-space)) auto;
|
|
594
|
+
break-inside: avoid;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.markdown-body .mermaid-diagram {
|
|
598
|
+
margin: calc(1.4em * var(--md2pdf-space)) 0;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/* Footnotes */
|
|
602
|
+
|
|
603
|
+
.markdown-body hr.footnotes-sep {
|
|
604
|
+
display: none;
|
|
605
|
+
}
|
|
606
|
+
.markdown-body .footnotes {
|
|
607
|
+
margin-top: calc(2.2em * var(--md2pdf-space));
|
|
608
|
+
padding-top: 0.7em;
|
|
609
|
+
border-top: 0.75pt solid var(--md2pdf-rule);
|
|
610
|
+
font-size: calc(10.5 / 13.5 * var(--md2pdf-font-size));
|
|
611
|
+
color: var(--md2pdf-muted);
|
|
612
|
+
}
|
|
613
|
+
/* Safari sets the numbers further left than Chrome; less room than this clips them. */
|
|
614
|
+
.markdown-body .footnotes ol {
|
|
615
|
+
padding-left: 2em;
|
|
616
|
+
list-style-type: decimal;
|
|
617
|
+
}
|
|
618
|
+
/* Upright, so the old-style figure isn't lost at this size. */
|
|
619
|
+
.markdown-body .footnotes ol > li::marker {
|
|
620
|
+
content: counter(list-item) "\a0\a0";
|
|
621
|
+
font-style: normal;
|
|
622
|
+
}
|
|
623
|
+
.markdown-body .footnotes li {
|
|
624
|
+
margin: calc(0.15em * var(--md2pdf-space)) 0;
|
|
625
|
+
}
|
|
626
|
+
.markdown-body .footnotes p {
|
|
627
|
+
margin: 0;
|
|
628
|
+
}
|
|
629
|
+
.markdown-body .footnotes .footnote-backref {
|
|
630
|
+
color: inherit;
|
|
631
|
+
text-decoration: none;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/* A word joiner keeps a footnote mark on the line with the word before it. */
|
|
635
|
+
.markdown-body .footnote-ref::before {
|
|
636
|
+
content: "\2060";
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/* An Obsidian embed (![[Other note]]) that can't be shown: a muted placeholder. */
|
|
640
|
+
.markdown-body .markdown-embed {
|
|
641
|
+
color: var(--md2pdf-muted);
|
|
642
|
+
font-style: italic;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/* <div class="page-break"></div> starts a new page. */
|
|
646
|
+
.markdown-body .page-break {
|
|
647
|
+
break-after: page;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/* Safari's PDFs copy a ligature as the wrong characters ("The" pastes as "!e", "ffi" as "ffi"), so it
|
|
651
|
+
prints without them. An element's own font-feature-settings or `font` shorthand undoes this; set
|
|
652
|
+
its features with font-variant-* instead. */
|
|
653
|
+
@media print {
|
|
654
|
+
@supports (font: -apple-system-body) {
|
|
655
|
+
.markdown-body {
|
|
656
|
+
font-feature-settings: "liga" 0, "clig" 0;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|