gutterpress 0.10.8-beta.1 → 0.10.9-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 +88 -87
- package/dist/{README-aaqapam1.md → README-6c7fda1s.md} +9 -7
- package/dist/{README-mdq34cmb.md → README-jntqyj1z.md} +19 -10
- package/dist/api/index.d.ts +8 -8
- package/dist/api/index.js +46 -46
- package/dist/{audit-ckbmgzpk.js → audit-2x958vnj.js} +4 -4
- package/dist/{build-sgpyjx5n.js → build-dqv3505a.js} +5 -8
- package/dist/{cli-v1ma3v2s.js → cli-0tgbgwnj.js} +2 -9
- package/dist/{cli-4vtgt2ng.js → cli-bx950tb4.js} +7 -7
- package/dist/{cli-pfpb1t3h.js → cli-bzxqtvrk.js} +1 -2
- package/dist/{cli-pw6z15yv.js → cli-fwh6rkev.js} +1 -1
- package/dist/{cli-wvw2msvn.js → cli-vhdvkqdd.js} +2372 -2449
- package/dist/cli.js +24 -53
- package/dist/{doctor-59dwzq4r.js → doctor-55r0ghtc.js} +2 -2
- package/dist/{engine-daad33qn.js → engine-19mshh07.js} +2 -2
- package/dist/{engine-db8632w6.js → engine-d46wgg99.js} +3 -3
- package/dist/ext-04n7hydk.js +268 -0
- package/dist/{index-rpt4vtby.js → index-dhgzkhs7.js} +1 -1
- package/dist/{index-m00n6sz4.js → index-erwh3bww.js} +5292 -5430
- package/dist/{index-9pbaznww.js → index-zwcv1njy.js} +7 -7
- package/dist/index.js +47 -47
- package/dist/lib/build-runner.d.ts +0 -7
- package/dist/lib/cli-args.d.ts +0 -7
- package/dist/lib/{theme-import.d.ts → extension-import.d.ts} +20 -11
- package/dist/lib/extension-manager.d.ts +170 -0
- package/dist/lib/extension-manifest.d.ts +25 -17
- package/dist/lib/extension-specifier.d.ts +31 -0
- package/dist/lib/manifest-doc.d.ts +3 -9
- package/dist/lib/markdown/markers.d.ts +2 -2
- package/dist/lib/markdown/plugins.d.ts +4 -4
- package/dist/lib/presets.d.ts +1 -1
- package/dist/lib/publish/providers/gdrive.d.ts +1 -1
- package/dist/lib/snippets.d.ts +11 -15
- package/dist/lib/style-resolver.d.ts +1 -1
- package/dist/{lint-9xhz0bsw.js → lint-c7a4j3ww.js} +4 -4
- package/dist/{manifest.schema-1q35yxs9.json → manifest.schema-hsn8rsgr.json} +18 -53
- package/dist/{new-5drcm5am.js → new-pw3eez61.js} +11 -12
- package/dist/{plugin.test.js-mv0ghv5n.tpl → plugin.test.js-npnfhyca.tpl} +0 -1
- package/dist/{preflight-g31c4060.js → preflight-77zyws1q.js} +4 -4
- package/dist/preview/file-watcher.d.ts +4 -4
- package/dist/preview/lifecycle.d.ts +1 -1
- package/dist/{preview-w1pqpq2g.js → preview-x7qqhmxf.js} +6 -10
- package/dist/{publish-es72yhd8.js → publish-ms6abf6g.js} +4 -4
- package/dist/schema/manifest.types.d.ts +28 -44
- package/dist/{theme-cd6efzjw.json → theme-etj4gxck.json} +4 -1
- package/dist/{theme-tqfypc1w.json → theme-s2rg7xe7.json} +4 -1
- package/dist/{theme-xt0hjb1b.json → theme-vktedy8q.json} +4 -1
- package/dist/types.d.ts +0 -7
- package/dist/{validate-tsgprng7.js → validate-vw59jcq7.js} +4 -4
- package/package.json +1 -1
- package/dist/lib/plugin-manager.d.ts +0 -106
- package/dist/lib/theme-manager.d.ts +0 -242
- package/dist/plugin-sc6zfwre.js +0 -126
- package/dist/theme-msr4ctky.js +0 -323
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@ See [User Guide: Chapter 1 — Getting Started](https://github.com/dimm-city/gut
|
|
|
108
108
|
|
|
109
109
|
## Manifest
|
|
110
110
|
|
|
111
|
-
`manifest.yaml` is where you control everything that isn't authored in markdown — book title, the page-size preset, custom styles,
|
|
111
|
+
`manifest.yaml` is where you control everything that isn't authored in markdown — book title, the page-size preset, custom styles, extensions (looks and plugins), validation rules, PDF/X configuration. It is the only recognized project manifest filename. The schema lives in [`docs/schema-autocomplete.md`](https://github.com/dimm-city/gutterpress/blob/main/docs/schema-autocomplete.md) for YAML autocomplete in editors.
|
|
112
112
|
|
|
113
113
|
Minimal example:
|
|
114
114
|
|
|
@@ -133,10 +133,10 @@ The full configuration cascade is `CLI flags > manifest.yaml > preset defaults`.
|
|
|
133
133
|
|
|
134
134
|
## Commands
|
|
135
135
|
|
|
136
|
-
Gutterpress has
|
|
136
|
+
Gutterpress has 10 subcommands. `new`, `preview`, `build`, and `publish` are the
|
|
137
137
|
primary author commands; `lint`, `validate`, `audit`, and `preflight` are
|
|
138
|
-
CI / advanced checks;
|
|
139
|
-
project plugins
|
|
138
|
+
CI / advanced checks; `doctor` reports system readiness; and `ext` manages the
|
|
139
|
+
project's extensions (plugins, looks, component libraries). Every
|
|
140
140
|
command also accepts `--help` for the authoritative, always-current flag list
|
|
141
141
|
(`gutterpress <command> --help`) — this section is regenerated from the same
|
|
142
142
|
source.
|
|
@@ -198,7 +198,6 @@ gutterpress preview [input-dir] [options]
|
|
|
198
198
|
--skip-pre-validate Skip pre-build validation (pdf|pdfx only)
|
|
199
199
|
--skip-post-validate Skip post-build PDF/X validation (pdfx only)
|
|
200
200
|
--allow-shrink Build anyway when content is wider than the page content box (pdf|pdfx only)
|
|
201
|
-
--engine <name> native (default) | paged (deprecated) [overrides the manifest's engine: field; applies to the live preview AND --format pdf|pdfx]
|
|
202
201
|
```
|
|
203
202
|
|
|
204
203
|
### `gutterpress build`
|
|
@@ -219,7 +218,6 @@ gutterpress build [input-dir] [options]
|
|
|
219
218
|
--skip-pre-validate Skip pre-build validation
|
|
220
219
|
--skip-post-validate Skip post-build PDF/X validation
|
|
221
220
|
--allow-shrink Build anyway when content is wider than the page content box. Chromium then scales the WHOLE book down to fit it — the build reports that whole-document scale (e.g. "about 0.72x its declared size") plus every offender, as warnings.
|
|
222
|
-
--engine <name> native (default) | paged (deprecated) [overrides the manifest's engine: field; native = the Gutterpress engine, native Chromium pagination]
|
|
223
221
|
```
|
|
224
222
|
|
|
225
223
|
### `gutterpress publish`
|
|
@@ -334,94 +332,96 @@ Report the Gutterpress version, platform and config paths, and whether each exte
|
|
|
334
332
|
gutterpress doctor
|
|
335
333
|
```
|
|
336
334
|
|
|
337
|
-
### `gutterpress
|
|
335
|
+
### `gutterpress ext`
|
|
338
336
|
|
|
339
|
-
|
|
337
|
+
List, add, remove, enable, or disable the project's extensions. Markdown-it
|
|
338
|
+
plugins, looks (stylesheets) and component libraries are all extensions — one
|
|
339
|
+
`extensions:` list in `manifest.yaml`, in load order (see
|
|
340
|
+
[Extensions](#extensions) below). These are the same shared-lib functions the
|
|
341
|
+
desktop app's Look and Features views call, so an extension added from the
|
|
342
|
+
terminal is the same entry the GUI shows.
|
|
340
343
|
|
|
341
344
|
```sh
|
|
342
|
-
gutterpress
|
|
345
|
+
gutterpress ext
|
|
343
346
|
|
|
344
|
-
--help Show
|
|
347
|
+
--help Show ext subcommands (list, add, remove, enable, disable)
|
|
345
348
|
```
|
|
346
349
|
|
|
347
|
-
|
|
350
|
+
Every subcommand takes the project directory as an optional trailing
|
|
351
|
+
positional (default: the current directory).
|
|
348
352
|
|
|
349
|
-
|
|
350
|
-
verify their registry hashes, vendor the complete graph into the project, and
|
|
351
|
-
pin the exact root version. This does not invoke npm, Bun, Node.js tooling, or
|
|
352
|
-
package install scripts.
|
|
353
|
+
#### `gutterpress ext list`
|
|
353
354
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
### `gutterpress theme`
|
|
361
|
-
|
|
362
|
-
List, apply, import, revert, or remove project themes — the same
|
|
363
|
-
`applyTheme`/`importThemeFrom*`/`revertTheme`/`removeProjectTheme` functions
|
|
364
|
-
the desktop app's Theme panel calls, so a theme applied from the terminal is
|
|
365
|
-
just as switchable/revertible as one applied from the GUI.
|
|
355
|
+
List the project's extensions in load (= cascade) order: each specifier as
|
|
356
|
+
written, whether it is bundled, a path, or an npm package, what it carries
|
|
357
|
+
(markdown, styles, snippets, components), and any warning — not installed,
|
|
358
|
+
not found, not pinned.
|
|
366
359
|
|
|
367
360
|
```sh
|
|
368
|
-
gutterpress
|
|
369
|
-
|
|
370
|
-
--help Show theme subcommands
|
|
361
|
+
gutterpress ext list ./my-book
|
|
371
362
|
```
|
|
372
363
|
|
|
373
|
-
#### `gutterpress
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
364
|
+
#### `gutterpress ext add`
|
|
365
|
+
|
|
366
|
+
Add an extension. What `SOURCE` is decides what happens:
|
|
367
|
+
|
|
368
|
+
- an **npm package** (`name` or `name@version`) is downloaded straight from
|
|
369
|
+
the registry along with its runtime dependencies, hash-verified, vendored
|
|
370
|
+
into the project under `plugins/npm/` with a receipt, load-tested, and
|
|
371
|
+
written back pinned as `name@<exact version>`. This does not invoke npm,
|
|
372
|
+
Bun, Node.js tooling, or package install scripts;
|
|
373
|
+
- a **bundled feature** (`markdown-it-mark`, `markdown-it-sub`,
|
|
374
|
+
`markdown-it-sup`, `markdown-it-abbr`, `gutterpress-gfm-alerts`) is simply
|
|
375
|
+
listed — nothing to install, works offline;
|
|
376
|
+
- a **folder or plugin-file path** is load-tested and listed as a
|
|
377
|
+
manifest-relative path, referenced in place — never copied;
|
|
378
|
+
- a **`.zip` or `.css` file**, or an **http(s) URL**, is validated (every
|
|
379
|
+
declared sheet must exist and parse; print-safety findings are warnings)
|
|
380
|
+
and landed in `extensions/<id>/`, then listed as `./extensions/<id>`;
|
|
381
|
+
- with `--look`, `SOURCE` is a built-in look id, copied into
|
|
382
|
+
`extensions/<id>/` as the author's own editable files and listed.
|
|
383
|
+
|
|
384
|
+
Adding something already listed re-pins or updates that entry instead of
|
|
385
|
+
adding a second one.
|
|
377
386
|
|
|
378
387
|
```sh
|
|
379
|
-
gutterpress
|
|
380
|
-
```
|
|
388
|
+
gutterpress ext add <source> [dir] [options]
|
|
381
389
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
Apply a theme: a built-in id (`clean-book`, `zine`, `technical-doc`) is copied
|
|
385
|
-
into `themes/<id>/` the first time, and the manifest's `styles:` entry is
|
|
386
|
-
wired so its `theme.css` is the active stylesheet, keeping its cascade
|
|
387
|
-
position. Re-running `apply` with an id that is already a project theme makes
|
|
388
|
-
it active again without forking a second copy — the same non-destructive
|
|
389
|
-
re-apply guarantee the desktop's Theme panel relies on.
|
|
390
|
-
|
|
391
|
-
```sh
|
|
392
|
-
gutterpress theme apply clean-book ./my-book
|
|
393
|
-
gutterpress theme apply zine ./my-book
|
|
390
|
+
--export <name> Named module export to use as the plugin function (npm and path extensions only)
|
|
391
|
+
--look Treat SOURCE as a built-in look id (clean-book, zine, technical-doc): copy it into extensions/ and add it
|
|
394
392
|
```
|
|
395
393
|
|
|
396
|
-
#### `gutterpress theme import`
|
|
397
|
-
|
|
398
|
-
Import a theme from a local folder, a `.zip` package, a `.css` file, or an
|
|
399
|
-
`http(s)` URL. Importing vendors the theme under `themes/<id>/` but does not
|
|
400
|
-
apply it — follow up with `gutterpress theme apply <id>`.
|
|
401
|
-
|
|
402
394
|
```sh
|
|
403
|
-
gutterpress
|
|
404
|
-
gutterpress
|
|
405
|
-
gutterpress
|
|
406
|
-
gutterpress
|
|
395
|
+
gutterpress ext add markdown-it-highlightjs ./my-book
|
|
396
|
+
gutterpress ext add markdown-it-highlightjs@4.3.0 ./my-book
|
|
397
|
+
gutterpress ext add markdown-it-emoji@3.0.0 ./my-book --export full
|
|
398
|
+
gutterpress ext add markdown-it-mark ./my-book
|
|
399
|
+
gutterpress ext add ./plugins/field-notes ./my-book
|
|
400
|
+
gutterpress ext add zine ./my-book --look
|
|
401
|
+
gutterpress ext add ./parchment.zip ./my-book
|
|
402
|
+
gutterpress ext add https://example.com/looks/cool/ ./my-book
|
|
407
403
|
```
|
|
408
404
|
|
|
409
|
-
#### `gutterpress
|
|
405
|
+
#### `gutterpress ext remove`
|
|
410
406
|
|
|
411
|
-
|
|
412
|
-
|
|
407
|
+
Remove an extension from the manifest, by the specifier as written there (for
|
|
408
|
+
an npm package the bare name is enough). An npm extension's vendored copy
|
|
409
|
+
under `plugins/npm/` is deleted too; a path extension's folder is yours and is
|
|
410
|
+
never touched.
|
|
413
411
|
|
|
414
412
|
```sh
|
|
415
|
-
gutterpress
|
|
413
|
+
gutterpress ext remove markdown-it-highlightjs ./my-book
|
|
414
|
+
gutterpress ext remove ./extensions/zine ./my-book
|
|
416
415
|
```
|
|
417
416
|
|
|
418
|
-
#### `gutterpress
|
|
417
|
+
#### `gutterpress ext enable` / `gutterpress ext disable`
|
|
419
418
|
|
|
420
|
-
|
|
421
|
-
|
|
419
|
+
Turn a configured extension off without removing it (`disable` writes
|
|
420
|
+
`enabled: false` on the entry, so the toggle is reversible), or back on.
|
|
422
421
|
|
|
423
422
|
```sh
|
|
424
|
-
gutterpress
|
|
423
|
+
gutterpress ext disable markdown-it-mark ./my-book
|
|
424
|
+
gutterpress ext enable markdown-it-mark ./my-book
|
|
425
425
|
```
|
|
426
426
|
|
|
427
427
|
## Exit codes
|
|
@@ -435,44 +435,45 @@ Every command follows the same exit-code contract, so CI can branch on the resul
|
|
|
435
435
|
| `2` | Usage — the invocation itself was wrong: a bad flag, positional argument, preset, or value. |
|
|
436
436
|
| `3` | Pipeline — the build/render/export pipeline itself failed for a reason unrelated to usage or findings (I/O error, missing tool, renderer crash). |
|
|
437
437
|
|
|
438
|
-
This applies uniformly across `build`, `preview`, `lint`, `validate`, `preflight`, `audit`, `publish`, `
|
|
438
|
+
This applies uniformly across `build`, `preview`, `lint`, `validate`, `preflight`, `audit`, `publish`, `ext`, `new`, and `doctor`.
|
|
439
439
|
|
|
440
|
-
##
|
|
440
|
+
## Extensions
|
|
441
441
|
|
|
442
|
-
Gutterpress uses [markdown-it](https://github.com/markdown-it/markdown-it) under the hood, so pure-JavaScript plugins that follow the `(md, options) => void` signature work without a Gutterpress-specific API.
|
|
442
|
+
Gutterpress uses [markdown-it](https://github.com/markdown-it/markdown-it) under the hood, so pure-JavaScript plugins that follow the `(md, options) => void` signature work without a Gutterpress-specific API. Plugins, looks (stylesheets) and component libraries are all **extensions**: one `extensions:` list in `manifest.yaml`, in load order. Every entry is a bare specifier, and its form says what it is:
|
|
443
443
|
|
|
444
444
|
```yaml
|
|
445
|
-
|
|
446
|
-
#
|
|
447
|
-
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
- name: markdown-it-emoji
|
|
451
|
-
version: 3.0.0
|
|
452
|
-
export: full
|
|
453
|
-
# local file
|
|
445
|
+
extensions:
|
|
446
|
+
# a feature bundled with Gutterpress — nothing to install, works offline
|
|
447
|
+
- markdown-it-mark
|
|
448
|
+
# a folder or plugin file, relative to manifest.yaml — referenced in place
|
|
449
|
+
- ./extensions/clean-book
|
|
454
450
|
- ./plugins/my-custom-plugin.js
|
|
455
|
-
#
|
|
456
|
-
-
|
|
451
|
+
# an npm package, pinned to the exact version `gutterpress ext add` installed
|
|
452
|
+
- markdown-it-highlightjs@4.3.0
|
|
453
|
+
# the object form, only when an entry needs more than its specifier
|
|
454
|
+
- use: markdown-it-emoji@3.0.0
|
|
455
|
+
export: full # the plugin function is a named export
|
|
456
|
+
- use: markdown-it-anchor@9.2.0
|
|
457
457
|
options:
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
priority: 10
|
|
458
|
+
level: 2
|
|
459
|
+
- use: ./plugins/drafts.js
|
|
460
|
+
enabled: false # keep the entry, skip loading it
|
|
462
461
|
```
|
|
463
462
|
|
|
463
|
+
Order is load order: a later entry's markdown runs after earlier entries' (and sees their output) and its CSS wins ties; the project's own `styles:` always load after every extension. There is no `priority` and no `path:`/`name:` wrapper — a manifest still carrying `plugins:` fails with a message that prints the same entries rewritten as `extensions:`. The `engine:` and `engineStyles:` keys are gone too (there is one engine; move any `engineStyles` entries to the end of `styles:`).
|
|
464
|
+
|
|
464
465
|
Pinned npm packages and their runtime dependencies live under `plugins/npm/`,
|
|
465
466
|
with a receipt that records the exact graph and hashes the complete tree. They
|
|
466
467
|
travel with the project and builds never fetch from the registry. Install/build
|
|
467
468
|
scripts, native addon compilation, bundled `node_modules`, and non-registry
|
|
468
469
|
dependency selectors are intentionally unsupported. Only install packages you
|
|
469
|
-
trust:
|
|
470
|
+
trust: extensions run unsandboxed with the process's full filesystem and network
|
|
470
471
|
privileges.
|
|
471
472
|
|
|
472
|
-
Use the
|
|
473
|
+
Use the entry's `export` field, or `ext add --export <name>`, for packages
|
|
473
474
|
that expose a named plugin function instead of a default export.
|
|
474
475
|
|
|
475
|
-
See [User Guide: Chapter 5 — Plugins](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/05-plugins.md) for authoring custom plugins.
|
|
476
|
+
See [User Guide: Chapter 5 — Plugins](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/05-plugins.md) for the full list contract and for authoring custom plugins, and [Chapter 4 — Styling & Theming](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/04-styling-theming.md) for looks.
|
|
476
477
|
|
|
477
478
|
## CI / scripting
|
|
478
479
|
|
|
@@ -28,13 +28,15 @@ about to add a rule to the wrong sheet.
|
|
|
28
28
|
## Try it
|
|
29
29
|
|
|
30
30
|
```sh
|
|
31
|
-
gutterpress
|
|
32
|
-
gutterpress theme apply {{SLUG}} ../my-book
|
|
31
|
+
gutterpress ext add ./{{SLUG}} ../my-book
|
|
33
32
|
gutterpress preview ../my-book
|
|
34
33
|
```
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
`ext add` takes the book directory as its second POSITIONAL argument, not a
|
|
36
|
+
`--dir` flag. It lists the folder under the book's `extensions:` and references
|
|
37
|
+
it in place — nothing is copied, so keep editing here and the book follows.
|
|
38
|
+
The book's own `styles:` always load after every extension, so an author can
|
|
39
|
+
override any rule in this package from their `styles/book.css`.
|
|
38
40
|
|
|
39
41
|
Then in a chapter:
|
|
40
42
|
|
|
@@ -127,9 +129,9 @@ That asymmetry is the whole difference between the two kinds of package.
|
|
|
127
129
|
```
|
|
128
130
|
|
|
129
131
|
Each sheet then puts everything it owns inside its layer. The cascade is
|
|
130
|
-
settled by that one line rather than by which
|
|
131
|
-
splitting a sheet or reordering
|
|
132
|
-
wins.
|
|
132
|
+
settled by that one line rather than by which sheet `gutterpress.json`'s
|
|
133
|
+
`styles` lists last, so splitting a sheet or reordering that list can no
|
|
134
|
+
longer silently flip who wins.
|
|
133
135
|
|
|
134
136
|
The trap, and it catches everyone once: a rule left OUTSIDE all the layers is
|
|
135
137
|
fully unlayered, and unlayered CSS beats layered CSS at any specificity. So
|
|
@@ -25,14 +25,17 @@ bun test
|
|
|
25
25
|
Then wire it into a book. In the book's `manifest.yaml`:
|
|
26
26
|
|
|
27
27
|
```yaml
|
|
28
|
-
|
|
29
|
-
-
|
|
28
|
+
extensions:
|
|
29
|
+
- ./plugins/{{SLUG}}
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
`
|
|
32
|
+
`gutterpress ext add ./plugins/{{SLUG}} <book>` writes that line for you (the
|
|
33
|
+
book directory is the second positional argument). Either way the entry names
|
|
34
|
+
the FOLDER, not `plugin.js`. That is what makes Gutterpress read
|
|
33
35
|
`gutterpress.json` and pick up the stylesheet and snippets alongside the
|
|
34
36
|
markdown behaviour — point it at the `.js` file and you get the markdown and
|
|
35
|
-
nothing else.
|
|
37
|
+
nothing else. The folder is referenced in place, never copied: keep editing it
|
|
38
|
+
and the book follows.
|
|
36
39
|
|
|
37
40
|
Now `gutterpress preview` the book and write:
|
|
38
41
|
|
|
@@ -111,14 +114,20 @@ outcome, and another reason to prefix.
|
|
|
111
114
|
|
|
112
115
|
`styles/plugin.css` wraps everything in `@layer {{SLUG}}`.
|
|
113
116
|
|
|
114
|
-
|
|
115
|
-
unlayered rule beats a layered one at any
|
|
116
|
-
sheet outranks every rule in a book
|
|
117
|
+
Extension CSS lands in the book in `extensions:` list order, and always before
|
|
118
|
+
the book's own `styles:`. In CSS an unlayered rule beats a layered one at any
|
|
119
|
+
specificity. So an unlayered plugin sheet outranks every rule in a book whose
|
|
120
|
+
look uses the recommended
|
|
117
121
|
`@layer tokens, base, components, templates, pages, book;` convention — the
|
|
118
122
|
author edits their CSS and nothing happens.
|
|
119
123
|
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
Inside a layer, the book's own unlayered `styles:` always beat you, which is
|
|
125
|
+
right. Against the LOOK's layers, position decides: a layer sorts by where it
|
|
126
|
+
is first declared, so with this plugin listed above the look in `extensions:`
|
|
127
|
+
its layer sorts first and is the weakest thing in the book — the right place
|
|
128
|
+
for a plugin to sit. Listed below the look, its component rules win ties over
|
|
129
|
+
the look's layered rules instead. Either way the author moves one line to
|
|
130
|
+
change it; that is the whole point of the list.
|
|
122
131
|
|
|
123
132
|
Adopt it for the whole file: a rule left outside the layer is unlayered and
|
|
124
133
|
beats everything inside it, including your own.
|
|
@@ -152,4 +161,4 @@ Anything a book can reach works. Committing the folder into the book's
|
|
|
152
161
|
`plugins/` directory is the simplest and needs no registry at all.
|
|
153
162
|
|
|
154
163
|
To publish to npm, `npm publish` this folder and have readers install it with
|
|
155
|
-
`gutterpress
|
|
164
|
+
`gutterpress ext add {{SLUG}}`.
|
package/dist/api/index.d.ts
CHANGED
|
@@ -33,14 +33,14 @@ export { listBuiltInTemplates, listCustomTemplates, saveProjectAsTemplate, impor
|
|
|
33
33
|
export type { TemplateInfo, SaveProjectAsTemplateOptions, } from "../lib/project-templates.ts";
|
|
34
34
|
export { extractVariables, substituteVariables, listSnippets, readSnippet, saveSnippet, deleteSnippet, listMergedSnippets, readExtensionSnippet, SNIPPETS_DIR, } from "../lib/snippets.ts";
|
|
35
35
|
export type { SnippetEntry, SnippetSource } from "../lib/snippets.ts";
|
|
36
|
-
export {
|
|
37
|
-
export type {
|
|
38
|
-
export {
|
|
39
|
-
export type {
|
|
40
|
-
export {
|
|
41
|
-
export type {
|
|
42
|
-
export { EXTENSION_MANIFEST_FILENAME, LEGACY_THEME_MANIFEST_FILENAME, readExtensionMeta, extensionStyleList,
|
|
43
|
-
export type { ExtensionMetadata, ResolvedExtension } from "../lib/extension-manifest.ts";
|
|
36
|
+
export { listProjectExtensions, describeExtension, addExtension, removeExtension, setExtensionEnabled, reorderExtensions, validateProjectExtensions, readExtensionCss, listBuiltInStyleSets, addBuiltInStyleSet, sameExtension, RECOMMENDED_EXTENSIONS, BUILT_IN_STYLE_SET_IDS, EXTENSIONS_DIR, PLUGINS_DIR, } from "../lib/extension-manager.ts";
|
|
37
|
+
export type { ProjectExtensionEntry, ExtensionValidationResult, RecommendedExtension, ExtensionSourceKind, BuiltInStyleSet, BuiltInStyleSetId, AddExtensionOptions, } from "../lib/extension-manager.ts";
|
|
38
|
+
export { BUNDLED_EXTENSIONS, isBundledExtension, isPathSpecifier, parseExtensionSpecifier, } from "../lib/extension-specifier.ts";
|
|
39
|
+
export type { ParsedExtensionSpecifier } from "../lib/extension-specifier.ts";
|
|
40
|
+
export { importExtensionFromFile, importExtensionFromUrl } from "../lib/extension-import.ts";
|
|
41
|
+
export type { ExtensionImportResult, ExtensionImportWarning } from "../lib/extension-import.ts";
|
|
42
|
+
export { EXTENSION_MANIFEST_FILENAME, LEGACY_THEME_MANIFEST_FILENAME, readExtensionMeta, extensionStyleList, extensionStyleListWithDefault, extensionCarries, assertExtensionContained, pathEscapesFolder, resolveExtension, } from "../lib/extension-manifest.ts";
|
|
43
|
+
export type { ExtensionMetadata, ResolvedExtension, ExtensionCarries, } from "../lib/extension-manifest.ts";
|
|
44
44
|
export { listProjectStyles, resolveActiveStyles } from "../lib/style-resolver.ts";
|
|
45
45
|
export type { ProjectStyle } from "../lib/style-resolver.ts";
|
|
46
46
|
export { readManifestFields, setManifestFields, setActiveStyles, } from "../lib/manifest-config.ts";
|
package/dist/api/index.js
CHANGED
|
@@ -6,8 +6,10 @@ import {
|
|
|
6
6
|
AUTO_SYNC_MAX_MINUTES,
|
|
7
7
|
AUTO_SYNC_MIN_MINUTES,
|
|
8
8
|
AUTO_SYNC_PUSH_INTERVAL_MINUTES,
|
|
9
|
+
BUILT_IN_STYLE_SET_IDS,
|
|
9
10
|
BUILT_IN_TEMPLATE_IDS,
|
|
10
|
-
|
|
11
|
+
BUNDLED_EXTENSIONS,
|
|
12
|
+
EXTENSIONS_DIR,
|
|
11
13
|
EXTENSION_KINDS,
|
|
12
14
|
EXTENSION_MANIFEST_FILENAME,
|
|
13
15
|
FileTokenStore,
|
|
@@ -22,17 +24,15 @@ import {
|
|
|
22
24
|
PRESETS,
|
|
23
25
|
PRESET_IDS,
|
|
24
26
|
PublishSelectionsStore,
|
|
25
|
-
|
|
27
|
+
RECOMMENDED_EXTENSIONS,
|
|
26
28
|
RESERVED_PREFIX,
|
|
27
29
|
SNIPPETS_DIR,
|
|
28
30
|
SYNC_SNAPSHOT_MESSAGE,
|
|
29
31
|
TARGETS,
|
|
30
32
|
TARGET_IDS,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
addNpmPlugin,
|
|
33
|
+
addBuiltInStyleSet,
|
|
34
|
+
addExtension,
|
|
34
35
|
adoptFolder,
|
|
35
|
-
applyTheme,
|
|
36
36
|
assertExtensionContained,
|
|
37
37
|
autoSnapshotDelayMs,
|
|
38
38
|
autoSyncDelayMs,
|
|
@@ -42,40 +42,40 @@ import {
|
|
|
42
42
|
connectPublishProvider,
|
|
43
43
|
defaultConfigDir,
|
|
44
44
|
deleteSnippet,
|
|
45
|
-
|
|
45
|
+
describeExtension,
|
|
46
46
|
diagnoseProjectRemote,
|
|
47
47
|
disconnectPublishCredential,
|
|
48
48
|
escapeYamlScalar,
|
|
49
|
-
|
|
49
|
+
extensionCarries,
|
|
50
50
|
extensionStyleList,
|
|
51
|
+
extensionStyleListWithDefault,
|
|
51
52
|
extractUrlCredential,
|
|
52
53
|
extractVariables,
|
|
53
54
|
forgeKindForHost,
|
|
54
|
-
getActiveTheme,
|
|
55
|
-
getPreviousTheme,
|
|
56
55
|
getSystemDiagnostics,
|
|
57
56
|
hasProjectManifest,
|
|
57
|
+
importExtensionFromFile,
|
|
58
|
+
importExtensionFromUrl,
|
|
58
59
|
importTemplateFromFolder,
|
|
59
|
-
|
|
60
|
-
importThemeFromFolder,
|
|
61
|
-
importThemeFromUrl,
|
|
60
|
+
isBundledExtension,
|
|
62
61
|
isGitInternalPath,
|
|
62
|
+
isPathSpecifier,
|
|
63
63
|
isSshRemoteUrl,
|
|
64
64
|
knownForgeTokenUrl,
|
|
65
|
+
listBuiltInStyleSets,
|
|
65
66
|
listBuiltInTemplates,
|
|
66
|
-
listBuiltInThemes,
|
|
67
67
|
listCustomTemplates,
|
|
68
68
|
listGitHubBranches,
|
|
69
69
|
listGitHubRepositories,
|
|
70
70
|
listMergedSnippets,
|
|
71
|
-
|
|
71
|
+
listProjectExtensions,
|
|
72
72
|
listProjectStyles,
|
|
73
|
-
listProjectThemes,
|
|
74
73
|
listPublishAccounts,
|
|
75
74
|
listPublishProviders,
|
|
76
75
|
listRepoBooks,
|
|
77
76
|
listSnippets,
|
|
78
77
|
loadManifestWithPath,
|
|
78
|
+
parseExtensionSpecifier,
|
|
79
79
|
parseRemoteOrigin,
|
|
80
80
|
pathEscapesFolder,
|
|
81
81
|
pkceChallengeFromVerifier,
|
|
@@ -83,16 +83,16 @@ import {
|
|
|
83
83
|
publishCredentialKey,
|
|
84
84
|
publishProviderFor,
|
|
85
85
|
publishTargetFor,
|
|
86
|
+
readExtensionCss,
|
|
86
87
|
readExtensionMeta,
|
|
87
88
|
readExtensionSnippet,
|
|
88
89
|
readManifestFields,
|
|
89
90
|
readPublishSettings,
|
|
90
91
|
readSnippet,
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
removeExtension,
|
|
93
|
+
reorderExtensions,
|
|
93
94
|
requireGoogleClientCredentials,
|
|
94
95
|
resolveActiveStyles,
|
|
95
|
-
resolveBuiltInTheme,
|
|
96
96
|
resolveConfig,
|
|
97
97
|
resolveExtension,
|
|
98
98
|
resolveExtensionPrefix,
|
|
@@ -101,18 +101,18 @@ import {
|
|
|
101
101
|
resolveGoogleClientSecret,
|
|
102
102
|
resolvePublishFormat,
|
|
103
103
|
resolvePublishRequest,
|
|
104
|
-
revertTheme,
|
|
105
104
|
revokeGoogleCredential,
|
|
106
105
|
runBuild,
|
|
107
106
|
runPublish,
|
|
107
|
+
sameExtension,
|
|
108
108
|
sanitizeCloneFolderName,
|
|
109
109
|
saveProjectAsTemplate,
|
|
110
110
|
saveSnippet,
|
|
111
111
|
scaffoldExtension,
|
|
112
112
|
scaffoldProject,
|
|
113
113
|
setActiveStyles,
|
|
114
|
+
setExtensionEnabled,
|
|
114
115
|
setManifestFields,
|
|
115
|
-
setPluginEnabled,
|
|
116
116
|
setPublishProviderConfig,
|
|
117
117
|
slugifyProjectName,
|
|
118
118
|
splitOutPath,
|
|
@@ -120,13 +120,13 @@ import {
|
|
|
120
120
|
substituteVariables,
|
|
121
121
|
syncProject,
|
|
122
122
|
testRemoteAccess,
|
|
123
|
-
|
|
124
|
-
} from "../index-
|
|
123
|
+
validateProjectExtensions
|
|
124
|
+
} from "../index-erwh3bww.js";
|
|
125
125
|
import {
|
|
126
126
|
BuildError,
|
|
127
127
|
DEFAULT_PRINT_OPTS,
|
|
128
128
|
readyProbeExpr
|
|
129
|
-
} from "../index-
|
|
129
|
+
} from "../index-zwcv1njy.js";
|
|
130
130
|
import {
|
|
131
131
|
AUTO_SNAPSHOT_MESSAGE,
|
|
132
132
|
HISTORY_PAGE_LIMIT,
|
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
} from "../index-v5mp7a6q.js";
|
|
146
146
|
import"../index-37x76zdn.js";
|
|
147
147
|
export {
|
|
148
|
-
|
|
148
|
+
validateProjectExtensions,
|
|
149
149
|
testRemoteAccess,
|
|
150
150
|
syncProject,
|
|
151
151
|
substituteVariables,
|
|
@@ -153,18 +153,18 @@ export {
|
|
|
153
153
|
splitOutPath,
|
|
154
154
|
slugifyProjectName,
|
|
155
155
|
setPublishProviderConfig,
|
|
156
|
-
setPluginEnabled,
|
|
157
156
|
setManifestFields,
|
|
157
|
+
setExtensionEnabled,
|
|
158
158
|
setActiveStyles,
|
|
159
159
|
scaffoldProject,
|
|
160
160
|
scaffoldExtension,
|
|
161
161
|
saveSnippet,
|
|
162
162
|
saveProjectAsTemplate,
|
|
163
163
|
sanitizeCloneFolderName,
|
|
164
|
+
sameExtension,
|
|
164
165
|
runPublish,
|
|
165
166
|
runBuild,
|
|
166
167
|
revokeGoogleCredential,
|
|
167
|
-
revertTheme,
|
|
168
168
|
restoreVersionWithBackup,
|
|
169
169
|
resolvePublishRequest,
|
|
170
170
|
resolvePublishFormat,
|
|
@@ -175,19 +175,19 @@ export {
|
|
|
175
175
|
resolveExtensionPrefix,
|
|
176
176
|
resolveExtension,
|
|
177
177
|
resolveConfig,
|
|
178
|
-
resolveBuiltInTheme,
|
|
179
178
|
resolveActiveStyles,
|
|
180
179
|
requireGoogleClientCredentials,
|
|
181
180
|
repoSubPath,
|
|
182
181
|
repoRootForSource,
|
|
183
|
-
|
|
182
|
+
reorderExtensions,
|
|
183
|
+
removeExtension,
|
|
184
184
|
readyProbeExpr,
|
|
185
|
-
readThemeCss,
|
|
186
185
|
readSnippet,
|
|
187
186
|
readPublishSettings,
|
|
188
187
|
readManifestFields,
|
|
189
188
|
readExtensionSnippet,
|
|
190
189
|
readExtensionMeta,
|
|
190
|
+
readExtensionCss,
|
|
191
191
|
publishTargetFor,
|
|
192
192
|
publishProviderFor,
|
|
193
193
|
publishCredentialKey,
|
|
@@ -196,43 +196,43 @@ export {
|
|
|
196
196
|
pkceChallengeFromVerifier,
|
|
197
197
|
pathEscapesFolder,
|
|
198
198
|
parseRemoteOrigin,
|
|
199
|
+
parseExtensionSpecifier,
|
|
199
200
|
loadManifestWithPath,
|
|
200
201
|
listSnippets,
|
|
201
202
|
listRepoBooks,
|
|
202
203
|
listPublishProviders,
|
|
203
204
|
listPublishAccounts,
|
|
204
|
-
listProjectThemes,
|
|
205
205
|
listProjectStyles,
|
|
206
|
-
|
|
206
|
+
listProjectExtensions,
|
|
207
207
|
listMergedSnippets,
|
|
208
208
|
listGitHubRepositories,
|
|
209
209
|
listGitHubBranches,
|
|
210
210
|
listCustomTemplates,
|
|
211
|
-
listBuiltInThemes,
|
|
212
211
|
listBuiltInTemplates,
|
|
212
|
+
listBuiltInStyleSets,
|
|
213
213
|
knownForgeTokenUrl,
|
|
214
214
|
isSshRemoteUrl,
|
|
215
|
+
isPathSpecifier,
|
|
215
216
|
isNoChangesError,
|
|
216
217
|
isGitInternalPath,
|
|
217
|
-
|
|
218
|
-
importThemeFromFolder,
|
|
219
|
-
importThemeFromFile,
|
|
218
|
+
isBundledExtension,
|
|
220
219
|
importTemplateFromFolder,
|
|
220
|
+
importExtensionFromUrl,
|
|
221
|
+
importExtensionFromFile,
|
|
221
222
|
hasProjectManifest,
|
|
222
223
|
getSystemDiagnostics,
|
|
223
|
-
getPreviousTheme,
|
|
224
|
-
getActiveTheme,
|
|
225
224
|
forgeKindForHost,
|
|
226
225
|
findEnclosingRepoDir,
|
|
227
226
|
extractVariables,
|
|
228
227
|
extractUrlCredential,
|
|
228
|
+
extensionStyleListWithDefault,
|
|
229
229
|
extensionStyleList,
|
|
230
|
-
|
|
230
|
+
extensionCarries,
|
|
231
231
|
escapeYamlScalar,
|
|
232
232
|
disconnectPublishCredential,
|
|
233
233
|
diagnoseProjectRemote,
|
|
234
234
|
detectProjectSource,
|
|
235
|
-
|
|
235
|
+
describeExtension,
|
|
236
236
|
deleteSnippet,
|
|
237
237
|
defaultConfigDir,
|
|
238
238
|
connectPublishProvider,
|
|
@@ -243,18 +243,16 @@ export {
|
|
|
243
243
|
autoSyncDelayMs,
|
|
244
244
|
autoSnapshotDelayMs,
|
|
245
245
|
assertExtensionContained,
|
|
246
|
-
applyTheme,
|
|
247
246
|
adoptFolder,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
THEMES_DIR,
|
|
247
|
+
addExtension,
|
|
248
|
+
addBuiltInStyleSet,
|
|
251
249
|
TARGET_IDS,
|
|
252
250
|
TARGETS,
|
|
253
251
|
SYNC_SNAPSHOT_MESSAGE,
|
|
254
252
|
SNIPPETS_DIR,
|
|
255
253
|
RESTORE_BACKUP_MESSAGE,
|
|
256
254
|
RESERVED_PREFIX,
|
|
257
|
-
|
|
255
|
+
RECOMMENDED_EXTENSIONS,
|
|
258
256
|
PublishSelectionsStore,
|
|
259
257
|
PRESET_IDS,
|
|
260
258
|
PRESETS,
|
|
@@ -270,10 +268,12 @@ export {
|
|
|
270
268
|
FileTokenStore,
|
|
271
269
|
EXTENSION_MANIFEST_FILENAME,
|
|
272
270
|
EXTENSION_KINDS,
|
|
271
|
+
EXTENSIONS_DIR,
|
|
273
272
|
DEFAULT_PRINT_OPTS,
|
|
274
273
|
BuildError,
|
|
275
|
-
|
|
274
|
+
BUNDLED_EXTENSIONS,
|
|
276
275
|
BUILT_IN_TEMPLATE_IDS,
|
|
276
|
+
BUILT_IN_STYLE_SET_IDS,
|
|
277
277
|
AUTO_SYNC_PUSH_INTERVAL_MINUTES,
|
|
278
278
|
AUTO_SYNC_MIN_MINUTES,
|
|
279
279
|
AUTO_SYNC_MAX_MINUTES,
|