gutterpress 0.11.23-alpha.2 → 0.11.23-alpha.4

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 (82) hide show
  1. package/README.md +10 -13
  2. package/dist/{README-8ef336pp.md → README-syg2hn83.md} +13 -19
  3. package/dist/api/index.d.ts +1 -1
  4. package/dist/api/index.js +5 -5
  5. package/dist/{build-encgnv0c.js → build-c48eer6f.js} +8 -8
  6. package/dist/checks/asset/extensions.d.ts +1 -1
  7. package/dist/checks/asset/index.d.ts +0 -1
  8. package/dist/checks/policy.d.ts +5 -4
  9. package/dist/checks/source/config-file.d.ts +9 -6
  10. package/dist/checks/source/dangling-links.d.ts +1 -1
  11. package/dist/checks/types.d.ts +2 -2
  12. package/dist/{cli-pz4bn98t.js → cli-54xt7pjg.js} +19 -13
  13. package/dist/{index-2ppw6q9v.js → cli-5crpmz42.js} +80 -1
  14. package/dist/{cli-xq6djqbj.js → cli-93mkaw6v.js} +166 -308
  15. package/dist/{cli-evg8sbht.js → cli-d9mm3vvh.js} +7 -2
  16. package/dist/{cli-kh8v4vvw.js → cli-gnpea9dx.js} +1 -1
  17. package/dist/{cli-aqh6brew.js → cli-pspjxnc8.js} +1 -1
  18. package/dist/{cli-pwwfxdgb.js → cli-rqh295j9.js} +15 -21
  19. package/dist/{index-x3ema2w3.js → cli-y6d1arem.js} +321 -272
  20. package/dist/cli.js +12 -12
  21. package/dist/{doctor-5gtpgpd1.js → doctor-ptb346k8.js} +4 -3
  22. package/dist/engine/shared/gcpm-extract.d.ts +8 -0
  23. package/dist/engine/shared/print-area.d.ts +16 -4
  24. package/dist/{engine-mc5br8g8.js → engine-4rzdx6af.js} +1 -1
  25. package/dist/{engine-tn13gk0b.js → engine-6txhxmmv.js} +2 -2
  26. package/dist/{ext-wn2a5afq.js → ext-gy8szg3x.js} +8 -8
  27. package/dist/{extension-restore-s3x1618g.js → extension-restore-dymzcasz.js} +2 -2
  28. package/dist/{extension-restore-g8jnmmzq.js → extension-restore-m8tj43e7.js} +4 -4
  29. package/dist/{gutterpress-viewer-701vf4qp.js → gutterpress-viewer-mafsby5k.js} +9 -2
  30. package/dist/{cli-2ppw6q9v.js → index-5crpmz42.js} +80 -1
  31. package/dist/{index-0skhjx3e.js → index-5kh4c78h.js} +19 -13
  32. package/dist/{index-2bjcghze.js → index-8ywkd2sv.js} +15 -21
  33. package/dist/{index-j5z86r4a.js → index-ea94zbq4.js} +329 -488
  34. package/dist/{cli-sdmv4bba.js → index-kaks3mm2.js} +448 -156
  35. package/dist/{index-4x6y8krm.js → index-yc3xj266.js} +1 -1
  36. package/dist/index.js +6 -6
  37. package/dist/lib/build-preflight.d.ts +4 -10
  38. package/dist/lib/build-runner.d.ts +1 -1
  39. package/dist/lib/extension-manager.d.ts +8 -7
  40. package/dist/lib/extension-manifest.d.ts +1 -13
  41. package/dist/lib/ghostscript.d.ts +5 -2
  42. package/dist/lib/lint-rules.d.ts +5 -1
  43. package/dist/lib/manifest-config.d.ts +3 -2
  44. package/dist/lib/manifest-old-spellings.d.ts +64 -0
  45. package/dist/lib/manifest.d.ts +15 -1
  46. package/dist/lib/markdown/assemble.d.ts +4 -3
  47. package/dist/lib/markdown/chapter-id.d.ts +1 -1
  48. package/dist/lib/markdown/index.d.ts +1 -1
  49. package/dist/lib/markdown/table.d.ts +5 -3
  50. package/dist/lib/page-size.d.ts +45 -33
  51. package/dist/lib/pdf-inspect.d.ts +27 -0
  52. package/dist/lib/presets.d.ts +10 -8
  53. package/dist/lib/printsafe.d.ts +2 -1
  54. package/dist/lib/project-scaffold.d.ts +1 -1
  55. package/dist/lib/project-templates.d.ts +9 -0
  56. package/dist/lib/remote-auth/sync-messages.d.ts +2 -2
  57. package/dist/lib/targets.d.ts +4 -4
  58. package/dist/lib/validation-exec.d.ts +4 -4
  59. package/dist/manifest-2kc56wvw.yaml +22 -0
  60. package/dist/manifest-41ddzm13.yaml +18 -0
  61. package/dist/manifest-79zsgkpn.yaml +26 -0
  62. package/dist/manifest-sqzm4681.yaml +22 -0
  63. package/dist/{manifest.schema-t7nx2stg.json → manifest.schema-w86c1xw1.json} +30 -308
  64. package/dist/{new-mhs46pw3.js → new-t2t28ccb.js} +9 -15
  65. package/dist/{package-aenwjew3.json → package-awwkt7sa.json} +0 -1
  66. package/dist/{page-rules-nsj3aw42.css → page-rules-ytj9p04v.css} +12 -40
  67. package/dist/{pdf-inspect-wnw4za71.js → pdf-inspect-b3mf81ex.js} +3 -1
  68. package/dist/{plugin.test.js-xgxrd8hf.tpl → plugin.test.js-gxzqqfdh.tpl} +0 -1
  69. package/dist/{plugins-2cek4mz1.js → plugins-fec8t2bh.js} +1 -1
  70. package/dist/{plugins-1sxe0dkz.js → plugins-sqa4msdk.js} +3 -3
  71. package/dist/{preflight-3k2b1x8e.js → preflight-srq8fktp.js} +8 -8
  72. package/dist/preview/file-watcher.d.ts +1 -3
  73. package/dist/{preview-6p9v6rht.js → preview-zsp9hstd.js} +8 -8
  74. package/dist/{publish-qgsngy8s.js → publish-hhy31gr9.js} +8 -8
  75. package/dist/render.js +30 -562
  76. package/dist/schema/manifest.types.d.ts +60 -105
  77. package/dist/{tokens-7984461t.css → tokens-n82t4k9h.css} +12 -12
  78. package/dist/{validate-0v7xw6wa.js → validate-r9jdz85h.js} +8 -8
  79. package/package.json +1 -1
  80. package/dist/checks/asset/approved-fonts.d.ts +0 -3
  81. package/dist/manifest-eagfhba6.yaml +0 -19
  82. package/dist/manifest-n1gh3qw5.yaml +0 -9
