gutterpress 0.10.7 → 0.10.8-beta.1

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 (59) hide show
  1. package/README.md +10 -3
  2. package/dist/README-aaqapam1.md +186 -0
  3. package/dist/README-mdq34cmb.md +155 -0
  4. package/dist/api/index.d.ts +6 -2
  5. package/dist/api/index.js +30 -2
  6. package/dist/{audit-19e2431j.js → audit-ckbmgzpk.js} +4 -4
  7. package/dist/base-ypqh9n7f.css +123 -0
  8. package/dist/book-ted3tzrp.css +58 -0
  9. package/dist/{build-gqqew2vr.js → build-sgpyjx5n.js} +4 -4
  10. package/dist/callout-hv56m16h.md +7 -0
  11. package/dist/{cli-s8q42x3r.js → cli-4vtgt2ng.js} +78 -2
  12. package/dist/{cli-pvk2s9d7.js → cli-pw6z15yv.js} +1 -1
  13. package/dist/{cli-h8ejbtyr.js → cli-v1ma3v2s.js} +1 -1
  14. package/dist/{cli-kzf64c2g.js → cli-wvw2msvn.js} +946 -401
  15. package/dist/cli.js +16 -16
  16. package/dist/components-0mmswvvm.yaml +51 -0
  17. package/dist/components-aam0fe2z.css +94 -0
  18. package/dist/{doctor-3ccz35yz.js → doctor-59dwzq4r.js} +2 -2
  19. package/dist/{engine-pb6h089e.js → engine-daad33qn.js} +1 -1
  20. package/dist/{engine-88mynx9a.js → engine-db8632w6.js} +2 -2
  21. package/dist/expected-ycmacem8.html +9 -0
  22. package/dist/fixture-2qnyqgb5.md +10 -0
  23. package/dist/gutterpress-m98e2w2d.json +8 -0
  24. package/dist/gutterpress-x2ycdsb8.json +17 -0
  25. package/dist/{index-837htyjy.js → index-9pbaznww.js} +78 -2
  26. package/dist/{index-r4ny4fyr.js → index-m00n6sz4.js} +1147 -523
  27. package/dist/{index-a0xpm188.js → index-rpt4vtby.js} +1 -1
  28. package/dist/index.js +31 -3
  29. package/dist/lib/build-runner.d.ts +52 -0
  30. package/dist/lib/extension-manifest.d.ts +164 -0
  31. package/dist/lib/extension-scaffold.d.ts +65 -0
  32. package/dist/lib/lint-runner.d.ts +12 -0
  33. package/dist/lib/markdown/assemble.d.ts +12 -0
  34. package/dist/lib/markdown/markers.d.ts +20 -0
  35. package/dist/lib/markdown/plugins.d.ts +1 -1
  36. package/dist/lib/markdown/renderer.d.ts +99 -0
  37. package/dist/lib/snippets.d.ts +121 -5
  38. package/dist/lib/theme-import.d.ts +8 -4
  39. package/dist/lib/theme-manager.d.ts +52 -39
  40. package/dist/lib/validation-exec.d.ts +12 -0
  41. package/dist/{lint-mpz7vfc8.js → lint-9xhz0bsw.js} +4 -4
  42. package/dist/{manifest.schema-kwnrwv8b.json → manifest.schema-1q35yxs9.json} +2 -2
  43. package/dist/{new-nbrpsw7t.js → new-5drcm5am.js} +111 -6
  44. package/dist/package-rm9d2tht.json +29 -0
  45. package/dist/page-rules-nsj3aw42.css +128 -0
  46. package/dist/page-templates-7md4ev7d.css +60 -0
  47. package/dist/plugin-m2w7g47v.css +114 -0
  48. package/dist/{plugin-gg5mk26h.js → plugin-sc6zfwre.js} +4 -4
  49. package/dist/plugin.js-aszz0zgh.tpl +172 -0
  50. package/dist/plugin.test.js-mv0ghv5n.tpl +232 -0
  51. package/dist/{preflight-jnmd4mg2.js → preflight-g31c4060.js} +4 -4
  52. package/dist/{preview-hsr9d12d.js → preview-w1pqpq2g.js} +4 -4
  53. package/dist/{publish-pcrrn6fd.js → publish-es72yhd8.js} +4 -4
  54. package/dist/render.js +275 -8
  55. package/dist/term-box-4y0w7y32.md +7 -0
  56. package/dist/{theme-6fa0yjzq.js → theme-msr4ctky.js} +4 -4
  57. package/dist/tokens-e4xk3x4v.css +86 -0
  58. package/dist/{validate-7n25fx0g.js → validate-tsgprng7.js} +4 -4
  59. package/package.json +1 -1
