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/dist/index.js CHANGED
@@ -139,7 +139,7 @@ import {
139
139
  syncProject,
140
140
  testRemoteAccess,
141
141
  validateProjectExtensions
142
- } from "./index-erwh3bww.js";
142
+ } from "./index-mey5vraz.js";
143
143
  import {
144
144
  BUILD_DIAGNOSTIC_CODES
145
145
  } from "./index-dhgzkhs7.js";
@@ -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-vhdvkqdd.js";
4
+ } from "./cli-8pg731p5.js";
5
5
  import {
6
6
  log
7
- } from "./cli-fwh6rkev.js";
7
+ } from "./cli-ypfvnhag.js";
8
8
  import {
9
9
  UsageError,
10
10
  rejectExtraPositionals,
11
11
  rejectUnknownFlags
12
- } from "./cli-0tgbgwnj.js";
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-vhdvkqdd.js";
10
+ } from "./cli-8pg731p5.js";
11
11
  import {
12
12
  resolveGhostscript
13
- } from "./cli-fwh6rkev.js";
13
+ } from "./cli-ypfvnhag.js";
14
14
  import {
15
15
  UsageError,
16
16
  rejectExtraPositionals,
17
17
  rejectUnknownFlags
18
- } from "./cli-0tgbgwnj.js";
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-vhdvkqdd.js";
5
+ } from "./cli-8pg731p5.js";
6
6
  import {
7
7
  log
8
- } from "./cli-fwh6rkev.js";
8
+ } from "./cli-ypfvnhag.js";
9
9
  import {
10
10
  UsageError,
11
11
  rejectExtraPositionals,
12
12
  rejectUnknownFlags
13
- } from "./cli-0tgbgwnj.js";
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-vhdvkqdd.js";
9
+ } from "./cli-8pg731p5.js";
10
10
  import {
11
11
  log
12
- } from "./cli-fwh6rkev.js";
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-0tgbgwnj.js";
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-vhdvkqdd.js";
14
+ } from "./cli-8pg731p5.js";
15
15
  import {
16
16
  FileTokenStore,
17
17
  log
18
- } from "./cli-fwh6rkev.js";
18
+ } from "./cli-ypfvnhag.js";
19
19
  import {
20
20
  UsageError,
21
21
  rejectExtraPositionals,
22
22
  rejectUnknownFlags
23
- } from "./cli-0tgbgwnj.js";
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-vhdvkqdd.js";
3
+ } from "./cli-8pg731p5.js";
4
4
  import {
5
5
  log
6
- } from "./cli-fwh6rkev.js";
6
+ } from "./cli-ypfvnhag.js";
7
7
  import {
8
8
  UsageError,
9
9
  rejectExtraPositionals,
10
10
  rejectUnknownFlags
11
- } from "./cli-0tgbgwnj.js";
11
+ } from "./cli-rh05byck.js";
12
12
  import"./cli-bx950tb4.js";
13
13
  import"./cli-c41yr7he.js";
14
14
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gutterpress",
3
- "version": "0.10.9-beta.1",
3
+ "version": "0.10.9",
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",