@@ -1,5 +1,17 @@
1
1
  import type { LastPageMode } from "../engine/shared/synthesis";
2
2
  type CheckSeverity = "error" | "warning" | "info";
3
+ /**
4
+ * What a manifest's `checks:` entry may say about one check or lint rule:
5
+ * `off`, or the severity its findings are reported at (`info`, `warn`,
6
+ * `error`). `true` / `on` switch on a check its preset leaves off, at the
7
+ * check's own severity; `false` is `off`. `warning` is accepted for `warn`.
8
+ */
9
+ export type CheckLevelInput = "off" | "on" | "info" | "warn" | "warning" | "error" | boolean;
10
+ /**
11
+ * A check's resolved level: `off`, `on` (runs at its own severity) or the
12
+ * severity every finding is reported at.
13
+ */
14
+ export type CheckLevel = "off" | "on" | CheckSeverity;
3
15
  /**
4
16
  * The object form of an `extensions:` entry (#265) — only for an entry that
5
17
  * has to say more than its specifier. The common case is the bare string;
@@ -88,6 +100,17 @@ interface PublishSettings {
88
100
  format?: "pdf" | "html";
89
101
  };
90
102
  }
103
+ /**
104
+ * Page margins in points: the space between the trim and the text on each
105
+ * edge. `inside` is the binding edge (the left of a right-hand page, the
106
+ * right of a left-hand one), `outside` the other. All four together.
107
+ */
108
+ export interface PageMargin {
109
+ top: number;
110
+ bottom: number;
111
+ inside: number;
112
+ outside: number;
113
+ }
91
114
  export interface GutterpressManifest {
92
115
  title?: string;
93
116
  authors?: string[];
@@ -115,9 +138,17 @@ export interface GutterpressManifest {
115
138
  * project's own `styles` always load after every extension.
116
139
  */
117
140
  extensions?: (string | ExtensionConfig)[];
118
- source?: {
119
- files?: string[] | null;
120
- };
141
+ /**
142
+ * The book's markdown files, in reading order, relative to the manifest.
143
+ * Absent or null: every top-level `.md` file in natural order.
144
+ */
145
+ chapters?: string[] | null;
146
+ /**
147
+ * Per-check and per-rule levels, keyed by a check id
148
+ * (`pdf.print.image-resolution`) or a lint rule id
149
+ * (`printsafe/no-risky-print-effects`). A key that names nothing is ignored.
150
+ */
151
+ checks?: Record<string, CheckLevelInput>;
121
152
  pdfx?: {
122
153
  flavor?: "x1a" | "x3";
123
154
  icc?: string;
@@ -172,7 +203,6 @@ export interface GutterpressManifest {
172
203
  page?: {
173
204
  width?: number;
174
205
  height?: number;
175
- tolerance?: number;
176
206
  /**
177
207
  * A bleed (pt) the page `width` x `height` ALREADY CONTAINS, on the top,
178
208
  * bottom and OUTER edges only (the binding edge has none) — how
@@ -217,82 +247,15 @@ export interface GutterpressManifest {
217
247
  * and `custom` none.
218
248
  */
219
249
  gutter?: number;
220
- };
221
- ink?: {
222
- maxTac?: number;
223
- tacTolerance?: number;
224
- };
225
- lint?: {
226
- enabled?: boolean;
227
- configPath?: string | null;
228
250
  /**
229
- * Per-rule level overrides, keyed by rule id (`printsafe/*`, or a check id
230
- * such as `source.accessibility.heading-order`). `off` silences the rule;
231
- * `warn` / `error` set its severity. Unknown ids are ignored.
251
+ * Page margins (pt), the space between the trim and the text on each
252
+ * edge — `inside` is the binding edge, `outside` the other. Setup >
253
+ * Details in the app writes it. When set, the book prints with these
254
+ * margins and any `@page` margin in a stylesheet is overridden; left
255
+ * out, the stylesheets' `@page` margins apply (a look's design), else
256
+ * 1in. All four edges are required together.
232
257
  */
233
- rules?: Record<string, "off" | "warn" | "error">;
234
- };
235
- validate?: {
236
- enabled?: boolean;
237
- checks?: Record<string, boolean | {
238
- enabled?: boolean;
239
- severity?: CheckSeverity;
240
- options?: Record<string, unknown>;
241
- }>;
242
- source?: {
243
- markdownlint?: string | false;
244
- htmlhint?: string | false;
245
- stylelint?: string | false;
246
- /**
247
- * Path to a CSS ownership contract (#232), or `false` to disable
248
- * `source.css-ownership`. Optional — absent means no contract, so the
249
- * check reports nothing. Default discovery: `.gutterpress/css-contract.yaml`
250
- * (or `.yml`) in the project root. See docs/css-ownership-contract.md.
251
- */
252
- cssOwnership?: string | false;
253
- /**
254
- * @deprecated `:::name` container syntax was removed 2026-05-17 and the
255
- * callout-validation check it gated was removed at the same time. This
256
- * field is now a no-op kept for backward-compatible manifest parsing.
257
- * Will be removed in a future major version. See
258
- * docs/migrations/2026-05-removing-container-syntax.md.
259
- */
260
- allowedCallouts?: string[];
261
- };
262
- assets?: {
263
- maxImageSize?: number;
264
- /**
265
- * @deprecated No-op. The source-image resolution check it configured
266
- * read DPI metadata, which says nothing about the printed size; the
267
- * build measures each placed image's printed DPI instead.
268
- */
269
- minImageDpi?: number;
270
- /**
271
- * @deprecated No-op. The source-image colour-space check it configured
272
- * was removed: a PDF/X build converts every image to the output intent,
273
- * and `pdf.print.color-spaces` checks the result.
274
- */
275
- allowedColorSpaces?: string[];
276
- allowAlpha?: boolean;
277
- approvedFontFiles?: string[];
278
- requireFontLicense?: boolean;
279
- };
280
- pdf?: {
281
- requireBookmarks?: boolean;
282
- requireTocLinks?: boolean;
283
- minImageResolution?: number;
284
- forbidTransparency?: boolean;
285
- requireBleed?: boolean;
286
- bleedSize?: number;
287
- };
288
- heuristics?: {
289
- maxDecorativeLayers?: number;
290
- textDensityRange?: {
291
- min?: number;
292
- max?: number;
293
- };
294
- maxParagraphsPerSection?: number;
295
- };
258
+ margin?: PageMargin;
296
259
  };
297
260
  }
298
261
  export interface ResolvedExtensionConfig {
@@ -335,9 +298,14 @@ export interface ResolvedConfig {
335
298
  styles?: string[];
336
299
  /** Enabled extensions, in manifest (= load = cascade) order. */
337
300
  extensions: ResolvedExtensionConfig[];
338
- source: {
339
- files: string[] | null;
340
- };
301
+ /** The book's markdown files in reading order, or null for every top-level `.md` file. */
302
+ chapters: string[] | null;
303
+ /**
304
+ * Each check's or lint rule's level, merged key by key: preset, then the
305
+ * publish target's policy, then the manifest's `checks:`, then the CLI. An
306
+ * id that is absent runs at its own severity.
307
+ */
308
+ checks: Record<string, CheckLevel>;
341
309
  pdfx: {
342
310
  flavor: "x1a" | "x3";
343
311
  icc: string;
@@ -355,6 +323,7 @@ export interface ResolvedConfig {
355
323
  page: {
356
324
  width: number;
357
325
  height: number;
326
+ /** Allowed deviation (pt) of a built PDF's page size; the preset's, never the manifest's. */
358
327
  tolerance: number;
359
328
  /** In-sheet bleed in pt (top, bottom, outer edge; see the manifest field); absent = none. */
360
329
  bleed?: number;
@@ -364,41 +333,27 @@ export interface ResolvedConfig {
364
333
  artSafe?: number;
365
334
  /** The binding edge's inset from the trim in pt, text and art alike (see the manifest field); absent = same as `safe`. */
366
335
  gutter?: number;
336
+ /** The margins the book prints with, in pt (see the manifest field); absent = the stylesheets' `@page` margins, else 1in. */
337
+ margin?: PageMargin;
367
338
  };
368
339
  ink: {
369
340
  maxTac: number;
370
341
  tacTolerance: number;
371
342
  };
372
- lint: {
373
- enabled: boolean;
374
- configPath: string | null;
375
- rules: Record<string, "off" | "warn" | "error">;
376
- };
343
+ /**
344
+ * The numbers the checks measure against. They come from the preset and
345
+ * the publish target (a printer's specification), not from the manifest:
346
+ * a book switches a check off, or changes how loudly it reports, in
347
+ * `checks:`.
348
+ */
377
349
  validate: {
378
- enabled: boolean;
379
- checks: Record<string, boolean | {
380
- enabled?: boolean;
381
- severity?: CheckSeverity;
382
- options?: Record<string, unknown>;
383
- }>;
384
- source: {
385
- markdownlint: string | false | null;
386
- htmlhint: string | false | null;
387
- stylelint: string | false | null;
388
- cssOwnership: string | false | null;
389
- };
390
350
  assets: {
351
+ /** Largest image file in bytes; 0 = no limit. */
391
352
  maxImageSize: number;
392
- allowAlpha: boolean;
393
- approvedFontFiles: string[];
394
- requireFontLicense: boolean;
395
353
  };
396
354
  pdf: {
397
- requireBookmarks: boolean;
398
- requireTocLinks: boolean;
355
+ /** Lowest effective image resolution in DPI; 0 = no floor. */
399
356
  minImageResolution: number;
400
- forbidTransparency: boolean;
401
- requireBleed: boolean;
402
357
  bleedSize: number;
403
358
  };
404
359
  heuristics: {
@@ -3,20 +3,28 @@
3
3
  *
4
4
  * OWNS
5
5
  * `:root` custom properties, and nothing else. The palette, the type scale,
6
- * the spacing scale, the measure. This is the file a non-technical author
7
- * edits to rebrand the whole book, and the file the desktop app's Design
8
- * panel reads (`package.json` points `gutterpress.tokensFile` here).
6
+ * the spacing scale, the measure. This is the file to edit to rebrand the
7
+ * look. The desktop app's Book setup lists these tokens (the six shared
8
+ * ones under Look, every one under Advanced) and saves a book's changes
9
+ * to that book's own stylesheet, never to this file.
9
10
  *
10
11
  * MUST NOT CONTAIN
11
12
  * - Any selector other than `:root`. The moment a rule here targets `h1`,
12
13
  * "change the brand" and "change the look of a heading" stop being
13
- * separable, and the Design panel starts showing settings that do not
14
+ * separable, and Book setup starts showing settings that do not
14
15
  * do what they say.
15
16
  * - `var()` references to component tokens. Tokens flow one way: brand →
16
17
  * component. A brand token that depends on a component token is a cycle
17
18
  * waiting to happen.
18
19
  * - Anything a specific book needs. Book-specific values go in book.css.
19
20
  *
21
+ * WHAT THE DESIGN TAB SHOWS is curated with comments. Right above one
22
+ * declaration: `@label Accent color` (its plain-words name), `@group Paper`
23
+ * (its heading), `@internal` (not shown). Right above a `:root` selector:
24
+ * `@group` or `@internal` for the whole block, which a declaration's own
25
+ * comment overrides. One `@internal` line above a block of component
26
+ * defaults keeps them off the tab.
27
+ *
20
28
  * LOADS FIRST, and therefore declares the layer order for the whole stack.
21
29
  * ======================================================================== */
22
30
 
@@ -74,13 +82,5 @@
74
82
  --{{PREFIX}}space-2: 0.5em;
75
83
  --{{PREFIX}}space-3: 1em;
76
84
  --{{PREFIX}}space-4: 1.75em;
77
-
78
- /* -- Page geometry ------------------------------------------------- */
79
- /* Consumed by page-rules.css. Kept here so trim size and margins are
80
- editable next to the rest of the brand, not buried in an @page block. */
81
- --{{PREFIX}}page-margin-top: 0.75in;
82
- --{{PREFIX}}page-margin-outer: 0.75in;
83
- --{{PREFIX}}page-margin-bottom: 0.85in;
84
- --{{PREFIX}}page-margin-inner: 0.9in;
85
85
  }
86
86
  }
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  executeAndReport
3
- } from "./cli-xq6djqbj.js";
4
- import"./cli-evg8sbht.js";
3
+ } from "./cli-93mkaw6v.js";
4
+ import"./cli-d9mm3vvh.js";
5
5
  import"./cli-ht1bcqdd.js";
6
- import"./cli-pz4bn98t.js";
7
- import"./cli-2ppw6q9v.js";
6
+ import"./cli-54xt7pjg.js";
7
+ import"./cli-5crpmz42.js";
8
8
  import"./cli-eyyggect.js";
9
9
  import"./cli-asap4t1z.js";
10
10
  import"./cli-a35w7wzg.js";
11
11
  import"./cli-v5mp7a6q.js";
12
- import"./cli-sdmv4bba.js";
13
- import"./cli-pwwfxdgb.js";
12
+ import"./cli-y6d1arem.js";
13
+ import"./cli-rqh295j9.js";
14
14
  import {
15
15
  log
16
- } from "./cli-aqh6brew.js";
16
+ } from "./cli-pspjxnc8.js";
17
17
  import {
18
18
  UsageError,
19
19
  rejectExtraPositionals,
20
20
  rejectUnknownFlags
21
21
  } from "./cli-d8xjns66.js";
22
- import"./cli-kh8v4vvw.js";
22
+ import"./cli-gnpea9dx.js";
23
23
  import {
24
24
  BuildError,
25
25
  EXIT_CODES
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gutterpress",
3
- "version": "0.11.23-alpha.2",
3
+ "version": "0.11.23-alpha.4",
4
4
  "description": "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
5
5
  "author": "itlackey",
6
6
  "license": "MPL-2.0",
@@ -1,3 +0,0 @@
1
- import type { Check } from "../types";
2
- declare const check: Check;
3
- export default check;
@@ -1,19 +0,0 @@
1
- title: "{{TITLE}}"
2
- authors:
3
- - "{{AUTHOR}}"
4
- language: en
5
- source:
6
- files:
7
- - chapter-01.md
8
- styles:
9
- - styles/book.css
10
- # A paper prints on US Letter; for A4 set width 595 and height 842.
11
- page:
12
- width: 612
13
- height: 792
14
- extensions:
15
- - markdown-it-sup
16
- - gutterpress-math
17
- # The built-in academic look. Style over it from styles/book.css.
18
- - academic
19
- preset: book
@@ -1,9 +0,0 @@
1
- title: "{{TITLE}}"
2
- authors:
3
- - "{{AUTHOR}}"
4
- source:
5
- files:
6
- - chapter-01.md
7
- styles:
8
- - styles/book.css
9
- preset: book