@@ -0,0 +1,123 @@
1
+ /* ===========================================================================
2
+ * {{NAME}} — 2. BASE
3
+ *
4
+ * OWNS
5
+ * The element baseline: what a `p`, `h2`, `ul`, `table`, `blockquote` or
6
+ * `code` looks like when the author wrote plain markdown and opted into
7
+ * nothing. Every value comes from a token — this file decides which token
8
+ * an element uses, never what the value is.
9
+ *
10
+ * This is also where print hygiene for bare elements lives: widow/orphan
11
+ * control, heading break-after, table header repetition.
12
+ *
13
+ * MUST NOT CONTAIN
14
+ * - Component classes. A `.{{PREFIX}}callout` rule belongs in
15
+ * components.css even if it happens to style a paragraph.
16
+ * - Literal colours, sizes or families. If you find yourself typing `#333`
17
+ * here, the token is missing from tokens.css — add it there.
18
+ * - `@page` rules. Those are page-rules.css's.
19
+ *
20
+ * WHY BARE ELEMENT SELECTORS ARE FINE HERE — and only here. A theme IS the
21
+ * book's look, so styling `p` is its job. A PLUGIN styling `p` would leak its
22
+ * opinions into every book that installed it; that is the difference, and it
23
+ * is why components.css below is scoped to classes.
24
+ * ======================================================================== */
25
+
26
+ @layer base {
27
+ body {
28
+ background: var(--{{PREFIX}}paper);
29
+ color: var(--{{PREFIX}}ink);
30
+ font-family: var(--{{PREFIX}}font-body);
31
+ font-size: var(--{{PREFIX}}fs-body);
32
+ line-height: var(--{{PREFIX}}leading);
33
+ }
34
+
35
+ /* Long-form prose: first paragraph flush, the rest indented, no vertical
36
+ gaps. The book convention — not the web one. */
37
+ p {
38
+ margin: 0;
39
+ text-indent: 1.2em;
40
+ orphans: 2;
41
+ widows: 2;
42
+ }
43
+
44
+ h1 + p,
45
+ h2 + p,
46
+ h3 + p,
47
+ blockquote + p,
48
+ ul + p,
49
+ ol + p,
50
+ table + p,
51
+ figure + p {
52
+ text-indent: 0;
53
+ }
54
+
55
+ h1, h2, h3, h4 {
56
+ font-family: var(--{{PREFIX}}font-display);
57
+ color: var(--{{PREFIX}}ink);
58
+ line-height: 1.15;
59
+ /* A heading at the foot of a page with its text on the next one is the
60
+ single most common print defect in a markdown book. */
61
+ break-after: avoid;
62
+ break-inside: avoid;
63
+ }
64
+
65
+ h1 { font-size: var(--{{PREFIX}}fs-h1); margin: 0 0 var(--{{PREFIX}}space-4); }
66
+ h2 { font-size: var(--{{PREFIX}}fs-h2); margin: var(--{{PREFIX}}space-4) 0 var(--{{PREFIX}}space-2); }
67
+ h3 { font-size: var(--{{PREFIX}}fs-h3); margin: var(--{{PREFIX}}space-3) 0 var(--{{PREFIX}}space-1); }
68
+
69
+ ul, ol { margin: var(--{{PREFIX}}space-3) 0; padding-inline-start: 1.4em; }
70
+ li { margin-block: var(--{{PREFIX}}space-1); }
71
+
72
+ blockquote {
73
+ margin: var(--{{PREFIX}}space-3) 0;
74
+ padding-inline-start: var(--{{PREFIX}}space-3);
75
+ border-inline-start: 2px solid var(--{{PREFIX}}rule);
76
+ color: var(--{{PREFIX}}ink-soft);
77
+ font-style: italic;
78
+ }
79
+
80
+ code, pre {
81
+ font-family: var(--{{PREFIX}}font-mono);
82
+ font-size: var(--{{PREFIX}}fs-small);
83
+ }
84
+
85
+ pre {
86
+ background: color-mix(in srgb, var(--{{PREFIX}}rule) 30%, transparent);
87
+ padding: var(--{{PREFIX}}space-2);
88
+ /* Print has no horizontal scrollbar: a long line that cannot wrap is a
89
+ line the reader never sees. */
90
+ white-space: pre-wrap;
91
+ overflow-wrap: break-word;
92
+ break-inside: avoid;
93
+ }
94
+
95
+ table {
96
+ border-collapse: collapse;
97
+ width: 100%;
98
+ margin: var(--{{PREFIX}}space-3) 0;
99
+ font-size: var(--{{PREFIX}}fs-small);
100
+ }
101
+
102
+ th, td {
103
+ border-bottom: 1px solid var(--{{PREFIX}}rule);
104
+ padding: var(--{{PREFIX}}space-1) var(--{{PREFIX}}space-2);
105
+ text-align: start;
106
+ vertical-align: top;
107
+ }
108
+
109
+ /* Repeat the header on every page a long table spills onto. */
110
+ thead { display: table-header-group; }
111
+ tr { break-inside: avoid; }
112
+
113
+ img { max-width: 100%; height: auto; }
114
+
115
+ figure { margin: var(--{{PREFIX}}space-3) 0; break-inside: avoid; }
116
+ figcaption {
117
+ font-size: var(--{{PREFIX}}fs-small);
118
+ color: var(--{{PREFIX}}ink-soft);
119
+ margin-block-start: var(--{{PREFIX}}space-1);
120
+ }
121
+
122
+ a { color: inherit; text-decoration: none; }
123
+ }
@@ -0,0 +1,58 @@
1
+ /* ===========================================================================
2
+ * {{NAME}} — 6. BOOK
3
+ *
4
+ * OWNS
5
+ * This one book's deviations from the theme, and nothing else. Loads last,
6
+ * in the last layer, so anything here wins.
7
+ *
8
+ * The rules that belong here have a shape: a NATURAL SELECTOR CHAIN built
9
+ * from the document's own structure — a chapter id, a page template class,
10
+ * a section component class — that RESETS a component's public token.
11
+ *
12
+ * #ch-appendix { --{{PREFIX}}callout-accent: var(--{{PREFIX}}accent-warm); }
13
+ *
14
+ * That is the whole vocabulary. No new classes to invent, none to retype in
15
+ * the markdown, and the component's own rules stay untouched.
16
+ *
17
+ * MUST NOT CONTAIN
18
+ * - New components. If a second book would want it, it is a component and
19
+ * belongs in components.css.
20
+ * - Raw values in a selector chain. Always set the component's token, never
21
+ * `#ch-appendix .{{PREFIX}}callout { border-color: #7a1f1f; }`. The token
22
+ * is the seam; writing past it re-couples this book to the component's
23
+ * internals and the next change to the component breaks this book.
24
+ * - Per-element classes in the markdown to make a rule here match. If a
25
+ * rule cannot be reached from the document's own structure, the structure
26
+ * is the thing to fix.
27
+ *
28
+ * WHERE THIS FILE SITS. When this theme is applied to a book, Gutterpress
29
+ * copies the whole folder to `themes/<id>/` and wires its sheets into the
30
+ * manifest. A project may ALSO have its own `styles/book.css`, which loads
31
+ * after the theme entirely. Both are override layers; the difference is
32
+ * whether the override travels with the theme (here) or stays with the book
33
+ * (there). Put it here while you are still designing the theme, and move it
34
+ * out when you are sure it is only ever true of one book.
35
+ * ======================================================================== */
36
+
37
+ @layer book {
38
+ /* -------------------------------------------------------------------------
39
+ * A WORKED OVERRIDE — the third and last step of the token pattern.
40
+ *
41
+ * 1. tokens.css declared --{{PREFIX}}accent-warm at :root
42
+ * 2. components.css gave the callout --{{PREFIX}}callout-accent and
43
+ * consumed it bare
44
+ * 3. here one chapter resets it
45
+ *
46
+ * Every callout in that chapter — including ones written next year — picks
47
+ * up the new accent. No markdown changes. No new class. One rule.
48
+ *
49
+ * `#ch-appendix` is the id from `@chapter #ch-appendix` in the markdown, so
50
+ * this matches nothing until a chapter claims that id. Delete it, or point
51
+ * it at a chapter you actually have.
52
+ * ---------------------------------------------------------------------- */
53
+ #ch-appendix {
54
+ --{{PREFIX}}callout-accent: var(--{{PREFIX}}accent-warm);
55
+ }
56
+
57
+ /* Your book's overrides go here. */
58
+ }
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  runBuild,
3
3
  splitOutPath
