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.
- package/README.md +10 -13
- package/dist/{README-8ef336pp.md → README-syg2hn83.md} +13 -19
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +5 -5
- package/dist/{build-encgnv0c.js → build-c48eer6f.js} +8 -8
- package/dist/checks/asset/extensions.d.ts +1 -1
- package/dist/checks/asset/index.d.ts +0 -1
- package/dist/checks/policy.d.ts +5 -4
- package/dist/checks/source/config-file.d.ts +9 -6
- package/dist/checks/source/dangling-links.d.ts +1 -1
- package/dist/checks/types.d.ts +2 -2
- package/dist/{cli-pz4bn98t.js → cli-54xt7pjg.js} +19 -13
- package/dist/{index-2ppw6q9v.js → cli-5crpmz42.js} +80 -1
- package/dist/{cli-xq6djqbj.js → cli-93mkaw6v.js} +166 -308
- package/dist/{cli-evg8sbht.js → cli-d9mm3vvh.js} +7 -2
- package/dist/{cli-kh8v4vvw.js → cli-gnpea9dx.js} +1 -1
- package/dist/{cli-aqh6brew.js → cli-pspjxnc8.js} +1 -1
- package/dist/{cli-pwwfxdgb.js → cli-rqh295j9.js} +15 -21
- package/dist/{index-x3ema2w3.js → cli-y6d1arem.js} +321 -272
- package/dist/cli.js +12 -12
- package/dist/{doctor-5gtpgpd1.js → doctor-ptb346k8.js} +4 -3
- package/dist/engine/shared/gcpm-extract.d.ts +8 -0
- package/dist/engine/shared/print-area.d.ts +16 -4
- package/dist/{engine-mc5br8g8.js → engine-4rzdx6af.js} +1 -1
- package/dist/{engine-tn13gk0b.js → engine-6txhxmmv.js} +2 -2
- package/dist/{ext-wn2a5afq.js → ext-gy8szg3x.js} +8 -8
- package/dist/{extension-restore-s3x1618g.js → extension-restore-dymzcasz.js} +2 -2
- package/dist/{extension-restore-g8jnmmzq.js → extension-restore-m8tj43e7.js} +4 -4
- package/dist/{gutterpress-viewer-701vf4qp.js → gutterpress-viewer-mafsby5k.js} +9 -2
- package/dist/{cli-2ppw6q9v.js → index-5crpmz42.js} +80 -1
- package/dist/{index-0skhjx3e.js → index-5kh4c78h.js} +19 -13
- package/dist/{index-2bjcghze.js → index-8ywkd2sv.js} +15 -21
- package/dist/{index-j5z86r4a.js → index-ea94zbq4.js} +329 -488
- package/dist/{cli-sdmv4bba.js → index-kaks3mm2.js} +448 -156
- package/dist/{index-4x6y8krm.js → index-yc3xj266.js} +1 -1
- package/dist/index.js +6 -6
- package/dist/lib/build-preflight.d.ts +4 -10
- package/dist/lib/build-runner.d.ts +1 -1
- package/dist/lib/extension-manager.d.ts +8 -7
- package/dist/lib/extension-manifest.d.ts +1 -13
- package/dist/lib/ghostscript.d.ts +5 -2
- package/dist/lib/lint-rules.d.ts +5 -1
- package/dist/lib/manifest-config.d.ts +3 -2
- package/dist/lib/manifest-old-spellings.d.ts +64 -0
- package/dist/lib/manifest.d.ts +15 -1
- package/dist/lib/markdown/assemble.d.ts +4 -3
- package/dist/lib/markdown/chapter-id.d.ts +1 -1
- package/dist/lib/markdown/index.d.ts +1 -1
- package/dist/lib/markdown/table.d.ts +5 -3
- package/dist/lib/page-size.d.ts +45 -33
- package/dist/lib/pdf-inspect.d.ts +27 -0
- package/dist/lib/presets.d.ts +10 -8
- package/dist/lib/printsafe.d.ts +2 -1
- package/dist/lib/project-scaffold.d.ts +1 -1
- package/dist/lib/project-templates.d.ts +9 -0
- package/dist/lib/remote-auth/sync-messages.d.ts +2 -2
- package/dist/lib/targets.d.ts +4 -4
- package/dist/lib/validation-exec.d.ts +4 -4
- package/dist/manifest-2kc56wvw.yaml +22 -0
- package/dist/manifest-41ddzm13.yaml +18 -0
- package/dist/manifest-79zsgkpn.yaml +26 -0
- package/dist/manifest-sqzm4681.yaml +22 -0
- package/dist/{manifest.schema-t7nx2stg.json → manifest.schema-w86c1xw1.json} +30 -308
- package/dist/{new-mhs46pw3.js → new-t2t28ccb.js} +9 -15
- package/dist/{package-aenwjew3.json → package-awwkt7sa.json} +0 -1
- package/dist/{page-rules-nsj3aw42.css → page-rules-ytj9p04v.css} +12 -40
- package/dist/{pdf-inspect-wnw4za71.js → pdf-inspect-b3mf81ex.js} +3 -1
- package/dist/{plugin.test.js-xgxrd8hf.tpl → plugin.test.js-gxzqqfdh.tpl} +0 -1
- package/dist/{plugins-2cek4mz1.js → plugins-fec8t2bh.js} +1 -1
- package/dist/{plugins-1sxe0dkz.js → plugins-sqa4msdk.js} +3 -3
- package/dist/{preflight-3k2b1x8e.js → preflight-srq8fktp.js} +8 -8
- package/dist/preview/file-watcher.d.ts +1 -3
- package/dist/{preview-6p9v6rht.js → preview-zsp9hstd.js} +8 -8
- package/dist/{publish-qgsngy8s.js → publish-hhy31gr9.js} +8 -8
- package/dist/render.js +30 -562
- package/dist/schema/manifest.types.d.ts +60 -105
- package/dist/{tokens-7984461t.css → tokens-n82t4k9h.css} +12 -12
- package/dist/{validate-0v7xw6wa.js → validate-r9jdz85h.js} +8 -8
- package/package.json +1 -1
- package/dist/checks/asset/approved-fonts.d.ts +0 -3
- package/dist/manifest-eagfhba6.yaml +0 -19
- package/dist/manifest-n1gh3qw5.yaml +0 -9
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pagesWithVisibleShadingPaints
|
|
3
|
+
} from "./cli-5crpmz42.js";
|
|
1
4
|
import {
|
|
2
5
|
enhancedPath,
|
|
3
6
|
execCapture,
|
|
@@ -11,7 +14,7 @@ import {
|
|
|
11
14
|
import {
|
|
12
15
|
PACKAGE_VERSION,
|
|
13
16
|
log
|
|
14
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-pspjxnc8.js";
|
|
15
18
|
import {
|
|
16
19
|
__require
|
|
17
20
|
} from "./cli-37x76zdn.js";
|
|
@@ -189,7 +192,9 @@ async function findPostScriptShadingPages(pdfBytes) {
|
|
|
189
192
|
if (usesPostScriptShading(asDict(page.node.Resources())))
|
|
190
193
|
pages.push(i + 1);
|
|
191
194
|
});
|
|
192
|
-
|
|
195
|
+
if (pages.length === 0)
|
|
196
|
+
return pages;
|
|
197
|
+
return pagesWithVisibleShadingPaints(pdfBytes, pages).catch(() => pages);
|
|
193
198
|
}
|
|
194
199
|
async function stripAnnotations(pdfPath, stagingDir) {
|
|
195
200
|
const tmp = join(stagingDir, "annotations-stripped.pdf");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "gutterpress",
|
|
4
|
-
version: "0.11.23-alpha.
|
|
4
|
+
version: "0.11.23-alpha.4",
|
|
5
5
|
description: "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
|
|
6
6
|
author: "itlackey",
|
|
7
7
|
license: "MPL-2.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PACKAGE_VERSION,
|
|
3
3
|
debug
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-pspjxnc8.js";
|
|
5
5
|
import {
|
|
6
6
|
isExactNpmVersion,
|
|
7
7
|
isValidNpmPackageName,
|
|
@@ -24,6 +24,7 @@ import { pathToFileURL } from "node:url";
|
|
|
24
24
|
var theme_default = `/* =============================================================================
|
|
25
25
|
Clean Book — gutterpress built-in theme (theme.css)
|
|
26
26
|
A calm, classic long-form book look. Change the :root tokens from the book's own stylesheet.
|
|
27
|
+
The page SIZE comes from the manifest (Setup > Book), so it is deliberately not set here.
|
|
27
28
|
============================================================================= */
|
|
28
29
|
|
|
29
30
|
:root {
|
|
@@ -42,11 +43,7 @@ var theme_default = `/* ========================================================
|
|
|
42
43
|
--fs-h2: 1.5rem;
|
|
43
44
|
--fs-h3: 1.2rem;
|
|
44
45
|
--leading: 1.55;
|
|
45
|
-
}
|
|
46
46
|
|
|
47
|
-
@page {
|
|
48
|
-
size: 6in 9in;
|
|
49
|
-
margin: 0.85in 0.75in;
|
|
50
47
|
}
|
|
51
48
|
|
|
52
49
|
body {
|
|
@@ -86,6 +83,7 @@ hr { border: 0; border-top: 1px solid var(--color-rule); margin: 1.5em 0; }
|
|
|
86
83
|
var theme_default2 = `/* =============================================================================
|
|
87
84
|
Zine — gutterpress built-in theme (theme.css)
|
|
88
85
|
High-contrast, punchy, photocopier-friendly. Change the :root tokens from the book's own stylesheet.
|
|
86
|
+
The page SIZE comes from the manifest (Setup > Book), so it is deliberately not set here.
|
|
89
87
|
============================================================================= */
|
|
90
88
|
|
|
91
89
|
:root {
|
|
@@ -104,11 +102,7 @@ var theme_default2 = `/* =======================================================
|
|
|
104
102
|
--fs-h2: 1.8rem;
|
|
105
103
|
--fs-h3: 1.3rem;
|
|
106
104
|
--leading: 1.4;
|
|
107
|
-
}
|
|
108
105
|
|
|
109
|
-
@page {
|
|
110
|
-
size: 5.5in 8.5in;
|
|
111
|
-
margin: 0.4in;
|
|
112
106
|
}
|
|
113
107
|
|
|
114
108
|
body {
|
|
@@ -150,6 +144,7 @@ code, pre { font-family: var(--font-mono); font-size: 0.95em; }
|
|
|
150
144
|
var theme_default3 = `/* =============================================================================
|
|
151
145
|
Technical Document — gutterpress built-in theme (theme.css)
|
|
152
146
|
Clean sans-serif manual look with clear hierarchy. Change the :root tokens from the book's own stylesheet.
|
|
147
|
+
The page SIZE comes from the manifest (Setup > Book), so it is deliberately not set here.
|
|
153
148
|
============================================================================= */
|
|
154
149
|
|
|
155
150
|
:root {
|
|
@@ -157,6 +152,7 @@ var theme_default3 = `/* =======================================================
|
|
|
157
152
|
--color-ink-muted: #5a5f66; /* captions, secondary text */
|
|
158
153
|
--color-accent: #0b5fff; /* headings, links */
|
|
159
154
|
--color-paper: #ffffff; /* page background */
|
|
155
|
+
/* @label Note and code background */
|
|
160
156
|
--color-tint: #f3f5f9; /* code / note fill */
|
|
161
157
|
--color-rule: #d6dae0; /* borders, rules */
|
|
162
158
|
|
|
@@ -169,11 +165,7 @@ var theme_default3 = `/* =======================================================
|
|
|
169
165
|
--fs-h2: 1.45rem;
|
|
170
166
|
--fs-h3: 1.15rem;
|
|
171
167
|
--leading: 1.5;
|
|
172
|
-
}
|
|
173
168
|
|
|
174
|
-
@page {
|
|
175
|
-
size: 8.5in 11in;
|
|
176
|
-
margin: 0.9in 1in;
|
|
177
169
|
}
|
|
178
170
|
|
|
179
171
|
body {
|
|
@@ -246,10 +238,10 @@ var theme_default4 = `/* =======================================================
|
|
|
246
238
|
--fs-h2: 1.2em;
|
|
247
239
|
--fs-h3: 1em;
|
|
248
240
|
--leading: 1.38;
|
|
241
|
+
|
|
249
242
|
}
|
|
250
243
|
|
|
251
244
|
@page {
|
|
252
|
-
margin: 1in;
|
|
253
245
|
@bottom-center { content: counter(page); font-family: var(--font-body); font-size: 9pt; }
|
|
254
246
|
}
|
|
255
247
|
|
|
@@ -433,7 +425,6 @@ function metaFromPackageJson(raw) {
|
|
|
433
425
|
...str(object(pkg.engines)?.gutterpress) ? { gutterpressRange: str(object(pkg.engines)?.gutterpress) } : {},
|
|
434
426
|
..."preview" in gp ? { preview: str(gp.preview) ?? null } : {},
|
|
435
427
|
...Array.isArray(gp.styles) ? { styles: declaredList(gp.styles) } : {},
|
|
436
|
-
...str(gp.tokensFile) ? { tokensFile: str(gp.tokensFile) } : {},
|
|
437
428
|
...str(gp.markdown) ? { markdown: str(gp.markdown) } : {},
|
|
438
429
|
...str(gp.components) ? { components: str(gp.components) } : {},
|
|
439
430
|
...str(gp.snippets) ? { snippets: str(gp.snippets) } : {},
|
|
@@ -499,8 +490,7 @@ function assertExtensionContained(meta) {
|
|
|
499
490
|
...entry ? [entry] : [],
|
|
500
491
|
...meta.publish && meta.main?.trim() ? [meta.main.trim()] : [],
|
|
501
492
|
...meta.components ? [meta.components] : [],
|
|
502
|
-
...meta.snippets ? [meta.snippets] : []
|
|
503
|
-
...meta.tokensFile ? [meta.tokensFile] : []
|
|
493
|
+
...meta.snippets ? [meta.snippets] : []
|
|
504
494
|
];
|
|
505
495
|
for (const rel of declared) {
|
|
506
496
|
if (pathEscapesFolder(rel)) {
|
|
@@ -517,7 +507,6 @@ function resolveExtension(dir, meta, subject) {
|
|
|
517
507
|
return {
|
|
518
508
|
...markdown ? { markdown } : {},
|
|
519
509
|
...styles ? { styles } : {},
|
|
520
|
-
...meta.tokensFile?.trim() ? { tokensFile: meta.tokensFile.trim() } : {},
|
|
521
510
|
...components ? { components } : {},
|
|
522
511
|
...snippets ? { snippets } : {}
|
|
523
512
|
};
|
|
@@ -2346,7 +2335,12 @@ function splitCells(str2, spans) {
|
|
|
2346
2335
|
lastPos = pos;
|
|
2347
2336
|
}
|
|
2348
2337
|
} else if (!isEscaped && spans[ch]) {
|
|
2349
|
-
|
|
2338
|
+
const end = spans[ch](str2, pos, max);
|
|
2339
|
+
if (ch === 96) {
|
|
2340
|
+
current += str2.substring(lastPos, pos) + str2.substring(pos, end).replace(/\\\|/g, "|");
|
|
2341
|
+
lastPos = end;
|
|
2342
|
+
}
|
|
2343
|
+
pos = end;
|
|
2350
2344
|
continue;
|
|
2351
2345
|
}
|
|
2352
2346
|
isEscaped = ch === 92;
|
|
@@ -3581,9 +3575,9 @@ async function loadNpmPackage(packageName, baseDir, version) {
|
|
|
3581
3575
|
const looksLikeJsFilename = /\.(m?js|cjs)$/i.test(packageName);
|
|
3582
3576
|
const suggestedPath = looksLikeJsFilename ? `./${packageName}` : `./plugins/${packageName}.js`;
|
|
3583
3577
|
if (!looksLikeJsFilename && (!version || !isExactNpmVersion(version))) {
|
|
3584
|
-
throw new Error(`Extension "${packageName}${version ? `@${version}` : ""}" is not pinned to an exact version, so it can't be downloaded automatically. Run \`gutterpress ext add ${packageName}\` (or use Book
|
|
3578
|
+
throw new Error(`Extension "${packageName}${version ? `@${version}` : ""}" is not pinned to an exact version, so it can't be downloaded automatically. Run \`gutterpress ext add ${packageName}\` (or use Book setup > Advanced in the desktop app) to download it and pin its version in your manifest.`);
|
|
3585
3579
|
}
|
|
3586
|
-
throw new Error(`Extension "${packageName}" not found. Install it with \`gutterpress ext add ${version ? `${packageName}@${version}` : packageName}\` (or Book
|
|
3580
|
+
throw new Error(`Extension "${packageName}" not found. Install it with \`gutterpress ext add ${version ? `${packageName}@${version}` : packageName}\` (or Book setup > Advanced in the desktop app),
|
|
3587
3581
|
or reference a local file under \`extensions:\`:
|
|
3588
3582
|
extensions:
|
|
3589
3583
|
- ${suggestedPath}`);
|