@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
package/README.md CHANGED
@@ -6,7 +6,7 @@ Convert Markdown to beautifully styled PDFs. This is the rendering engine and ma
6
6
  - **On a Mac and comfortable with a terminal?** Install the command-line tool below. It adds a Finder right-click action and a keyboard shortcut.
7
7
  - **Building something?** Use the renderer and styles as a dependency, to make PDFs ([Using the renderer](#using-the-renderer)) or to show Markdown in your own pages ([Embedding in a web page](#embedding-in-a-web-page)).
8
8
 
9
- Supports GitHub-flavored Markdown: tables, task lists, footnotes, emoji shortcodes, syntax-highlighted code, raw HTML, GitHub alerts and Obsidian callouts (`> [!NOTE]`, `> [!tip] Custom title`), Obsidian wikilinks and embeds (`[[Note|alias]]` prints as plain text, `![[image.png]]` as an image, and an embedded note as a placeholder naming it), YAML front matter (a leading `---` block of `key: value` properties, left out of the PDF; its `title:` names the document when there is no `#` heading. A leading `---` block of ordinary Markdown prints as Markdown after a divider), and page breaks (`<div class="page-break"></div>`). Seven print styles are included: `github`, `classic`, `academic`, `modern`, `report`, `resume` and `worksheet`.
9
+ Supports GitHub-flavored Markdown: tables, task lists, footnotes, emoji shortcodes, syntax-highlighted code, raw HTML, GitHub alerts and Obsidian callouts (`> [!NOTE]`, `> [!tip] Custom title`), Obsidian wikilinks and embeds (`[[Note|alias]]` prints as plain text, `![[image.png]]` as an image, and an embedded note as a placeholder naming it), YAML front matter (a leading `---` block of `key: value` properties, left out of the PDF; its `title:` names the document when there is no `#` heading. A leading `---` block of ordinary Markdown prints as Markdown after a divider), and page breaks (`<div class="page-break"></div>`). Eleven print styles are included: `github`, `classic`, `academic`, `modern`, `report`, `resume`, `worksheet`, `gothic`, `sandwake`, `elvish` and `cyberpunk`.
10
10
 
11
11
  # Command-line tool (macOS)
12
12
 
@@ -63,6 +63,10 @@ From Finder, a single file opens in Preview when done; multiple files show a not
63
63
  | `report` | Business or technical report: title block from the first heading, running header with the title, "Page N of M" footers, gridded tables |
64
64
  | `resume` | Compact and one-page friendly: the first heading is your name, the paragraph after it your contact line, `##` headings are ruled section dividers |
65
65
  | `worksheet` | For worksheets, stories and class handouts: Andika body text and rounded Fredoka headings (both bundled), larger type, bright headings that change color each section, outlined rounded boxes and big tick boxes for task lists |
66
+ | `gothic` | An old book of dread: blackletter Grenze Gotisch headings and IM Fell English body text (both bundled), oxblood red titles, main headings and table rules, a drop cap after the title, leaf ornaments for rules, page numbers between dashes |
67
+ | `sandwake` | A space-opera codex: wide Michroma capitals for titles and sections, Spectral text and Space Mono labels (all bundled), rust section numbers and drop cap, later titles numbered as books ("Liber II"), a setting-sun rule, outlined code and callouts, a running title and folio numbers |
68
+ | `elvish` | A quiet manuscript from under the trees: Cormorant Unicase titles and sections and Cormorant Garamond text (both bundled) at a larger size, a gold star between leafed sprigs above the title, leaves for bullets and beside `##` headings, a drop cap after each `#` heading, verse-like quotes between stars, double-ruled callouts, italic Roman numerals for lists and page numbers |
69
+ | `cyberpunk` | A job file leaked off somebody's terminal: squared Chakra Petch text and JetBrains Mono labels (both bundled), teal and hot magenta on white, the title in a gridded panel with corner brackets and a cyan and magenta offset, numbered sections ("01 //"), `###` headings as terminal prompts, intercept boxes for quotes, pale terminal panels for code, boxed two-digit list numbers, a running title and page numbers out of the total |
66
70
 
67
71
  Switch the default style — used by the Finder Quick Action, the keyboard shortcut and the `md2pdf` command:
68
72
 
@@ -135,18 +139,18 @@ Every style takes the same variables, set on the `.markdown-body` element. A `--
135
139
 
136
140
  | Variable | What it sets |
137
141
  | -------- | ------------ |
138
- | `--md2pdf-font-size` | The body text size; headings and smaller text scale with it. An absolute length (`pt`, `px` or `rem`), since `em` and `%` would compound. 11pt, or 10.5pt in `modern` and `report`, 10pt in `resume` and 13.5pt in `worksheet` |
142
+ | `--md2pdf-font-size` | The body text size; headings and smaller text scale with it. An absolute length (`pt`, `px` or `rem`), since `em` and `%` would compound. 11pt, or 10.5pt in `modern` and `report`, 10pt in `resume`, 13.5pt in `worksheet` and `elvish`, and 12pt in `gothic` and `cyberpunk` |
139
143
  | `--md2pdf-leading` | Line spacing: scales each line height's excess over 1. 1 as designed |
140
144
  | `--md2pdf-space` | The vertical gaps between blocks. 1 as designed |
141
145
  | `--md2pdf-background` | The document's background, white |
142
146
  | `--md2pdf-text` | Body text |
143
147
  | `--md2pdf-muted` | Secondary text, such as footnotes and captions |
144
- | `--md2pdf-accent` | The accent color: links, headings, list markers or callouts, depending on the style |
148
+ | `--md2pdf-accent` | The accent color: links, headings, list markers or callouts, depending on the style. `gothic`'s leaf ornaments stay oxblood, `sandwake`'s horizon ornament stays rust, `elvish`'s title, `#`, `##`, `####` and `#####` headings, links, quotes, note callouts, table rules and ornaments keep their own greens and gold, and `cyberpunk`'s `##` and `####` headings, links, nested bullets, list numbers, tick boxes, table headings, the title's frame, most of each rule, the quote label, note callouts and function names in code stay teal |
145
149
  | `--md2pdf-rule` | Rules, borders and table lines (every style but `github`) |
146
- | `--md2pdf-surface` | A tinted background: inline code and code blocks in `classic`, `modern` and `worksheet`, and callouts too in `classic`; inline code, quotes and table headings in `report`. The other styles don't use it |
150
+ | `--md2pdf-surface` | A tinted background: inline code and code blocks in `classic`, `modern`, `worksheet`, `gothic` and `elvish`, and callouts too in `classic` and `gothic`; inline code, quotes and table headings in `report`; the inside of code blocks, callouts and inline code in `sandwake`, white as designed; the title panel, inline code, code blocks, table headings and shaded table rows in `cyberpunk`. The other styles don't use it |
147
151
  | `--md2pdf-font` | The body font |
148
- | `--md2pdf-heading-font` | The heading font: the body font, except in `report`, where it's Helvetica and also sets callout titles and tables, and in `worksheet`, where it's Fredoka and also sets callout titles, table headings and list markers |
149
- | `--md2pdf-code-font` | The code font |
152
+ | `--md2pdf-heading-font` | The heading font: the body font, except in `report`, where it's Helvetica and also sets callout titles and tables, in `worksheet`, where it's Fredoka and also sets callout titles, table headings and list markers, in `gothic`, where it's Grenze Gotisch for `#`, `##` and `###` headings and the drop cap, in `sandwake`, where it's Michroma for `#` and `##` headings and the drop cap, and in `elvish`, where it's Cormorant Unicase for `#` and `##` headings and the drop cap |
153
+ | `--md2pdf-code-font` | The code font, and in `sandwake` the small capital labels too: section and book numbers, `####` headings, table headings, callout titles and ordered-list numbers; in `cyberpunk` also keys, `###` and `######` headings, footnotes and every small label: section numbers, list numbers, table headings, callout titles and the title's, quotes' and code blocks' labels |
150
154
 
151
155
  The styles are designed for light pages; a dark page isn't supported. Page headers and footers in a PDF keep the style's own fonts and colors.
152
156
 
package/bin/md2pdf.js CHANGED
@@ -28,6 +28,10 @@ const STYLES = {
28
28
  report: styleFiles('report'),
29
29
  resume: styleFiles('resume'),
30
30
  worksheet: styleFiles('worksheet'),
31
+ gothic: styleFiles('gothic'),
32
+ sandwake: styleFiles('sandwake'),
33
+ elvish: styleFiles('elvish'),
34
+ cyberpunk: styleFiles('cyberpunk'),
31
35
  };
32
36
  const FALLBACK_STYLE = 'github';
33
37
 
package/lib/styles.js CHANGED
@@ -9,4 +9,8 @@ export const pageMargins = {
9
9
  report: '1in 1in 0.9in',
10
10
  resume: '0.6in 0.7in',
11
11
  worksheet: '0.8in 0.9in',
12
+ gothic: '1in 1.1in 0.9in',
13
+ sandwake: '1in 0.9in 0.9in',
14
+ elvish: '1.1in 1.25in 1in',
15
+ cyberpunk: '1in 0.75in 0.9in',
12
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threepenny/md2pdf",
3
- "version": "2.2.3",
3
+ "version": "2.3.0",
4
4
  "description": "Markdown to beautifully styled PDF: the renderer and macOS CLI behind md2pdf.me",
5
5
  "type": "module",
6
6
  "license": "MIT",