4
- } from "./cli-kzf64c2g.js";
4
+ } from "./cli-wvw2msvn.js";
5
5
  import {
6
6
  log
7
- } from "./cli-pvk2s9d7.js";
7
+ } from "./cli-pw6z15yv.js";
8
8
  import {
9
9
  UsageError,
10
10
  parseEngine,
@@ -12,8 +12,8 @@ import {
12
12
  parsePdfxFlavor,
13
13
  rejectExtraPositionals,
14
14
  rejectUnknownFlags
15
- } from "./cli-h8ejbtyr.js";
16
- import"./cli-s8q42x3r.js";
15
+ } from "./cli-v1ma3v2s.js";
16
+ import"./cli-4vtgt2ng.js";
17
17
  import"./cli-c41yr7he.js";
18
18
  import {
19
19
  BuildError
@@ -0,0 +1,7 @@
1
+ @section .{{PREFIX}}callout
2
+
3
+ ### {{heading}}
4
+
5
+ {{body}}
6
+
7
+ @end-section
@@ -1430,7 +1430,7 @@ import { fileURLToPath } from "node:url";
1430
1430
  var favicon_default = "./favicon-wkbm9cjn.ico";
1431
1431
 
1432
1432
  // src/assets/manifest.schema.json
1433
- var manifest_schema_default = "./manifest.schema-kwnrwv8b.json";
1433
+ var manifest_schema_default = "./manifest.schema-1q35yxs9.json";
1434
1434
 
1435
1435
  // src/assets/preview/scripts/preview-interface.js
1436
1436
  var preview_interface_default = "./preview-interface-9rwz21yw.js";
@@ -1468,6 +1468,63 @@ var manifest_default3 = "./manifest-n1gh3qw5.yaml";
1468
1468
  // src/assets/templates/technical/chapter-01.md
1469
1469
  var chapter_01_default3 = "./chapter-01-6fn9pvd0.md";
1470
1470
 
1471
+ // src/assets/extension-templates/plugin/gutterpress.json
1472
+ var gutterpress_default = "./gutterpress-m98e2w2d.json";
1473
+
1474
+ // src/assets/extension-templates/plugin/package.json
1475
+ var package_default = "./package-rm9d2tht.json";
1476
+
1477
+ // src/assets/extension-templates/plugin/README.md
1478
+ var README_default = "./README-mdq34cmb.md";
1479
+
1480
+ // src/assets/extension-templates/plugin/plugin.js.tpl
1481
+ var plugin_js_default = "./plugin.js-aszz0zgh.tpl";
1482
+
1483
+ // src/assets/extension-templates/plugin/styles/plugin.css
1484
+ var plugin_default = "./plugin-m2w7g47v.css";
1485
+
1486
+ // src/assets/extension-templates/plugin/snippets/term-box.md
1487
+ var term_box_default = "./term-box-4y0w7y32.md";
1488
+
1489
+ // src/assets/extension-templates/plugin/test/fixture.md
1490
+ var fixture_default = "./fixture-2qnyqgb5.md";
1491
+
1492
+ // src/assets/extension-templates/plugin/test/expected.html
1493
+ var expected_default = "./expected-ycmacem8.html";
1494
+
1495
+ // src/assets/extension-templates/plugin/test/plugin.test.js.tpl
1496
+ var plugin_test_js_default = "./plugin.test.js-mv0ghv5n.tpl";
1497
+
1498
+ // src/assets/extension-templates/theme/gutterpress.json
1499
+ var gutterpress_default2 = "./gutterpress-x2ycdsb8.json";
1500
+
1501
+ // src/assets/extension-templates/theme/README.md
1502
+ var README_default2 = "./README-aaqapam1.md";
1503
+
1504
+ // src/assets/extension-templates/theme/components.yaml
1505
+ var components_default = "./components-0mmswvvm.yaml";
1506
+
1507
+ // src/assets/extension-templates/theme/snippets/callout.md
1508
+ var callout_default = "./callout-hv56m16h.md";
1509
+
1510
+ // src/assets/extension-templates/theme/styles/tokens.css
1511
+ var tokens_default = "./tokens-e4xk3x4v.css";
1512
+
1513
+ // src/assets/extension-templates/theme/styles/base.css
1514
+ var base_default = "./base-ypqh9n7f.css";
1515
+
1516
+ // src/assets/extension-templates/theme/styles/components.css
1517
+ var components_default2 = "./components-aam0fe2z.css";
1518
+
1519
+ // src/assets/extension-templates/theme/styles/page-templates.css
1520
+ var page_templates_default = "./page-templates-7md4ev7d.css";
1521
+
1522
+ // src/assets/extension-templates/theme/styles/page-rules.css
1523
+ var page_rules_default = "./page-rules-nsj3aw42.css";
1524
+
1525
+ // src/assets/extension-templates/theme/styles/book.css
1526
+ var book_default = "./book-ted3tzrp.css";
1527
+
1471
1528
  // src/assets/themes/clean-book/theme.css
1472
1529
  var theme_default = "./theme-j2bagrfx.css";
1473
1530
 
@@ -1505,6 +1562,25 @@ var EMBEDDED_ASSETS = {
1505
1562
  "templates/zine/chapter-01.md": abs(filePath(chapter_01_default2)),
1506
1563
  "templates/technical/manifest.yaml": abs(filePath(manifest_default3)),
1507
1564
  "templates/technical/chapter-01.md": abs(filePath(chapter_01_default3)),
1565
+ "extension-templates/plugin/gutterpress.json": abs(filePath(gutterpress_default)),
1566
+ "extension-templates/plugin/package.json": abs(filePath(package_default)),
1567
+ "extension-templates/plugin/README.md": abs(filePath(README_default)),
1568
+ "extension-templates/plugin/plugin.js.tpl": abs(filePath(plugin_js_default)),
1569
+ "extension-templates/plugin/styles/plugin.css": abs(filePath(plugin_default)),
1570
+ "extension-templates/plugin/snippets/term-box.md": abs(filePath(term_box_default)),
1571
+ "extension-templates/plugin/test/fixture.md": abs(filePath(fixture_default)),
1572
+ "extension-templates/plugin/test/expected.html": abs(filePath(expected_default)),
1573
+ "extension-templates/plugin/test/plugin.test.js.tpl": abs(filePath(plugin_test_js_default)),
1574
+ "extension-templates/theme/gutterpress.json": abs(filePath(gutterpress_default2)),
1575
+ "extension-templates/theme/README.md": abs(filePath(README_default2)),
1576
+ "extension-templates/theme/components.yaml": abs(filePath(components_default)),
1577
+ "extension-templates/theme/snippets/callout.md": abs(filePath(callout_default)),
1578
+ "extension-templates/theme/styles/tokens.css": abs(filePath(tokens_default)),
1579
+ "extension-templates/theme/styles/base.css": abs(filePath(base_default)),
1580
+ "extension-templates/theme/styles/components.css": abs(filePath(components_default2)),
1581
+ "extension-templates/theme/styles/page-templates.css": abs(filePath(page_templates_default)),
1582
+ "extension-templates/theme/styles/page-rules.css": abs(filePath(page_rules_default)),
1583
+ "extension-templates/theme/styles/book.css": abs(filePath(book_default)),
1508
1584
  "themes/clean-book/theme.css": abs(filePath(theme_default)),
1509
1585
  "themes/clean-book/theme.json": abs(filePath(theme_default2)),
1510
1586
  "themes/zine/theme.css": abs(filePath(theme_default3)),
@@ -2849,4 +2925,4 @@ ${lines.length ? lines.join(`
2849
2925
  `);
2850
2926
  }
2851
2927
 
2852
- export { RENDER_TIMEOUT_MS, prewarmBrowser, getBrowser, closeBrowser, getAssetPath, MARGIN_BOX_IGNORED_PROPERTIES, REQUIRED_MILESTONE, assertMilestone, connectChromium, build };
2928
+ export { RENDER_TIMEOUT_MS, prewarmBrowser, getBrowser, closeBrowser, getAssetsDir, getAssetPath, MARGIN_BOX_IGNORED_PROPERTIES, REQUIRED_MILESTONE, assertMilestone, connectChromium, build };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "./cli-h8ejbtyr.js";
3
+ } from "./cli-v1ma3v2s.js";
4
4
  import {
5
5
  execCapture,
6
6
  findTool,
@@ -4,7 +4,7 @@ import {
4
4
  // package.json
5
5
  var package_default = {
6
6
  name: "gutterpress",
7
- version: "0.10.7",
7
+ version: "0.10.8-beta.1",
8
8
  description: "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
9
9
  author: "itlackey",
10
10
  license: "MPL-2.0",