gutterpress 0.10.11 → 0.11.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.
- package/README.md +1 -1
- package/dist/{README-7x5akcns.md → README-3nj919rm.md} +10 -8
- package/dist/{README-3zk4tgnj.md → README-8b33qbjw.md} +14 -21
- package/dist/api/index.js +2 -2
- package/dist/{audit-ebbbhpx7.js → audit-9vv4ncjv.js} +4 -4
- package/dist/{build-zrajk3s2.js → build-ea05bvs0.js} +4 -4
- package/dist/{cli-gxq7yz5f.js → cli-6gg8vwaj.js} +1 -1
- package/dist/{cli-hz44te1m.js → cli-cwv73tkx.js} +1426 -1405
- package/dist/{cli-k8f9eb12.js → cli-sekhwex4.js} +5 -5
- package/dist/{cli-36r50yr3.js → cli-y4vrycpn.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/{doctor-78qft9g7.js → doctor-k529b5et.js} +2 -2
- package/dist/{engine-qtmvaqt7.js → engine-cbc17ne4.js} +1 -1
- package/dist/{engine-pt2acjb5.js → engine-w5ed5hmb.js} +2 -2
- package/dist/{ext-3g1mk8mb.js → ext-hbt1sdg5.js} +4 -4
- package/dist/{index-a0e2253t.js → index-12pvhbyz.js} +1 -1
- package/dist/{index-5dgxeevv.js → index-6n15e1ze.js} +5 -5
- package/dist/{index-03cqyyyk.js → index-qmvmvetj.js} +1764 -1748
- package/dist/index.js +3 -3
- package/dist/lib/markdown/index.d.ts +8 -16
- package/dist/lib/markdown/plugins.d.ts +9 -4
- package/dist/lib/markdown/renderer.d.ts +18 -0
- package/dist/lib/project-scaffold.d.ts +1 -1
- package/dist/{lint-va95zh6j.js → lint-cwb6h2n5.js} +4 -4
- package/dist/{new-3ex11eyq.js → new-sja9wn5c.js} +4 -4
- package/dist/plugin-spbcem4j.css +103 -0
- package/dist/{plugin.test.js-k2r87k04.tpl → plugin.test.js-nw7c84s6.tpl} +5 -6
- package/dist/{preflight-q8w6dnjh.js → preflight-maw8h45k.js} +4 -4
- package/dist/{preview-azatsrtp.js → preview-vjwpj4tf.js} +4 -4
- package/dist/{publish-5tqzepkb.js → publish-spej40gd.js} +4 -4
- package/dist/render.js +1 -1
- package/dist/{tokens-2sracx1w.css → tokens-7984461t.css} +8 -8
- package/dist/{validate-rp613ejg.js → validate-3ppsdngq.js} +4 -4
- package/package.json +1 -1
- package/dist/plugin-m2w7g47v.css +0 -114
package/dist/index.js
CHANGED
|
@@ -143,15 +143,15 @@ import {
|
|
|
143
143
|
syncProject,
|
|
144
144
|
testRemoteAccess,
|
|
145
145
|
validateProjectExtensions
|
|
146
|
-
} from "./index-
|
|
146
|
+
} from "./index-qmvmvetj.js";
|
|
147
147
|
import {
|
|
148
148
|
BUILD_DIAGNOSTIC_CODES
|
|
149
|
-
} from "./index-
|
|
149
|
+
} from "./index-12pvhbyz.js";
|
|
150
150
|
import {
|
|
151
151
|
BuildError,
|
|
152
152
|
DEFAULT_PRINT_OPTS,
|
|
153
153
|
readyProbeExpr
|
|
154
|
-
} from "./index-
|
|
154
|
+
} from "./index-6n15e1ze.js";
|
|
155
155
|
import {
|
|
156
156
|
AUTO_SNAPSHOT_MESSAGE,
|
|
157
157
|
HISTORY_PAGE_LIMIT,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LayoutWarning } from "./assemble";
|
|
2
2
|
import { type AssetCopy } from "../asset-inline";
|
|
3
|
-
import type { LoadedPlugin } from "./renderer";
|
|
3
|
+
import type { LoadedPlugin, PluginStyleGroup } from "./renderer";
|
|
4
4
|
export type { LayoutWarning } from "./assemble";
|
|
5
5
|
/**
|
|
6
6
|
* THE canonical "which markdown files make up this book, and in what order?"
|
|
@@ -36,21 +36,14 @@ export declare function renderChapters(inputDir: string, opts?: {
|
|
|
36
36
|
styles?: string[];
|
|
37
37
|
files?: string[] | null;
|
|
38
38
|
plugins?: LoadedPlugin[];
|
|
39
|
-
pluginCss?: string;
|
|
40
39
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
40
|
+
* Each extension's CSS (`loadPluginsWithCss`'s `pluginStyles`), in
|
|
41
|
+
* `extensions:` list order. Every group is inlined through the SAME
|
|
42
|
+
* pipeline as the project's own stylesheets (`inlineStyles`: fonts and
|
|
44
43
|
* images embedded, local `@import` followed, print-safety lintable) and
|
|
45
|
-
*
|
|
46
|
-
* already holds — after core, before the project's own stylesheets.
|
|
47
|
-
* Absolute paths pass through `inlineStyles` unchanged (`path.resolve` is
|
|
48
|
-
* a no-op on an already-absolute input), so a plugin's stylesheet
|
|
49
|
-
* location is independent of `inputDir`. Omitting this (existing
|
|
50
|
-
* string-only-`css` plugins, or none at all) is a zero-cost, byte-
|
|
51
|
-
* identical no-op — see the test asserting exactly that.
|
|
44
|
+
* wrapped in its own cascade layer — see the block below.
|
|
52
45
|
*/
|
|
53
|
-
|
|
46
|
+
pluginStyles?: PluginStyleGroup[];
|
|
54
47
|
/** Wrap each source file for incremental preview pagination. */
|
|
55
48
|
wrapChapters?: boolean;
|
|
56
49
|
/** Add source-file ids to source-mapped preview blocks without wrappers. */
|
|
@@ -83,9 +76,8 @@ export declare function renderChaptersToFile(inputDir: string, outDir: string, o
|
|
|
83
76
|
styles?: string[];
|
|
84
77
|
files?: string[] | null;
|
|
85
78
|
plugins?: LoadedPlugin[];
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
pluginStylePaths?: string[];
|
|
79
|
+
/** See {@link renderChapters}'s option of the same name. */
|
|
80
|
+
pluginStyles?: PluginStyleGroup[];
|
|
89
81
|
/** ARCH finding #4 — see {@link renderChapters}'s option of the same name. */
|
|
90
82
|
onChapterWarnings?: (file: string, warnings: LayoutWarning[]) => void;
|
|
91
83
|
/** See {@link renderChapters}'s options of the same names. */
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ResolvedExtensionConfig } from "../../schema/manifest.types";
|
|
2
2
|
import type { LoadedPlugin } from "./renderer";
|
|
3
3
|
export type { GutterpressMarkerDeclaration, GutterpressMarkerLabel, GutterpressMarkerTable, GutterpressPlugin, GutterpressPluginMetadata, GutterpressPluginExport, LoadedPlugin, } from "./renderer";
|
|
4
|
-
export { applyPlugins, collectPluginCss, collectPluginStylePaths } from "./renderer";
|
|
4
|
+
export { applyPlugins, collectPluginCss, collectPluginStylePaths, collectPluginStyleGroups } from "./renderer";
|
|
5
|
+
export type { PluginStyleGroup } from "./renderer";
|
|
6
|
+
import { type PluginStyleGroup } from "./renderer";
|
|
5
7
|
/** Test-only mutation seam between snapshot completion and snapshot verification. */
|
|
6
8
|
export declare function __setVendorSnapshotHookForTests(hook?: (sourceRoot: string, snapshotRoot: string) => void | Promise<void>): void;
|
|
7
9
|
export declare function clearVendoredPluginResolver(baseDir: string, packageName: string, version: string): void;
|
|
@@ -32,13 +34,16 @@ export declare function loadPlugin(config: ResolvedExtensionConfig, baseDir: str
|
|
|
32
34
|
*/
|
|
33
35
|
export declare function loadPlugins(configs: ResolvedExtensionConfig[], baseDir: string, onError?: (pluginRef: string, error: Error) => void): Promise<LoadedPlugin[]>;
|
|
34
36
|
/** Result of {@link loadPluginsWithCss}: loaded plugins ready for `applyPlugins`
|
|
35
|
-
* plus their
|
|
37
|
+
* plus their CSS, grouped per extension for the renderer. */
|
|
36
38
|
export interface LoadedPluginsWithCss {
|
|
37
39
|
/** `undefined` (not `[]`) when there were no configs to load — matches the
|
|
38
40
|
* `plugins?:` field the renderer options expect, so callers can pass this
|
|
39
41
|
* straight through without an `?? []` at every call site. */
|
|
40
42
|
plugins: LoadedPlugin[] | undefined;
|
|
41
|
-
|
|
43
|
+
/** Each extension's CSS — its stylesheet files and `css` export — in load
|
|
44
|
+
* order, each destined for its own cascade layer (`renderChapters`). `[]`
|
|
45
|
+
* when no loaded plugin has any. */
|
|
46
|
+
pluginStyles: PluginStyleGroup[];
|
|
42
47
|
/**
|
|
43
48
|
* #238 — absolute paths of every plugin-declared `styles` file, flattened
|
|
44
49
|
* in plugin load order. `[]` when no loaded plugin declares any (including
|
|
@@ -58,7 +63,7 @@ export interface LoadedPluginsWithCss {
|
|
|
58
63
|
* wiring around it.
|
|
59
64
|
*
|
|
60
65
|
* A `configs` of `undefined`/empty short-circuits WITHOUT calling
|
|
61
|
-
* `loadPlugins` at all (`plugins: undefined`, `
|
|
66
|
+
* `loadPlugins` at all (`plugins: undefined`, `pluginStyles: []`) — matching
|
|
62
67
|
* both call sites' prior behavior of never plugin-loading when the manifest
|
|
63
68
|
* declares no plugins.
|
|
64
69
|
*/
|
|
@@ -260,3 +260,21 @@ export declare function collectPluginCss(plugins: LoadedPlugin[]): string;
|
|
|
260
260
|
* files are actually read.
|
|
261
261
|
*/
|
|
262
262
|
export declare function collectPluginStylePaths(plugins: LoadedPlugin[]): string[];
|
|
263
|
+
/** One extension's CSS, ready for its own cascade layer in the built document. */
|
|
264
|
+
export interface PluginStyleGroup {
|
|
265
|
+
/** The extension's name, for the comment above its block. */
|
|
266
|
+
name: string;
|
|
267
|
+
/** Its cascade layer, `ext.<slug>`, unique within the book. */
|
|
268
|
+
layer: string;
|
|
269
|
+
/** Absolute paths of its stylesheet files, in declared order. */
|
|
270
|
+
paths: string[];
|
|
271
|
+
/** Its `css` string export, placed after the files. */
|
|
272
|
+
css?: string;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Group every plugin's CSS by plugin, in load order, and name each group's
|
|
276
|
+
* cascade layer after the plugin. The renderer wraps each group in that
|
|
277
|
+
* layer, so `extensions:` list order IS the cascade order whatever an
|
|
278
|
+
* extension's own CSS does. Plugins with no CSS are left out.
|
|
279
|
+
*/
|
|
280
|
+
export declare function collectPluginStyleGroups(plugins: LoadedPlugin[]): PluginStyleGroup[];
|
|
@@ -134,7 +134,7 @@ export interface AdoptFolderOptions {
|
|
|
134
134
|
title?: string;
|
|
135
135
|
/** Author display name. Optional. */
|
|
136
136
|
author?: string;
|
|
137
|
-
/** Template whose starter
|
|
137
|
+
/** Template whose starter chapter is used. Defaults to `"book"`. */
|
|
138
138
|
template?: ProjectTemplateId;
|
|
139
139
|
/** Version-history mode. Defaults to `"local-git"`. */
|
|
140
140
|
versionHistory?: ProjectVersionHistoryMode;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MANIFEST_FILENAMES,
|
|
3
3
|
runLint
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-cwv73tkx.js";
|
|
5
5
|
import {
|
|
6
6
|
log
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-y4vrycpn.js";
|
|
8
8
|
import {
|
|
9
9
|
UsageError,
|
|
10
10
|
rejectExtraPositionals,
|
|
11
11
|
rejectUnknownFlags
|
|
12
|
-
} from "./cli-
|
|
13
|
-
import"./cli-
|
|
12
|
+
} from "./cli-6gg8vwaj.js";
|
|
13
|
+
import"./cli-sekhwex4.js";
|
|
14
14
|
import"./cli-c41yr7he.js";
|
|
15
15
|
import {
|
|
16
16
|
EXIT_CODES
|
|
@@ -7,16 +7,16 @@ import {
|
|
|
7
7
|
TARGET_IDS,
|
|
8
8
|
scaffoldExtension,
|
|
9
9
|
scaffoldProject
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-cwv73tkx.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveGhostscript
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-y4vrycpn.js";
|
|
14
14
|
import {
|
|
15
15
|
UsageError,
|
|
16
16
|
rejectExtraPositionals,
|
|
17
17
|
rejectUnknownFlags
|
|
18
|
-
} from "./cli-
|
|
19
|
-
import"./cli-
|
|
18
|
+
} from "./cli-6gg8vwaj.js";
|
|
19
|
+
import"./cli-sekhwex4.js";
|
|
20
20
|
import {
|
|
21
21
|
isToolAvailable
|
|
22
22
|
} from "./cli-c41yr7he.js";
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/* ===========================================================================
|
|
2
|
+
* {{NAME}} — component stylesheet
|
|
3
|
+
*
|
|
4
|
+
* OWNS
|
|
5
|
+
* The look of everything `plugin.js` emits: the `@term-box` container, its
|
|
6
|
+
* variants and label, and the `[[key term]]` inline span. Every one of
|
|
7
|
+
* those looks is driven by a PUBLIC custom property declared at `:root`
|
|
8
|
+
* below, so a book can retune this component without touching this file.
|
|
9
|
+
*
|
|
10
|
+
* MUST NOT CONTAIN
|
|
11
|
+
* - `@page` rules or page geometry. A plugin styles its own components; the
|
|
12
|
+
* book's theme owns the page.
|
|
13
|
+
* - Bare element selectors (`p`, `table`, `h2`). They would leak this
|
|
14
|
+
* plugin's opinions into every book that installs it. Scope every rule
|
|
15
|
+
* under a `{{PREFIX}}` class.
|
|
16
|
+
* - Any `gp-` class. That prefix is Gutterpress core's.
|
|
17
|
+
* - Per-book values. Ship sane defaults; let the book override the tokens.
|
|
18
|
+
*
|
|
19
|
+
* THE CASCADE
|
|
20
|
+
* Gutterpress wraps this whole extension's CSS in a cascade layer of its
|
|
21
|
+
* own (`@layer ext.<name>`), in `extensions:` list order, before the book's
|
|
22
|
+
* own stylesheets — so there is nothing to do here. The book's unlayered
|
|
23
|
+
* rules beat every rule below at any specificity, which is right: a plugin
|
|
24
|
+
* should always be the easiest thing in the book to override. Against a
|
|
25
|
+
* look, the manifest's list order decides.
|
|
26
|
+
* ======================================================================== */
|
|
27
|
+
|
|
28
|
+
/* -----------------------------------------------------------------------
|
|
29
|
+
* PUBLIC TOKENS — this component's entire theming surface.
|
|
30
|
+
*
|
|
31
|
+
* Declared at `:root` with real defaults so the component looks right in
|
|
32
|
+
* any book with no setup at all. A book retunes it by resetting these in
|
|
33
|
+
* its own CSS — either globally, or scoped to one chapter/page/section:
|
|
34
|
+
*
|
|
35
|
+
* #ch-appendix { --{{PREFIX}}term-box-accent: #7a1f1f; }
|
|
36
|
+
*
|
|
37
|
+
* Rules below consume them as BARE `var(--x)`, never `var(--x, fallback)`:
|
|
38
|
+
* the default lives at `:root` exactly once, so there is one place to look
|
|
39
|
+
* and no second copy to drift.
|
|
40
|
+
* -------------------------------------------------------------------- */
|
|
41
|
+
:root {
|
|
42
|
+
--{{PREFIX}}term-box-accent: #2f5d8a;
|
|
43
|
+
--{{PREFIX}}term-box-bg: #f2f6fa;
|
|
44
|
+
--{{PREFIX}}term-box-ink: inherit;
|
|
45
|
+
--{{PREFIX}}term-box-pad: 0.6em 0.9em;
|
|
46
|
+
--{{PREFIX}}term-box-rule: 3px;
|
|
47
|
+
--{{PREFIX}}term-box-label-size: 0.78em;
|
|
48
|
+
--{{PREFIX}}term-box-label-tracking: 0.08em;
|
|
49
|
+
--{{PREFIX}}term-ink: #2f5d8a;
|
|
50
|
+
--{{PREFIX}}term-weight: 600;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* -----------------------------------------------------------------------
|
|
54
|
+
* The container emitted by `@term-box` (plugin.js's `markers` table).
|
|
55
|
+
* -------------------------------------------------------------------- */
|
|
56
|
+
.{{PREFIX}}term-box {
|
|
57
|
+
background: var(--{{PREFIX}}term-box-bg);
|
|
58
|
+
border-left: var(--{{PREFIX}}term-box-rule) solid var(--{{PREFIX}}term-box-accent);
|
|
59
|
+
color: var(--{{PREFIX}}term-box-ink);
|
|
60
|
+
padding: var(--{{PREFIX}}term-box-pad);
|
|
61
|
+
/* Print hygiene: a callout that splits across a page break reads badly,
|
|
62
|
+
and a two-line orphan reads worse. Both are the component's business,
|
|
63
|
+
not the book's. */
|
|
64
|
+
break-inside: avoid;
|
|
65
|
+
margin-block: 1em;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.{{PREFIX}}term-box > :first-child { margin-block-start: 0; }
|
|
69
|
+
.{{PREFIX}}term-box > :last-child { margin-block-end: 0; }
|
|
70
|
+
|
|
71
|
+
/* The label element, present only when the author wrote `label="…"`. */
|
|
72
|
+
.{{PREFIX}}term-box-label {
|
|
73
|
+
color: var(--{{PREFIX}}term-box-accent);
|
|
74
|
+
font-size: var(--{{PREFIX}}term-box-label-size);
|
|
75
|
+
letter-spacing: var(--{{PREFIX}}term-box-label-tracking);
|
|
76
|
+
text-transform: uppercase;
|
|
77
|
+
font-weight: 700;
|
|
78
|
+
margin-block: 0 0.35em;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* -----------------------------------------------------------------------
|
|
82
|
+
* Variants. Each one only ever RESETS a public token — it never writes a
|
|
83
|
+
* second copy of the component's rules. That is what keeps a variant three
|
|
84
|
+
* lines long instead of thirty, and what lets a book add its own variant
|
|
85
|
+
* without this file changing.
|
|
86
|
+
* -------------------------------------------------------------------- */
|
|
87
|
+
.{{PREFIX}}term-box-note {
|
|
88
|
+
--{{PREFIX}}term-box-accent: #2f5d8a;
|
|
89
|
+
--{{PREFIX}}term-box-bg: #f2f6fa;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.{{PREFIX}}term-box-warning {
|
|
93
|
+
--{{PREFIX}}term-box-accent: #9a5b12;
|
|
94
|
+
--{{PREFIX}}term-box-bg: #fdf6ec;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* -----------------------------------------------------------------------
|
|
98
|
+
* The inline span emitted by `[[key term]]` (plugin.js's bespoke rule).
|
|
99
|
+
* -------------------------------------------------------------------- */
|
|
100
|
+
.{{PREFIX}}term {
|
|
101
|
+
color: var(--{{PREFIX}}term-ink);
|
|
102
|
+
font-weight: var(--{{PREFIX}}term-weight);
|
|
103
|
+
}
|
|
@@ -222,11 +222,10 @@ describe("conventions", () => {
|
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
-
test("the stylesheet
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
expect(outside).not.toMatch(/^[^*\/\s][^{}]*\{/m);
|
|
225
|
+
test("the stylesheet declares no cascade layer of its own", () => {
|
|
226
|
+
// Gutterpress wraps this extension's CSS in `@layer ext.<name>` itself,
|
|
227
|
+
// in `extensions:` list order — see the header comment in
|
|
228
|
+
// styles/plugin.css. A layer declared here would only nest inside it.
|
|
229
|
+
expect(css).not.toMatch(/@layer/);
|
|
231
230
|
});
|
|
232
231
|
});
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
executeValidation,
|
|
3
3
|
publishTargetFor,
|
|
4
4
|
reportMissingTools
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-cwv73tkx.js";
|
|
6
6
|
import {
|
|
7
7
|
log
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-y4vrycpn.js";
|
|
9
9
|
import {
|
|
10
10
|
UsageError,
|
|
11
11
|
rejectExtraPositionals,
|
|
12
12
|
rejectUnknownFlags
|
|
13
|
-
} from "./cli-
|
|
14
|
-
import"./cli-
|
|
13
|
+
} from "./cli-6gg8vwaj.js";
|
|
14
|
+
import"./cli-sekhwex4.js";
|
|
15
15
|
import"./cli-c41yr7he.js";
|
|
16
16
|
import {
|
|
17
17
|
EXIT_CODES
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
runBuild,
|
|
7
7
|
splitOutPath,
|
|
8
8
|
startPreviewServer
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-cwv73tkx.js";
|
|
10
10
|
import {
|
|
11
11
|
log
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-y4vrycpn.js";
|
|
13
13
|
import {
|
|
14
14
|
UsageError,
|
|
15
15
|
parseFormat,
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
rejectExtraPositionals,
|
|
18
18
|
rejectUnknownFlags,
|
|
19
19
|
resolvePort
|
|
20
|
-
} from "./cli-
|
|
21
|
-
import"./cli-
|
|
20
|
+
} from "./cli-6gg8vwaj.js";
|
|
21
|
+
import"./cli-sekhwex4.js";
|
|
22
22
|
import"./cli-c41yr7he.js";
|
|
23
23
|
import {
|
|
24
24
|
BuildError
|
|
@@ -11,17 +11,17 @@ import {
|
|
|
11
11
|
publishProviderFor,
|
|
12
12
|
resolvePublishFormat,
|
|
13
13
|
runPublish
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-cwv73tkx.js";
|
|
15
15
|
import {
|
|
16
16
|
FileTokenStore,
|
|
17
17
|
log
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-y4vrycpn.js";
|
|
19
19
|
import {
|
|
20
20
|
UsageError,
|
|
21
21
|
rejectExtraPositionals,
|
|
22
22
|
rejectUnknownFlags
|
|
23
|
-
} from "./cli-
|
|
24
|
-
import"./cli-
|
|
23
|
+
} from "./cli-6gg8vwaj.js";
|
|
24
|
+
import"./cli-sekhwex4.js";
|
|
25
25
|
import"./cli-c41yr7he.js";
|
|
26
26
|
import {
|
|
27
27
|
EXIT_CODES
|
package/dist/render.js
CHANGED
|
@@ -1892,7 +1892,7 @@ ${MARKER_CSS.trim()}
|
|
|
1892
1892
|
@layer gp.vocab {
|
|
1893
1893
|
${GUTTERPRESS_CSS.trim()}
|
|
1894
1894
|
}`,
|
|
1895
|
-
pluginCss ? `/*
|
|
1895
|
+
pluginCss ? `/* extension css */
|
|
1896
1896
|
${pluginCss.trim()}` : null,
|
|
1897
1897
|
projectCss ? `/* project css */
|
|
1898
1898
|
${projectCss.trim()}` : null
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
*
|
|
31
31
|
* Two things worth knowing before you edit this:
|
|
32
32
|
*
|
|
33
|
-
* -
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* changes how YOUR OWN files settle ties with each other
|
|
33
|
+
* - Gutterpress wraps this whole extension in a cascade layer of its own
|
|
34
|
+
* (`ext.<name>`), after core's `gp.marker`/`gp.vocab` and before the
|
|
35
|
+
* book's own stylesheets. These layers nest inside it, so declaring an
|
|
36
|
+
* order only changes how YOUR OWN files settle ties with each other; the
|
|
37
|
+
* book's rules still beat every one of them.
|
|
37
38
|
*
|
|
38
|
-
* - A rule left OUTSIDE all of these layers
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* otherwise plain file.
|
|
39
|
+
* - A rule left OUTSIDE all of these layers beats every layered rule here,
|
|
40
|
+
* at any specificity. That is the one real trap: adopt the convention
|
|
41
|
+
* per whole sheet, never for a few rules inside an otherwise plain file.
|
|
42
42
|
* ------------------------------------------------------------------------ */
|
|
43
43
|
@layer tokens, base, components, templates, pages, book;
|
|
44
44
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAndReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-cwv73tkx.js";
|
|
4
4
|
import {
|
|
5
5
|
log
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-y4vrycpn.js";
|
|
7
7
|
import {
|
|
8
8
|
UsageError,
|
|
9
9
|
rejectExtraPositionals,
|
|
10
10
|
rejectUnknownFlags
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-6gg8vwaj.js";
|
|
12
|
+
import"./cli-sekhwex4.js";
|
|
13
13
|
import"./cli-c41yr7he.js";
|
|
14
14
|
import {
|
|
15
15
|
EXIT_CODES
|
package/package.json
CHANGED
package/dist/plugin-m2w7g47v.css
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/* ===========================================================================
|
|
2
|
-
* {{NAME}} — component stylesheet
|
|
3
|
-
*
|
|
4
|
-
* OWNS
|
|
5
|
-
* The look of everything `plugin.js` emits: the `@term-box` container, its
|
|
6
|
-
* variants and label, and the `[[key term]]` inline span. Every one of
|
|
7
|
-
* those looks is driven by a PUBLIC custom property declared at `:root`
|
|
8
|
-
* below, so a book can retune this component without touching this file.
|
|
9
|
-
*
|
|
10
|
-
* MUST NOT CONTAIN
|
|
11
|
-
* - `@page` rules or page geometry. A plugin styles its own components; the
|
|
12
|
-
* book's theme owns the page.
|
|
13
|
-
* - Bare element selectors (`p`, `table`, `h2`). They would leak this
|
|
14
|
-
* plugin's opinions into every book that installs it. Scope every rule
|
|
15
|
-
* under a `{{PREFIX}}` class.
|
|
16
|
-
* - Any `gp-` class. That prefix is Gutterpress core's.
|
|
17
|
-
* - Per-book values. Ship sane defaults; let the book override the tokens.
|
|
18
|
-
*
|
|
19
|
-
* WHY THE @layer
|
|
20
|
-
* Gutterpress injects plugin CSS before the book's own stylesheets, and in
|
|
21
|
-
* CSS an UNLAYERED rule beats a layered one no matter how specific the
|
|
22
|
-
* layered one is. So an unlayered plugin sheet would quietly outrank every
|
|
23
|
-
* rule in a book that had adopted the recommended
|
|
24
|
-
* `@layer tokens, base, components, templates, pages, book;` convention —
|
|
25
|
-
* the author would edit their own CSS and nothing would happen.
|
|
26
|
-
*
|
|
27
|
-
* Declaring our own layer fixes that by construction. This sheet loads
|
|
28
|
-
* first, so `{{SLUG}}` becomes the FIRST (weakest) layer; every layer the
|
|
29
|
-
* book declares afterwards is appended after it and therefore wins, and the
|
|
30
|
-
* book's unlayered rules win too. A plugin should always be the easiest
|
|
31
|
-
* thing in the book to override.
|
|
32
|
-
*
|
|
33
|
-
* Adopt it for the WHOLE sheet: a rule left outside the layer here is
|
|
34
|
-
* unlayered, and would beat every rule inside it — including our own.
|
|
35
|
-
* ======================================================================== */
|
|
36
|
-
|
|
37
|
-
@layer {{SLUG}} {
|
|
38
|
-
/* -----------------------------------------------------------------------
|
|
39
|
-
* PUBLIC TOKENS — this component's entire theming surface.
|
|
40
|
-
*
|
|
41
|
-
* Declared at `:root` with real defaults so the component looks right in
|
|
42
|
-
* any book with no setup at all. A book retunes it by resetting these in
|
|
43
|
-
* its own CSS — either globally, or scoped to one chapter/page/section:
|
|
44
|
-
*
|
|
45
|
-
* #ch-appendix { --{{PREFIX}}term-box-accent: #7a1f1f; }
|
|
46
|
-
*
|
|
47
|
-
* Rules below consume them as BARE `var(--x)`, never `var(--x, fallback)`:
|
|
48
|
-
* the default lives at `:root` exactly once, so there is one place to look
|
|
49
|
-
* and no second copy to drift.
|
|
50
|
-
* -------------------------------------------------------------------- */
|
|
51
|
-
:root {
|
|
52
|
-
--{{PREFIX}}term-box-accent: #2f5d8a;
|
|
53
|
-
--{{PREFIX}}term-box-bg: #f2f6fa;
|
|
54
|
-
--{{PREFIX}}term-box-ink: inherit;
|
|
55
|
-
--{{PREFIX}}term-box-pad: 0.6em 0.9em;
|
|
56
|
-
--{{PREFIX}}term-box-rule: 3px;
|
|
57
|
-
--{{PREFIX}}term-box-label-size: 0.78em;
|
|
58
|
-
--{{PREFIX}}term-box-label-tracking: 0.08em;
|
|
59
|
-
--{{PREFIX}}term-ink: #2f5d8a;
|
|
60
|
-
--{{PREFIX}}term-weight: 600;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* -----------------------------------------------------------------------
|
|
64
|
-
* The container emitted by `@term-box` (plugin.js's `markers` table).
|
|
65
|
-
* -------------------------------------------------------------------- */
|
|
66
|
-
.{{PREFIX}}term-box {
|
|
67
|
-
background: var(--{{PREFIX}}term-box-bg);
|
|
68
|
-
border-left: var(--{{PREFIX}}term-box-rule) solid var(--{{PREFIX}}term-box-accent);
|
|
69
|
-
color: var(--{{PREFIX}}term-box-ink);
|
|
70
|
-
padding: var(--{{PREFIX}}term-box-pad);
|
|
71
|
-
/* Print hygiene: a callout that splits across a page break reads badly,
|
|
72
|
-
and a two-line orphan reads worse. Both are the component's business,
|
|
73
|
-
not the book's. */
|
|
74
|
-
break-inside: avoid;
|
|
75
|
-
margin-block: 1em;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.{{PREFIX}}term-box > :first-child { margin-block-start: 0; }
|
|
79
|
-
.{{PREFIX}}term-box > :last-child { margin-block-end: 0; }
|
|
80
|
-
|
|
81
|
-
/* The label element, present only when the author wrote `label="…"`. */
|
|
82
|
-
.{{PREFIX}}term-box-label {
|
|
83
|
-
color: var(--{{PREFIX}}term-box-accent);
|
|
84
|
-
font-size: var(--{{PREFIX}}term-box-label-size);
|
|
85
|
-
letter-spacing: var(--{{PREFIX}}term-box-label-tracking);
|
|
86
|
-
text-transform: uppercase;
|
|
87
|
-
font-weight: 700;
|
|
88
|
-
margin-block: 0 0.35em;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/* -----------------------------------------------------------------------
|
|
92
|
-
* Variants. Each one only ever RESETS a public token — it never writes a
|
|
93
|
-
* second copy of the component's rules. That is what keeps a variant three
|
|
94
|
-
* lines long instead of thirty, and what lets a book add its own variant
|
|
95
|
-
* without this file changing.
|
|
96
|
-
* -------------------------------------------------------------------- */
|
|
97
|
-
.{{PREFIX}}term-box-note {
|
|
98
|
-
--{{PREFIX}}term-box-accent: #2f5d8a;
|
|
99
|
-
--{{PREFIX}}term-box-bg: #f2f6fa;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.{{PREFIX}}term-box-warning {
|
|
103
|
-
--{{PREFIX}}term-box-accent: #9a5b12;
|
|
104
|
-
--{{PREFIX}}term-box-bg: #fdf6ec;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/* -----------------------------------------------------------------------
|
|
108
|
-
* The inline span emitted by `[[key term]]` (plugin.js's bespoke rule).
|
|
109
|
-
* -------------------------------------------------------------------- */
|
|
110
|
-
.{{PREFIX}}term {
|
|
111
|
-
color: var(--{{PREFIX}}term-ink);
|
|
112
|
-
font-weight: var(--{{PREFIX}}term-weight);
|
|
113
|
-
}
|
|
114
|
-
}
|