@threepenny/md2pdf 2.7.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 (44) hide show
  1. package/README.md +22 -8
  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 +15 -0
  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/old-standard-tt/OFL.txt +93 -0
  32. package/styles/fonts/old-standard-tt/old-standard-tt-latin-400-italic.woff2 +0 -0
  33. package/styles/fonts/old-standard-tt/old-standard-tt-latin-400-normal.woff2 +0 -0
  34. package/styles/fonts/old-standard-tt/old-standard-tt-latin-700-normal.woff2 +0 -0
  35. package/styles/gothic.css +15 -0
  36. package/styles/newspaper.css +899 -0
  37. package/styles/print/fiendish.css +92 -0
  38. package/styles/print/newspaper.css +95 -0
  39. package/styles/sandwake.css +14 -0
  40. package/styles/worksheet.css +10 -8
  41. package/styles/fonts/andika/andika-latin-400-italic.woff2 +0 -0
  42. package/styles/fonts/andika/andika-latin-400-normal.woff2 +0 -0
  43. package/styles/fonts/andika/andika-latin-700-italic.woff2 +0 -0
  44. package/styles/fonts/andika/andika-latin-700-normal.woff2 +0 -0
@@ -0,0 +1,93 @@
1
+ Copyright 2011 The Old Standard Project Authors (amkryukov@gmail.com)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
package/styles/gothic.css CHANGED
@@ -64,6 +64,8 @@
64
64
  color: var(--md2pdf-text);
65
65
  /* A long web address wraps at the margin instead of making Chrome shrink the page to fit it. */
66
66
  overflow-wrap: break-word;
67
+ /* Whether a long address may break anywhere, set beside each text-align: only in justified text. */
68
+ --md2pdf-address-break: normal;
67
69
  font-kerning: normal;
68
70
  -webkit-print-color-adjust: exact;
69
71
  print-color-adjust: exact;
@@ -72,6 +74,7 @@
72
74
  .markdown-body p,
73
75
  .markdown-body li {
74
76
  text-align: justify;
77
+ --md2pdf-address-break: break-all;
75
78
  hyphens: auto;
76
79
  orphans: 3;
77
80
  widows: 3;
@@ -118,6 +121,7 @@
118
121
  .markdown-body h1 {
119
122
  font-size: calc(34 / 12 * var(--md2pdf-font-size));
120
123
  text-align: center;
124
+ --md2pdf-address-break: normal;
121
125
  margin: 0 0 calc(0.75em * var(--md2pdf-space));
122
126
  /* The ornament is a block inside the heading; without this a page can break between them. */
123
127
  break-inside: avoid;
@@ -194,10 +198,16 @@
194
198
  .markdown-body a {
195
199
  color: var(--md2pdf-accent);
196
200
  text-decoration: none;
201
+ hyphens: manual;
197
202
  }
198
203
  .markdown-body a.header-anchor {
199
204
  display: none;
200
205
  }
206
+ /* A long address in justified text may break anywhere, without a hyphen, so it starts on the line where it
207
+ falls rather than dropping whole and leaving wide gaps in the line before (#150). */
208
+ .markdown-body a.markdown-address {
209
+ word-break: var(--md2pdf-address-break);
210
+ }
201
211
 
202
212
  /* Bold: oxblood at the weight around it, and body-text color inside text that's already oxblood or a
203
213
  callout's color. IM Fell has no bold, and Safari fakes one by drawing each letter three times,
@@ -259,6 +269,7 @@
259
269
  }
260
270
  .markdown-body blockquote p {
261
271
  text-align: left;
272
+ --md2pdf-address-break: normal;
262
273
  }
263
274
 
264
275
  /* Callouts (GitHub alerts and Obsidian callouts): a ruled box, its title in small capitals. */
@@ -292,6 +303,7 @@
292
303
  font-variant: small-caps;
293
304
  letter-spacing: 0.05em;
294
305
  text-align: left;
306
+ --md2pdf-address-break: normal;
295
307
  hyphens: manual;
296
308
  }
297
309
  .markdown-body .markdown-alert-title .octicon {
@@ -310,6 +322,7 @@
310
322
  .markdown-body code,
311
323
  .markdown-body kbd {
312
324
  font-family: var(--md2pdf-code-font);
325
+ hyphens: manual;
313
326
  font-size: 0.78em;
314
327
  }
315
328
  .markdown-body :not(pre) > code {
@@ -413,6 +426,8 @@
413
426
  .markdown-body td {
414
427
  padding: 0.35em 0.9em;
415
428
  text-align: left;
429
+ --md2pdf-address-break: normal;
430
+ hyphens: manual;
416
431
  }
417
432
  .markdown-body td {
418
433
  border-top: 0.5px solid var(--md2pdf-rule);