gutterpress 0.10.9-beta.1 → 0.10.9
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 +5 -3
- package/dist/api/index.js +1 -1
- package/dist/{audit-2x958vnj.js → audit-fq7s1gsz.js} +3 -3
- package/dist/{build-dqv3505a.js → build-dyat3fqd.js} +3 -3
- package/dist/checks/source/dangling-links.d.ts +18 -0
- package/dist/checks/source/index.d.ts +1 -0
- package/dist/checks/source/local-ref-parser.d.ts +13 -0
- package/dist/{cli-vhdvkqdd.js → cli-8pg731p5.js} +519 -428
- package/dist/{cli-0tgbgwnj.js → cli-rh05byck.js} +1 -1
- package/dist/{cli-fwh6rkev.js → cli-ypfvnhag.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/{doctor-55r0ghtc.js → doctor-yr85n080.js} +2 -2
- package/dist/{ext-04n7hydk.js → ext-jrg8c48s.js} +3 -3
- package/dist/{index-erwh3bww.js → index-mey5vraz.js} +508 -417
- package/dist/index.js +1 -1
- package/dist/lib/build-staging.d.ts +36 -0
- package/dist/lib/missing-asset-placeholder.d.ts +11 -0
- package/dist/{lint-c7a4j3ww.js → lint-enasqbqx.js} +3 -3
- package/dist/{new-pw3eez61.js → new-r9c99wsn.js} +3 -3
- package/dist/{preflight-77zyws1q.js → preflight-shk7vqbs.js} +3 -3
- package/dist/{preview-x7qqhmxf.js → preview-52918mxk.js} +3 -3
- package/dist/{publish-ms6abf6g.js → publish-8s60vhx7.js} +3 -3
- package/dist/{validate-vw59jcq7.js → validate-awccx32r.js} +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -58,7 +58,43 @@ export declare function stageBookAssets(options: {
|
|
|
58
58
|
cssAssets: AssetCopy[];
|
|
59
59
|
/** Called once with the copy plan; throw here to abort before copying. */
|
|
60
60
|
onPlan?: (plan: StagingPlan) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Strip every relative `<a href>` from the staged book — for print
|
|
63
|
+
* artifacts only, where no relative target can be opened (see
|
|
64
|
+
* {@link dropRelativeLinkHrefs}). Off by default: `--format html` ships its
|
|
65
|
+
* images beside `book.html` and keeps every href.
|
|
66
|
+
*/
|
|
67
|
+
dropRelativeLinks?: boolean;
|
|
61
68
|
}): Promise<StagedAssets>;
|
|
69
|
+
/**
|
|
70
|
+
* Can a PDF reader follow this href? Only an in-document `#fragment` (a GoTo
|
|
71
|
+
* destination) or a URL with a scheme other than `file:`. Everything else —
|
|
72
|
+
* a relative or absolute path, `file:`, and the shapes that name no asset to
|
|
73
|
+
* copy (empty, `?query`, `//host`) — Chromium resolves against the staged
|
|
74
|
+
* document's `file://` base URL, which is dead for every reader.
|
|
75
|
+
*/
|
|
76
|
+
export declare function isPrintResolvableHref(href: string): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Remove the `href` of every `<a>` that {@link isPrintResolvableHref}
|
|
79
|
+
* rejects, keeping the element and its text. Print-production tooling
|
|
80
|
+
* (permanent, not a shim).
|
|
81
|
+
*
|
|
82
|
+
* The staged `book.html` is printed from a `file://` URL in a per-build temp
|
|
83
|
+
* dir (engine/compiler/build.ts navigates `pathToFileURL(input)`), and
|
|
84
|
+
* Chromium writes the ABSOLUTE resolved URL of every relative `href` into
|
|
85
|
+
* the PDF's link annotation: `file:///tmp/gutterpress-build-<random>/docs/
|
|
86
|
+
* constitution.md`. That leaks the build machine's layout, is dead for every
|
|
87
|
+
* reader, and makes two builds of the same sources differ in bytes (#263).
|
|
88
|
+
* A PDF has no files beside it, so NO relative target is openable from one —
|
|
89
|
+
* not a same-book chapter file, not even an image the build copied into the
|
|
90
|
+
* work dir. The href is therefore dropped rather than rewritten.
|
|
91
|
+
* `source.links.dangling` tells the author which links this affects before
|
|
92
|
+
* the build.
|
|
93
|
+
*
|
|
94
|
+
* Comments and raw-text / literal-content elements (a `<pre>` showing HTML)
|
|
95
|
+
* stay untouched — see {@link rewriteActiveHtml}.
|
|
96
|
+
*/
|
|
97
|
+
export declare function dropRelativeLinkHrefs(html: string): string;
|
|
62
98
|
/**
|
|
63
99
|
* Create a unique scratch directory under the OS temp dir. Used only for
|
|
64
100
|
* PDF/X intermediates (`raw.pdf`, Ghostscript work files) — never for staging
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
* while hashing the original output path keeps repeat references deterministic.
|
|
33
33
|
*/
|
|
34
34
|
export declare function placeholderOutputPath(missingOutputPath: string): string;
|
|
35
|
+
/** Decode the small entity set that can occur inside an HTML URL attribute. */
|
|
36
|
+
export declare function decodeHtmlAttribute(value: string): string;
|
|
35
37
|
/**
|
|
36
38
|
* Rewrite missing local image URLs in rendered HTML to their real PNG paths.
|
|
37
39
|
*
|
|
@@ -43,6 +45,15 @@ export declare function placeholderOutputPath(missingOutputPath: string): string
|
|
|
43
45
|
* at the same staged PNG before `inlineShapeUrls()` reads and embeds it.
|
|
44
46
|
*/
|
|
45
47
|
export declare function rewriteMissingImageReferences(html: string, replacements: ReadonlyMap<string, string>): string;
|
|
48
|
+
/**
|
|
49
|
+
* Apply `rewriteTag` to every tag in the ACTIVE parts of rendered HTML.
|
|
50
|
+
* Comments and raw-text / literal-content elements (`<script>`, `<style>`,
|
|
51
|
+
* `<pre>`, `<code>`, `<textarea>`) are opaque to the tag pass — a prose
|
|
52
|
+
* example showing HTML must stay byte-for-byte authored. Each such region is
|
|
53
|
+
* handed whole to `rewriteProtected` with its element name (undefined for a
|
|
54
|
+
* comment), which keeps it unchanged unless the caller says otherwise.
|
|
55
|
+
*/
|
|
56
|
+
export declare function rewriteActiveHtml(html: string, rewriteTag: (tag: string) => string, rewriteProtected?: (region: string, element: string | undefined) => string): string;
|
|
46
57
|
/**
|
|
47
58
|
* Encode a checkerboard PNG of `width`×`height` at `cell` pixels per square.
|
|
48
59
|
* Truecolor (8-bit RGB, no alpha) with filter byte 0 per scanline — the
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MANIFEST_FILENAMES,
|
|
3
3
|
runLint
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-8pg731p5.js";
|
|
5
5
|
import {
|
|
6
6
|
log
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-ypfvnhag.js";
|
|
8
8
|
import {
|
|
9
9
|
UsageError,
|
|
10
10
|
rejectExtraPositionals,
|
|
11
11
|
rejectUnknownFlags
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-rh05byck.js";
|
|
13
13
|
import"./cli-bx950tb4.js";
|
|
14
14
|
import"./cli-c41yr7he.js";
|
|
15
15
|
import {
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
TARGET_IDS,
|
|
8
8
|
scaffoldExtension,
|
|
9
9
|
scaffoldProject
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-8pg731p5.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveGhostscript
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-ypfvnhag.js";
|
|
14
14
|
import {
|
|
15
15
|
UsageError,
|
|
16
16
|
rejectExtraPositionals,
|
|
17
17
|
rejectUnknownFlags
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-rh05byck.js";
|
|
19
19
|
import"./cli-bx950tb4.js";
|
|
20
20
|
import {
|
|
21
21
|
isToolAvailable
|
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
executeValidation,
|
|
3
3
|
publishTargetFor,
|
|
4
4
|
reportMissingTools
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-8pg731p5.js";
|
|
6
6
|
import {
|
|
7
7
|
log
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-ypfvnhag.js";
|
|
9
9
|
import {
|
|
10
10
|
UsageError,
|
|
11
11
|
rejectExtraPositionals,
|
|
12
12
|
rejectUnknownFlags
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-rh05byck.js";
|
|
14
14
|
import"./cli-bx950tb4.js";
|
|
15
15
|
import"./cli-c41yr7he.js";
|
|
16
16
|
import {
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
runBuild,
|
|
7
7
|
splitOutPath,
|
|
8
8
|
startPreviewServer
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-8pg731p5.js";
|
|
10
10
|
import {
|
|
11
11
|
log
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-ypfvnhag.js";
|
|
13
13
|
import {
|
|
14
14
|
UsageError,
|
|
15
15
|
parseFormat,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
rejectExtraPositionals,
|
|
18
18
|
rejectUnknownFlags,
|
|
19
19
|
resolvePort
|
|
20
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-rh05byck.js";
|
|
21
21
|
import"./cli-bx950tb4.js";
|
|
22
22
|
import"./cli-c41yr7he.js";
|
|
23
23
|
import {
|
|
@@ -11,16 +11,16 @@ import {
|
|
|
11
11
|
publishProviderFor,
|
|
12
12
|
resolvePublishFormat,
|
|
13
13
|
runPublish
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-8pg731p5.js";
|
|
15
15
|
import {
|
|
16
16
|
FileTokenStore,
|
|
17
17
|
log
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-ypfvnhag.js";
|
|
19
19
|
import {
|
|
20
20
|
UsageError,
|
|
21
21
|
rejectExtraPositionals,
|
|
22
22
|
rejectUnknownFlags
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-rh05byck.js";
|
|
24
24
|
import"./cli-bx950tb4.js";
|
|
25
25
|
import"./cli-c41yr7he.js";
|
|
26
26
|
import {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAndReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-8pg731p5.js";
|
|
4
4
|
import {
|
|
5
5
|
log
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-ypfvnhag.js";
|
|
7
7
|
import {
|
|
8
8
|
UsageError,
|
|
9
9
|
rejectExtraPositionals,
|
|
10
10
|
rejectUnknownFlags
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-rh05byck.js";
|
|
12
12
|
import"./cli-bx950tb4.js";
|
|
13
13
|
import"./cli-c41yr7he.js";
|
|
14
14
|
import {
|
package/package.json
CHANGED