gutterpress 0.10.7-beta.1 → 0.10.8-beta.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 +10 -3
- package/dist/README-aaqapam1.md +186 -0
- package/dist/README-mdq34cmb.md +155 -0
- package/dist/api/index.d.ts +6 -2
- package/dist/api/index.js +30 -2
- package/dist/{audit-82jr4qhw.js → audit-ckbmgzpk.js} +4 -4
- package/dist/base-ypqh9n7f.css +123 -0
- package/dist/book-ted3tzrp.css +58 -0
- package/dist/{build-e53pjtez.js → build-sgpyjx5n.js} +4 -4
- package/dist/callout-hv56m16h.md +7 -0
- package/dist/{cli-s8q42x3r.js → cli-4vtgt2ng.js} +78 -2
- package/dist/{cli-mk1s46mx.js → cli-pw6z15yv.js} +1 -1
- package/dist/{cli-08psmhr5.js → cli-v1ma3v2s.js} +1 -1
- package/dist/{cli-w6h5zegm.js → cli-wvw2msvn.js} +946 -401
- package/dist/cli.js +16 -16
- package/dist/components-0mmswvvm.yaml +51 -0
- package/dist/components-aam0fe2z.css +94 -0
- package/dist/{doctor-50j69ryq.js → doctor-59dwzq4r.js} +2 -2
- package/dist/{engine-pb6h089e.js → engine-daad33qn.js} +1 -1
- package/dist/{engine-88mynx9a.js → engine-db8632w6.js} +2 -2
- package/dist/expected-ycmacem8.html +9 -0
- package/dist/fixture-2qnyqgb5.md +10 -0
- package/dist/gutterpress-m98e2w2d.json +8 -0
- package/dist/gutterpress-x2ycdsb8.json +17 -0
- package/dist/{index-837htyjy.js → index-9pbaznww.js} +78 -2
- package/dist/{index-9zf8mtk7.js → index-m00n6sz4.js} +1147 -523
- package/dist/{index-a0xpm188.js → index-rpt4vtby.js} +1 -1
- package/dist/index.js +31 -3
- package/dist/lib/build-runner.d.ts +52 -0
- package/dist/lib/extension-manifest.d.ts +164 -0
- package/dist/lib/extension-scaffold.d.ts +65 -0
- package/dist/lib/lint-runner.d.ts +12 -0
- package/dist/lib/markdown/assemble.d.ts +12 -0
- package/dist/lib/markdown/markers.d.ts +20 -0
- package/dist/lib/markdown/plugins.d.ts +1 -1
- package/dist/lib/markdown/renderer.d.ts +99 -0
- package/dist/lib/snippets.d.ts +121 -5
- package/dist/lib/theme-import.d.ts +8 -4
- package/dist/lib/theme-manager.d.ts +52 -39
- package/dist/lib/validation-exec.d.ts +12 -0
- package/dist/{lint-zbymjr1z.js → lint-9xhz0bsw.js} +4 -4
- package/dist/{manifest.schema-kwnrwv8b.json → manifest.schema-1q35yxs9.json} +2 -2
- package/dist/{new-78j4mx60.js → new-5drcm5am.js} +111 -6
- package/dist/package-rm9d2tht.json +29 -0
- package/dist/page-rules-nsj3aw42.css +128 -0
- package/dist/page-templates-7md4ev7d.css +60 -0
- package/dist/plugin-m2w7g47v.css +114 -0
- package/dist/{plugin-rahnkax3.js → plugin-sc6zfwre.js} +4 -4
- package/dist/plugin.js-aszz0zgh.tpl +172 -0
- package/dist/plugin.test.js-mv0ghv5n.tpl +232 -0
- package/dist/{preflight-qdmqf3j6.js → preflight-g31c4060.js} +4 -4
- package/dist/{preview-yekma94n.js → preview-w1pqpq2g.js} +4 -4
- package/dist/{publish-tm2rqyme.js → publish-es72yhd8.js} +4 -4
- package/dist/render.js +275 -8
- package/dist/term-box-4y0w7y32.md +7 -0
- package/dist/{theme-j7f6aegv.js → theme-msr4ctky.js} +4 -4
- package/dist/tokens-e4xk3x4v.css +86 -0
- package/dist/{validate-3ztxavd0.js → validate-tsgprng7.js} +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -143,12 +143,19 @@ source.
|
|
|
143
143
|
|
|
144
144
|
### `gutterpress new`
|
|
145
145
|
|
|
146
|
-
Scaffold a new
|
|
146
|
+
Scaffold a new book, plugin or theme from an embedded starter template — the fastest way to start (see [Quick start](#quick-start)).
|
|
147
|
+
|
|
148
|
+
`--kind book` is the default. Every new book picks the vendor preset it's designed for: `dtrpg` (DriveThruRPG print-on-demand), `book` (neutral 6x9in trade book), or `custom` (you supply the trim size in points).
|
|
149
|
+
|
|
150
|
+
`--kind plugin` and `--kind theme` scaffold an **extension package** instead — a folder with a `gutterpress.json` a book can load. The plugin starter carries a declarative marker table, a hand-written markdown-it rule, component CSS and a `bun test` fixture suite; the theme starter carries the six-file layered CSS architecture (tokens / base / components / page-templates / page-rules / book), each sheet opening with its own OWNS / MUST NOT CONTAIN contract header. Both include a README explaining which conventions are load-bearing. An extension needs no preset, trim size or publish target, so the book-only flags below are rejected rather than ignored when `--kind` names one — and `--prefix`/`--description` are likewise rejected for a book.
|
|
147
151
|
|
|
148
152
|
```sh
|
|
149
|
-
gutterpress new <name> --
|
|
153
|
+
gutterpress new <name> [--kind <id>] [options]
|
|
150
154
|
|
|
151
|
-
--
|
|
155
|
+
--kind <id> What to create: book (default), plugin, theme
|
|
156
|
+
--prefix <str> Class/custom-property prefix an extension claims (default: its slug, e.g. "field-notes-"); --kind plugin|theme only
|
|
157
|
+
--description <text> One-line description recorded in the extension's metadata; --kind plugin|theme only
|
|
158
|
+
--preset <id> Vendor preset the book is designed for: dtrpg, book, custom (required for a book)
|
|
152
159
|
--author <name> Author name to record in the project
|
|
153
160
|
--dir <path> Parent directory to create the project in (default: current directory)
|
|
154
161
|
--folder <name> Folder name to create (default: a slug of the project name)
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# {{NAME}}
|
|
2
|
+
|
|
3
|
+
> {{DESCRIPTION}}
|
|
4
|
+
|
|
5
|
+
A Gutterpress **theme** — a layered CSS architecture, not a look. The colours
|
|
6
|
+
and the typeface are placeholders you will replace in an afternoon; the
|
|
7
|
+
arrangement of the files is the part worth keeping.
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
{{SLUG}}/
|
|
11
|
+
├── gutterpress.json what this package declares to Gutterpress
|
|
12
|
+
├── components.yaml the catalog: what an author can opt into
|
|
13
|
+
├── snippets/ insertable recipes for the components
|
|
14
|
+
└── styles/
|
|
15
|
+
├── tokens.css :root only. Palette, type, spacing.
|
|
16
|
+
├── base.css element baseline. Bare p/h2/table/code.
|
|
17
|
+
├── components.css named components + their public tokens.
|
|
18
|
+
├── page-templates.css .page.* layouts — arrangement WITHIN a page.
|
|
19
|
+
├── page-rules.css @page geometry, margin boxes, running heads.
|
|
20
|
+
└── book.css this book's overrides. Loads last.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Every file opens with an **OWNS / MUST NOT CONTAIN** header. Those headers are
|
|
24
|
+
the actual contract — they live in the files precisely so they travel with the
|
|
25
|
+
code instead of sitting in a document nobody opens at the moment they are
|
|
26
|
+
about to add a rule to the wrong sheet.
|
|
27
|
+
|
|
28
|
+
## Try it
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
gutterpress theme import ./{{SLUG}} ../my-book
|
|
32
|
+
gutterpress theme apply {{SLUG}} ../my-book
|
|
33
|
+
gutterpress preview ../my-book
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Both theme commands take the book directory as their second POSITIONAL
|
|
37
|
+
argument, not a `--dir` flag.
|
|
38
|
+
|
|
39
|
+
Then in a chapter:
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
@section .{{PREFIX}}callout
|
|
43
|
+
### Before you start
|
|
44
|
+
Everything in here stays together on one page.
|
|
45
|
+
@end-section
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Why six files
|
|
49
|
+
|
|
50
|
+
Gutterpress ships three built-in themes of about sixty lines each. They style
|
|
51
|
+
bare elements and stop, which is the right size for a plain book and is not an
|
|
52
|
+
architecture. The first book that needs components outgrows one in a week, and
|
|
53
|
+
then re-derives this arrangement from scratch — badly, usually twice.
|
|
54
|
+
|
|
55
|
+
The split is by OWNERSHIP, and the value is that it answers one question
|
|
56
|
+
instantly: **where does this rule go?**
|
|
57
|
+
|
|
58
|
+
| I want to change… | File |
|
|
59
|
+
|---|---|
|
|
60
|
+
| the brand — a colour, a typeface, the type scale | `tokens.css` |
|
|
61
|
+
| what a plain paragraph or table looks like | `base.css` |
|
|
62
|
+
| a named thing an author opts into | `components.css` |
|
|
63
|
+
| how one page arranges its content | `page-templates.css` |
|
|
64
|
+
| margins, folios, running heads | `page-rules.css` |
|
|
65
|
+
| one chapter of one book | `book.css` |
|
|
66
|
+
|
|
67
|
+
If a rule seems to belong in two of them, it is usually two rules.
|
|
68
|
+
|
|
69
|
+
## The token pattern
|
|
70
|
+
|
|
71
|
+
This is the mechanism the whole architecture rests on, demonstrated end to end
|
|
72
|
+
by the callout component:
|
|
73
|
+
|
|
74
|
+
```css
|
|
75
|
+
/* tokens.css — the brand */
|
|
76
|
+
:root { --{{PREFIX}}accent: #2f5d8a; }
|
|
77
|
+
|
|
78
|
+
/* components.css — the component's own public token, then bare consumption */
|
|
79
|
+
:root { --{{PREFIX}}callout-accent: var(--{{PREFIX}}accent); }
|
|
80
|
+
.{{PREFIX}}callout { border-inline-start: 3px solid var(--{{PREFIX}}callout-accent); }
|
|
81
|
+
|
|
82
|
+
/* book.css — one chapter wants a different one */
|
|
83
|
+
#ch-appendix { --{{PREFIX}}callout-accent: var(--{{PREFIX}}accent-warm); }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Three properties make it work, and losing any one of them collapses it:
|
|
87
|
+
|
|
88
|
+
1. **The default lives at `:root`, exactly once.** So the component looks
|
|
89
|
+
right in any book with no setup, and there is one place to change it.
|
|
90
|
+
|
|
91
|
+
2. **Components consume `var(--x)`, never `var(--x, fallback)`.** An inline
|
|
92
|
+
fallback is a second copy of the default. It will drift from the `:root`
|
|
93
|
+
one, and when it does the component will look correct everywhere except
|
|
94
|
+
the one place somebody overrode the token.
|
|
95
|
+
|
|
96
|
+
3. **Overrides only ever RESET a token.** Never
|
|
97
|
+
`#ch-appendix .{{PREFIX}}callout { border-color: … }`. The token is the
|
|
98
|
+
seam between "what the component is" and "what this book wants"; writing
|
|
99
|
+
past it welds them together, and the next change to the component breaks
|
|
100
|
+
the book.
|
|
101
|
+
|
|
102
|
+
A variant is the same move made inside the package:
|
|
103
|
+
`.{{PREFIX}}callout-warning` resets one token and inherits everything else.
|
|
104
|
+
|
|
105
|
+
## The conventions that are load-bearing
|
|
106
|
+
|
|
107
|
+
### 1. One prefix, and it is yours
|
|
108
|
+
|
|
109
|
+
Every component class, page-template class and custom property here starts
|
|
110
|
+
with `{{PREFIX}}`. A book loads core, this theme and any number of plugins
|
|
111
|
+
into one flat CSS namespace; nothing scopes them for you.
|
|
112
|
+
|
|
113
|
+
`gp-` is reserved for Gutterpress core — taking it silently overrides core's
|
|
114
|
+
own vocabulary.
|
|
115
|
+
|
|
116
|
+
`base.css` is the deliberate exception: styling bare `p` and `table` is
|
|
117
|
+
exactly a theme's job, because a theme IS the book's look. A PLUGIN doing the
|
|
118
|
+
same thing would be leaking its opinions into every book that installed it.
|
|
119
|
+
That asymmetry is the whole difference between the two kinds of package.
|
|
120
|
+
|
|
121
|
+
### 2. Declare the layer order once, and adopt it per whole sheet
|
|
122
|
+
|
|
123
|
+
`tokens.css` opens with:
|
|
124
|
+
|
|
125
|
+
```css
|
|
126
|
+
@layer tokens, base, components, templates, pages, book;
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Each sheet then puts everything it owns inside its layer. The cascade is
|
|
130
|
+
settled by that one line rather than by which file `styles:` lists last, so
|
|
131
|
+
splitting a sheet or reordering the manifest can no longer silently flip who
|
|
132
|
+
wins.
|
|
133
|
+
|
|
134
|
+
The trap, and it catches everyone once: a rule left OUTSIDE all the layers is
|
|
135
|
+
fully unlayered, and unlayered CSS beats layered CSS at any specificity. So
|
|
136
|
+
one stray rule at the bottom of `components.css` will out-rank every rule in
|
|
137
|
+
`book.css`. Adopt the convention for a whole sheet at a time.
|
|
138
|
+
|
|
139
|
+
These layers are unlayered relative to Gutterpress core (which uses
|
|
140
|
+
`gp.marker` and `gp.vocab`), so every rule here still beats core exactly as it
|
|
141
|
+
did before layers existed.
|
|
142
|
+
|
|
143
|
+
### 3. Authors write semantic markdown
|
|
144
|
+
|
|
145
|
+
The author's entire styling vocabulary is the component name:
|
|
146
|
+
`@section .{{PREFIX}}callout`. Not `{.blue}` on a paragraph, not `{.compact}`
|
|
147
|
+
on a table, not a `<div>`.
|
|
148
|
+
|
|
149
|
+
The reason is maintenance, not purity: a variant expressed as a class the
|
|
150
|
+
author retypes must be found and replaced across every chapter when it
|
|
151
|
+
changes. A variant expressed as a component name plus a CSS rule changes in
|
|
152
|
+
one place, and chapters written afterwards get it for free.
|
|
153
|
+
|
|
154
|
+
### 4. `@page { size }` is not optional, and it must match the manifest
|
|
155
|
+
|
|
156
|
+
`page-rules.css` opens by declaring the trim:
|
|
157
|
+
|
|
158
|
+
```css
|
|
159
|
+
@page { size: 6in 9in; }
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
That line is load-bearing in the most literal sense. With no `size:` anywhere
|
|
163
|
+
in the book's CSS, Chromium falls back to US Letter and prints the whole book
|
|
164
|
+
at the wrong trim, with no error — this is the one failure in the stack that
|
|
165
|
+
costs money rather than time.
|
|
166
|
+
|
|
167
|
+
The manifest's `preset:`/`page:` remains the source of truth: it is what
|
|
168
|
+
`gutterpress validate` measures the produced PDF against, and what the publish
|
|
169
|
+
targets check. The CSS line is the instruction that satisfies it. Change one,
|
|
170
|
+
change the other — and let validate catch you when you forget.
|
|
171
|
+
|
|
172
|
+
### 5. Keep the catalog honest
|
|
173
|
+
|
|
174
|
+
`components.yaml` enumerates what an author can opt into and which tokens are
|
|
175
|
+
public. Anything not listed there is internal and may change.
|
|
176
|
+
|
|
177
|
+
Nothing in core reads the entries yet, so it is a discipline rather than a
|
|
178
|
+
check — which is exactly why adding the entry at the same moment you add the
|
|
179
|
+
component is worth the habit.
|
|
180
|
+
|
|
181
|
+
## Further reading
|
|
182
|
+
|
|
183
|
+
- `docs/contextual-cascade-principle.md` — the pattern these files implement,
|
|
184
|
+
with more worked examples.
|
|
185
|
+
- `docs/native-engine-styling-guide.md` — cascade layers, `@page`, GCPM, and
|
|
186
|
+
what the engine does with them.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# {{NAME}}
|
|
2
|
+
|
|
3
|
+
> {{DESCRIPTION}}
|
|
4
|
+
|
|
5
|
+
A Gutterpress **plugin** — a folder that adds markdown behaviour, component
|
|
6
|
+
CSS and insertable snippets to a book.
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
{{SLUG}}/
|
|
10
|
+
├── gutterpress.json what this package declares to Gutterpress
|
|
11
|
+
├── plugin.js the markdown-it plugin (declarative + bespoke halves)
|
|
12
|
+
├── styles/plugin.css component CSS, with public tokens at :root
|
|
13
|
+
├── snippets/ insertable recipes, one per component
|
|
14
|
+
├── test/ fixture.md → expected.html, runnable with `bun test`
|
|
15
|
+
└── package.json only needed for `bun test` and publishing to npm
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Try it
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
bun install # once — pulls markdown-it, the suite's only dependency
|
|
22
|
+
bun test
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then wire it into a book. In the book's `manifest.yaml`:
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
plugins:
|
|
29
|
+
- path: plugins/{{SLUG}}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`path:` names the FOLDER, not `plugin.js`. That is what makes Gutterpress read
|
|
33
|
+
`gutterpress.json` and pick up the stylesheet and snippets alongside the
|
|
34
|
+
markdown behaviour — point it at the `.js` file and you get the markdown and
|
|
35
|
+
nothing else.
|
|
36
|
+
|
|
37
|
+
Now `gutterpress preview` the book and write:
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
@term-box warning label="Read this first"
|
|
41
|
+
The rule of three applies here, and [[initiative]] is defined inline.
|
|
42
|
+
@end-term-box
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## The conventions that are load-bearing
|
|
46
|
+
|
|
47
|
+
Most of what is in this folder is a suggestion. These five are not — each one
|
|
48
|
+
is something Gutterpress does not check for you, and each one fails silently
|
|
49
|
+
in somebody else's book when you get it wrong.
|
|
50
|
+
|
|
51
|
+
### 1. One prefix, and it is yours
|
|
52
|
+
|
|
53
|
+
Every class, every CSS custom property and every marker name this package
|
|
54
|
+
emits starts with `{{PREFIX}}`.
|
|
55
|
+
|
|
56
|
+
A book loads core, a theme and any number of plugins into a single flat CSS
|
|
57
|
+
namespace and a single flat marker namespace. Nothing scopes them. Without a
|
|
58
|
+
prefix, your `.callout` and somebody else's `.callout` are the same selector,
|
|
59
|
+
and the one that loads second wins — in their book, not yours, with no error.
|
|
60
|
+
|
|
61
|
+
`gp-` is reserved for Gutterpress core. Taking it does not conflict; it
|
|
62
|
+
overrides, which is worse.
|
|
63
|
+
|
|
64
|
+
`test/plugin.test.js` enforces both halves of this.
|
|
65
|
+
|
|
66
|
+
### 2. Never import from `gutterpress`
|
|
67
|
+
|
|
68
|
+
Not at runtime. Gutterpress ships as a single compiled binary with no
|
|
69
|
+
`node_modules` for plugin code to resolve against, so the import that works on
|
|
70
|
+
your machine throws on a reader's.
|
|
71
|
+
|
|
72
|
+
If you need a helper from core, inline a copy of it.
|
|
73
|
+
|
|
74
|
+
TYPE-only imports are the exception, because they are erased before the code
|
|
75
|
+
ever runs:
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
/** @param {import("gutterpress").GutterpressPlugin} _ */
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import type { GutterpressPlugin, GutterpressMarkerTable } from "gutterpress";
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 3. A plugin is a plain markdown-it plugin
|
|
86
|
+
|
|
87
|
+
`export default function (md, options) {}` and nothing else. No base class, no
|
|
88
|
+
registration call, no context object handed to you by the host. This is why
|
|
89
|
+
any markdown-it plugin on npm works in Gutterpress unchanged — and the price
|
|
90
|
+
of that is that your plugin has to be one too.
|
|
91
|
+
|
|
92
|
+
`markers`, `styles`, `css` and `metadata` are additional exports the loader
|
|
93
|
+
READS. They are data, not an API.
|
|
94
|
+
|
|
95
|
+
### 4. Declarative markers for containers, a rule for everything else
|
|
96
|
+
|
|
97
|
+
`export const markers` describes a wrapper element and Gutterpress's own
|
|
98
|
+
marker parser does the rest — same grammar, same class merging, same warnings
|
|
99
|
+
as core's `@section`. Use it whenever "wrap a block in an element with a
|
|
100
|
+
class" is the whole job.
|
|
101
|
+
|
|
102
|
+
Write a markdown-it rule by hand when it is not: inline syntax, token
|
|
103
|
+
rewriting, custom renderers. `plugin.js` has one of each so you can see the
|
|
104
|
+
line.
|
|
105
|
+
|
|
106
|
+
Marker names are global across every plugin a book loads. Two plugins
|
|
107
|
+
declaring `@callout` is a hard load error naming both — which is a good
|
|
108
|
+
outcome, and another reason to prefix.
|
|
109
|
+
|
|
110
|
+
### 5. Put your CSS in your own cascade layer
|
|
111
|
+
|
|
112
|
+
`styles/plugin.css` wraps everything in `@layer {{SLUG}}`.
|
|
113
|
+
|
|
114
|
+
Plugin CSS is injected before the book's own stylesheets, and in CSS an
|
|
115
|
+
unlayered rule beats a layered one at any specificity. So an unlayered plugin
|
|
116
|
+
sheet outranks every rule in a book that uses the recommended
|
|
117
|
+
`@layer tokens, base, components, templates, pages, book;` convention — the
|
|
118
|
+
author edits their CSS and nothing happens.
|
|
119
|
+
|
|
120
|
+
Because this sheet loads first, its layer sorts first, which makes it the
|
|
121
|
+
weakest thing in the book. That is the right place for a plugin to sit.
|
|
122
|
+
|
|
123
|
+
Adopt it for the whole file: a rule left outside the layer is unlayered and
|
|
124
|
+
beats everything inside it, including your own.
|
|
125
|
+
|
|
126
|
+
## Theming: the token pattern
|
|
127
|
+
|
|
128
|
+
Every look this package ships is driven by a custom property declared once at
|
|
129
|
+
`:root`, and consumed bare:
|
|
130
|
+
|
|
131
|
+
```css
|
|
132
|
+
:root { --{{PREFIX}}term-box-accent: #2f5d8a; }
|
|
133
|
+
|
|
134
|
+
.{{PREFIX}}term-box { border-left: 3px solid var(--{{PREFIX}}term-box-accent); }
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
`var(--x)`, not `var(--x, #2f5d8a)` — the default lives at `:root` exactly
|
|
138
|
+
once, so there is one place to look and no second copy to drift.
|
|
139
|
+
|
|
140
|
+
A book retunes it without touching this package, globally or per chapter:
|
|
141
|
+
|
|
142
|
+
```css
|
|
143
|
+
#ch-appendix { --{{PREFIX}}term-box-accent: #7a1f1f; }
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
A variant does the same thing internally: it only ever resets tokens, never
|
|
147
|
+
restates the component's rules.
|
|
148
|
+
|
|
149
|
+
## Publishing
|
|
150
|
+
|
|
151
|
+
Anything a book can reach works. Committing the folder into the book's
|
|
152
|
+
`plugins/` directory is the simplest and needs no registry at all.
|
|
153
|
+
|
|
154
|
+
To publish to npm, `npm publish` this folder and have readers install it with
|
|
155
|
+
`gutterpress plugin add {{SLUG}}`.
|
package/dist/api/index.d.ts
CHANGED
|
@@ -23,20 +23,24 @@ export { detectProjectSource, capabilitiesFor, findEnclosingRepoDir, repoSubPath
|
|
|
23
23
|
export type { ProjectSource, ProjectCapabilities, } from "../lib/project-source";
|
|
24
24
|
export { scaffoldProject, adoptFolder, slugifyProjectName, escapeYamlScalar, } from "../lib/project-scaffold.ts";
|
|
25
25
|
export type { ProjectTemplateId, ProjectVersionHistoryMode, CreateProjectOptions, CustomPageOptions, AdoptFolderOptions, CreateProjectResult, CreateProjectErrorCode, CreateProjectError, } from "../lib/project-scaffold.ts";
|
|
26
|
+
export { scaffoldExtension, resolveExtensionPrefix, EXTENSION_KINDS, RESERVED_PREFIX, } from "../lib/extension-scaffold.ts";
|
|
27
|
+
export type { ExtensionKind, ScaffoldExtensionOptions, ScaffoldExtensionResult, } from "../lib/extension-scaffold.ts";
|
|
26
28
|
export { PRESET_IDS, PRESETS } from "../lib/presets.ts";
|
|
27
29
|
export type { PresetId, VendorPreset } from "../lib/presets.ts";
|
|
28
30
|
export { TARGETS, TARGET_IDS, publishTargetFor } from "../lib/targets.ts";
|
|
29
31
|
export type { PublishTarget, TargetOverlay } from "../lib/targets.ts";
|
|
30
32
|
export { listBuiltInTemplates, listCustomTemplates, saveProjectAsTemplate, importTemplateFromFolder, BUILT_IN_TEMPLATE_IDS, } from "../lib/project-templates.ts";
|
|
31
33
|
export type { TemplateInfo, SaveProjectAsTemplateOptions, } from "../lib/project-templates.ts";
|
|
32
|
-
export { extractVariables, substituteVariables, listSnippets, readSnippet, saveSnippet, deleteSnippet, SNIPPETS_DIR, } from "../lib/snippets.ts";
|
|
33
|
-
export type { SnippetEntry } from "../lib/snippets.ts";
|
|
34
|
+
export { extractVariables, substituteVariables, listSnippets, readSnippet, saveSnippet, deleteSnippet, listMergedSnippets, readExtensionSnippet, SNIPPETS_DIR, } from "../lib/snippets.ts";
|
|
35
|
+
export type { SnippetEntry, SnippetSource } from "../lib/snippets.ts";
|
|
34
36
|
export { listProjectPlugins, setPluginEnabled, addLocalPlugin, addNpmPlugin, validateProjectPlugins, RECOMMENDED_PLUGINS, PLUGINS_DIR, } from "../lib/plugin-manager.ts";
|
|
35
37
|
export type { ProjectPluginEntry, PluginValidationResult, RecommendedPlugin, PluginKind, } from "../lib/plugin-manager.ts";
|
|
36
38
|
export { listBuiltInThemes, resolveBuiltInTheme, listProjectThemes, getActiveTheme, applyTheme, importThemeFromFolder, importThemeFromUrl, readThemeCss, removeProjectTheme, getPreviousTheme, revertTheme, detectLegacyForkedTheme, BUILT_IN_THEME_IDS, THEMES_DIR, } from "../lib/theme-manager.ts";
|
|
37
39
|
export type { ThemeInfo, ThemeMetadata, ResolvedTheme, ApplyThemeTarget, BuiltInThemeId, } from "../lib/theme-manager.ts";
|
|
38
40
|
export { importThemeFromFile } from "../lib/theme-import.ts";
|
|
39
41
|
export type { ThemeImportResult, ThemeImportWarning } from "../lib/theme-import.ts";
|
|
42
|
+
export { EXTENSION_MANIFEST_FILENAME, LEGACY_THEME_MANIFEST_FILENAME, readExtensionMeta, extensionStyleList, extensionEngineStyleList, assertExtensionContained, pathEscapesFolder, resolveExtension, } from "../lib/extension-manifest.ts";
|
|
43
|
+
export type { ExtensionMetadata, ResolvedExtension } from "../lib/extension-manifest.ts";
|
|
40
44
|
export { listProjectStyles, resolveActiveStyles } from "../lib/style-resolver.ts";
|
|
41
45
|
export type { ProjectStyle } from "../lib/style-resolver.ts";
|
|
42
46
|
export { readManifestFields, setManifestFields, setActiveStyles, } from "../lib/manifest-config.ts";
|
package/dist/api/index.js
CHANGED
|
@@ -8,18 +8,22 @@ import {
|
|
|
8
8
|
AUTO_SYNC_PUSH_INTERVAL_MINUTES,
|
|
9
9
|
BUILT_IN_TEMPLATE_IDS,
|
|
10
10
|
BUILT_IN_THEME_IDS,
|
|
11
|
+
EXTENSION_KINDS,
|
|
12
|
+
EXTENSION_MANIFEST_FILENAME,
|
|
11
13
|
FileTokenStore,
|
|
12
14
|
GDRIVE_HOST,
|
|
13
15
|
GITHUB_HOST,
|
|
14
16
|
GOOGLE_NOT_CONFIGURED_MESSAGE,
|
|
15
17
|
GitHubAuthProvider,
|
|
16
18
|
GoogleAuthProvider,
|
|
19
|
+
LEGACY_THEME_MANIFEST_FILENAME,
|
|
17
20
|
MANIFEST_FILENAMES,
|
|
18
21
|
PLUGINS_DIR,
|
|
19
22
|
PRESETS,
|
|
20
23
|
PRESET_IDS,
|
|
21
24
|
PublishSelectionsStore,
|
|
22
25
|
RECOMMENDED_PLUGINS,
|
|
26
|
+
RESERVED_PREFIX,
|
|
23
27
|
SNIPPETS_DIR,
|
|
24
28
|
SYNC_SNAPSHOT_MESSAGE,
|
|
25
29
|
TARGETS,
|
|
@@ -29,6 +33,7 @@ import {
|
|
|
29
33
|
addNpmPlugin,
|
|
30
34
|
adoptFolder,
|
|
31
35
|
applyTheme,
|
|
36
|
+
assertExtensionContained,
|
|
32
37
|
autoSnapshotDelayMs,
|
|
33
38
|
autoSyncDelayMs,
|
|
34
39
|
cloneRepository,
|
|
@@ -41,6 +46,8 @@ import {
|
|
|
41
46
|
diagnoseProjectRemote,
|
|
42
47
|
disconnectPublishCredential,
|
|
43
48
|
escapeYamlScalar,
|
|
49
|
+
extensionEngineStyleList,
|
|
50
|
+
extensionStyleList,
|
|
44
51
|
extractUrlCredential,
|
|
45
52
|
extractVariables,
|
|
46
53
|
forgeKindForHost,
|
|
@@ -60,6 +67,7 @@ import {
|
|
|
60
67
|
listCustomTemplates,
|
|
61
68
|
listGitHubBranches,
|
|
62
69
|
listGitHubRepositories,
|
|
70
|
+
listMergedSnippets,
|
|
63
71
|
listProjectPlugins,
|
|
64
72
|
listProjectStyles,
|
|
65
73
|
listProjectThemes,
|
|
@@ -69,11 +77,14 @@ import {
|
|
|
69
77
|
listSnippets,
|
|
70
78
|
loadManifestWithPath,
|
|
71
79
|
parseRemoteOrigin,
|
|
80
|
+
pathEscapesFolder,
|
|
72
81
|
pkceChallengeFromVerifier,
|
|
73
82
|
publishConnectionStatus,
|
|
74
83
|
publishCredentialKey,
|
|
75
84
|
publishProviderFor,
|
|
76
85
|
publishTargetFor,
|
|
86
|
+
readExtensionMeta,
|
|
87
|
+
readExtensionSnippet,
|
|
77
88
|
readManifestFields,
|
|
78
89
|
readPublishSettings,
|
|
79
90
|
readSnippet,
|
|
@@ -83,6 +94,8 @@ import {
|
|
|
83
94
|
resolveActiveStyles,
|
|
84
95
|
resolveBuiltInTheme,
|
|
85
96
|
resolveConfig,
|
|
97
|
+
resolveExtension,
|
|
98
|
+
resolveExtensionPrefix,
|
|
86
99
|
resolveGitHubClientId,
|
|
87
100
|
resolveGoogleClientId,
|
|
88
101
|
resolveGoogleClientSecret,
|
|
@@ -95,6 +108,7 @@ import {
|
|
|
95
108
|
sanitizeCloneFolderName,
|
|
96
109
|
saveProjectAsTemplate,
|
|
97
110
|
saveSnippet,
|
|
111
|
+
scaffoldExtension,
|
|
98
112
|
scaffoldProject,
|
|
99
113
|
setActiveStyles,
|
|
100
114
|
setManifestFields,
|
|
@@ -107,12 +121,12 @@ import {
|
|
|
107
121
|
syncProject,
|
|
108
122
|
testRemoteAccess,
|
|
109
123
|
validateProjectPlugins
|
|
110
|
-
} from "../index-
|
|
124
|
+
} from "../index-m00n6sz4.js";
|
|
111
125
|
import {
|
|
112
126
|
BuildError,
|
|
113
127
|
DEFAULT_PRINT_OPTS,
|
|
114
128
|
readyProbeExpr
|
|
115
|
-
} from "../index-
|
|
129
|
+
} from "../index-9pbaznww.js";
|
|
116
130
|
import {
|
|
117
131
|
AUTO_SNAPSHOT_MESSAGE,
|
|
118
132
|
HISTORY_PAGE_LIMIT,
|
|
@@ -143,6 +157,7 @@ export {
|
|
|
143
157
|
setManifestFields,
|
|
144
158
|
setActiveStyles,
|
|
145
159
|
scaffoldProject,
|
|
160
|
+
scaffoldExtension,
|
|
146
161
|
saveSnippet,
|
|
147
162
|
saveProjectAsTemplate,
|
|
148
163
|
sanitizeCloneFolderName,
|
|
@@ -157,6 +172,8 @@ export {
|
|
|
157
172
|
resolveGoogleClientSecret,
|
|
158
173
|
resolveGoogleClientId,
|
|
159
174
|
resolveGitHubClientId,
|
|
175
|
+
resolveExtensionPrefix,
|
|
176
|
+
resolveExtension,
|
|
160
177
|
resolveConfig,
|
|
161
178
|
resolveBuiltInTheme,
|
|
162
179
|
resolveActiveStyles,
|
|
@@ -169,12 +186,15 @@ export {
|
|
|
169
186
|
readSnippet,
|
|
170
187
|
readPublishSettings,
|
|
171
188
|
readManifestFields,
|
|
189
|
+
readExtensionSnippet,
|
|
190
|
+
readExtensionMeta,
|
|
172
191
|
publishTargetFor,
|
|
173
192
|
publishProviderFor,
|
|
174
193
|
publishCredentialKey,
|
|
175
194
|
publishConnectionStatus,
|
|
176
195
|
providerFor,
|
|
177
196
|
pkceChallengeFromVerifier,
|
|
197
|
+
pathEscapesFolder,
|
|
178
198
|
parseRemoteOrigin,
|
|
179
199
|
loadManifestWithPath,
|
|
180
200
|
listSnippets,
|
|
@@ -184,6 +204,7 @@ export {
|
|
|
184
204
|
listProjectThemes,
|
|
185
205
|
listProjectStyles,
|
|
186
206
|
listProjectPlugins,
|
|
207
|
+
listMergedSnippets,
|
|
187
208
|
listGitHubRepositories,
|
|
188
209
|
listGitHubBranches,
|
|
189
210
|
listCustomTemplates,
|
|
@@ -205,6 +226,8 @@ export {
|
|
|
205
226
|
findEnclosingRepoDir,
|
|
206
227
|
extractVariables,
|
|
207
228
|
extractUrlCredential,
|
|
229
|
+
extensionStyleList,
|
|
230
|
+
extensionEngineStyleList,
|
|
208
231
|
escapeYamlScalar,
|
|
209
232
|
disconnectPublishCredential,
|
|
210
233
|
diagnoseProjectRemote,
|
|
@@ -219,6 +242,7 @@ export {
|
|
|
219
242
|
capabilitiesFor,
|
|
220
243
|
autoSyncDelayMs,
|
|
221
244
|
autoSnapshotDelayMs,
|
|
245
|
+
assertExtensionContained,
|
|
222
246
|
applyTheme,
|
|
223
247
|
adoptFolder,
|
|
224
248
|
addNpmPlugin,
|
|
@@ -229,12 +253,14 @@ export {
|
|
|
229
253
|
SYNC_SNAPSHOT_MESSAGE,
|
|
230
254
|
SNIPPETS_DIR,
|
|
231
255
|
RESTORE_BACKUP_MESSAGE,
|
|
256
|
+
RESERVED_PREFIX,
|
|
232
257
|
RECOMMENDED_PLUGINS,
|
|
233
258
|
PublishSelectionsStore,
|
|
234
259
|
PRESET_IDS,
|
|
235
260
|
PRESETS,
|
|
236
261
|
PLUGINS_DIR,
|
|
237
262
|
MANIFEST_FILENAMES,
|
|
263
|
+
LEGACY_THEME_MANIFEST_FILENAME,
|
|
238
264
|
HISTORY_PAGE_LIMIT,
|
|
239
265
|
GoogleAuthProvider,
|
|
240
266
|
GitHubAuthProvider,
|
|
@@ -242,6 +268,8 @@ export {
|
|
|
242
268
|
GITHUB_HOST,
|
|
243
269
|
GDRIVE_HOST,
|
|
244
270
|
FileTokenStore,
|
|
271
|
+
EXTENSION_MANIFEST_FILENAME,
|
|
272
|
+
EXTENSION_KINDS,
|
|
245
273
|
DEFAULT_PRINT_OPTS,
|
|
246
274
|
BuildError,
|
|
247
275
|
BUILT_IN_THEME_IDS,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAndReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-wvw2msvn.js";
|
|
4
4
|
import {
|
|
5
5
|
log
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-pw6z15yv.js";
|
|
7
7
|
import {
|
|
8
8
|
UsageError,
|
|
9
9
|
rejectExtraPositionals,
|
|
10
10
|
rejectUnknownFlags
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-v1ma3v2s.js";
|
|
12
|
+
import"./cli-4vtgt2ng.js";
|
|
13
13
|
import"./cli-c41yr7he.js";
|
|
14
14
|
import {
|
|
15
15
|
EXIT_CODES
|