gutterpress 0.10.6 → 0.10.7-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 +71 -3
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +4 -2
- package/dist/{audit-0a4sp2w5.js → audit-82jr4qhw.js} +4 -4
- package/dist/{build-z53bbxtx.js → build-e53pjtez.js} +4 -4
- package/dist/checks/source/css-ownership.d.ts +43 -0
- package/dist/checks/source/index.d.ts +1 -0
- package/dist/{cli-he23vgjj.js → cli-08psmhr5.js} +15 -2
- package/dist/{cli-m99hj80k.js → cli-mk1s46mx.js} +1 -1
- package/dist/{cli-bwbs3qm4.js → cli-s8q42x3r.js} +1 -1
- package/dist/{cli-kwt5ftvc.js → cli-w6h5zegm.js} +4991 -3933
- package/dist/cli.js +70 -37
- package/dist/{doctor-d8vpv1pt.js → doctor-50j69ryq.js} +2 -2
- package/dist/{engine-4ctgbwj5.js → engine-88mynx9a.js} +2 -2
- package/dist/{engine-bhhcne06.js → engine-pb6h089e.js} +1 -1
- package/dist/{index-k5hcp8wj.js → index-837htyjy.js} +1 -1
- package/dist/{index-1rcfsx67.js → index-9zf8mtk7.js} +2586 -2073
- package/dist/{index-eyzv51dw.js → index-a0xpm188.js} +1 -1
- package/dist/index.js +5 -3
- package/dist/lib/cli-args.d.ts +9 -0
- package/dist/lib/manifest-doc.d.ts +8 -2
- package/dist/lib/markdown/assemble.d.ts +24 -7
- package/dist/lib/markdown/gfm-alerts.d.ts +7 -0
- package/dist/lib/markdown/gutterpress-css.d.ts +1 -1
- package/dist/lib/markdown/index.d.ts +16 -0
- package/dist/lib/markdown/plugins.d.ts +8 -12
- package/dist/lib/markdown/renderer.d.ts +48 -1
- package/dist/lib/style-declarations.d.ts +20 -0
- package/dist/lib/style-resolver.d.ts +2 -0
- package/dist/lib/theme-manager.d.ts +110 -9
- package/dist/{lint-nm57gn26.js → lint-zbymjr1z.js} +4 -4
- package/dist/{manifest.schema-hn6ac0ae.json → manifest.schema-kwnrwv8b.json} +11 -8
- package/dist/{new-sawc7zh4.js → new-78j4mx60.js} +4 -4
- package/dist/{plugin-p8yghztz.js → plugin-rahnkax3.js} +5 -11
- package/dist/{preflight-48kwf2pm.js → preflight-qdmqf3j6.js} +4 -4
- package/dist/{preview-10r4dk3d.js → preview-yekma94n.js} +4 -4
- package/dist/{publish-cd05sbdx.js → publish-tm2rqyme.js} +4 -4
- package/dist/render.js +155 -52
- package/dist/schema/manifest.types.d.ts +20 -7
- package/dist/theme-j7f6aegv.js +323 -0
- package/dist/{validate-70ta3br9.js → validate-3ztxavd0.js} +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -133,9 +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 11 subcommands. `new`, `preview`, `build`, and `publish` are the
|
|
137
137
|
primary author commands; `lint`, `validate`, `audit`, and `preflight` are
|
|
138
|
-
CI / advanced checks; and `doctor` reports system readiness. `plugin` manages
|
|
138
|
+
CI / advanced checks; and `doctor` reports system readiness. `plugin` manages
|
|
139
|
+
project plugins and `theme` manages project themes. Every
|
|
139
140
|
command also accepts `--help` for the authoritative, always-current flag list
|
|
140
141
|
(`gutterpress <command> --help`) — this section is regenerated from the same
|
|
141
142
|
source.
|
|
@@ -349,6 +350,73 @@ gutterpress plugin add markdown-it-highlightjs@4.3.0 ./my-book
|
|
|
349
350
|
gutterpress plugin add markdown-it-emoji@3.0.0 ./my-book --export full
|
|
350
351
|
```
|
|
351
352
|
|
|
353
|
+
### `gutterpress theme`
|
|
354
|
+
|
|
355
|
+
List, apply, import, revert, or remove project themes — the same
|
|
356
|
+
`applyTheme`/`importThemeFrom*`/`revertTheme`/`removeProjectTheme` functions
|
|
357
|
+
the desktop app's Theme panel calls, so a theme applied from the terminal is
|
|
358
|
+
just as switchable/revertible as one applied from the GUI.
|
|
359
|
+
|
|
360
|
+
```sh
|
|
361
|
+
gutterpress theme
|
|
362
|
+
|
|
363
|
+
--help Show theme subcommands
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
#### `gutterpress theme list`
|
|
367
|
+
|
|
368
|
+
List the built-in themes, the themes already vendored into this project
|
|
369
|
+
(`themes/<id>/`), and which one (if any) is active.
|
|
370
|
+
|
|
371
|
+
```sh
|
|
372
|
+
gutterpress theme list ./my-book
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
#### `gutterpress theme apply`
|
|
376
|
+
|
|
377
|
+
Apply a theme: a built-in id (`clean-book`, `zine`, `technical-doc`) is copied
|
|
378
|
+
into `themes/<id>/` the first time, and the manifest's `styles:` entry is
|
|
379
|
+
wired so its `theme.css` is the active stylesheet, keeping its cascade
|
|
380
|
+
position. Re-running `apply` with an id that is already a project theme makes
|
|
381
|
+
it active again without forking a second copy — the same non-destructive
|
|
382
|
+
re-apply guarantee the desktop's Theme panel relies on.
|
|
383
|
+
|
|
384
|
+
```sh
|
|
385
|
+
gutterpress theme apply clean-book ./my-book
|
|
386
|
+
gutterpress theme apply zine ./my-book
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
#### `gutterpress theme import`
|
|
390
|
+
|
|
391
|
+
Import a theme from a local folder, a `.zip` package, a `.css` file, or an
|
|
392
|
+
`http(s)` URL. Importing vendors the theme under `themes/<id>/` but does not
|
|
393
|
+
apply it — follow up with `gutterpress theme apply <id>`.
|
|
394
|
+
|
|
395
|
+
```sh
|
|
396
|
+
gutterpress theme import ./my-theme-folder ./my-book
|
|
397
|
+
gutterpress theme import ./my-theme.zip ./my-book
|
|
398
|
+
gutterpress theme import ./my-theme.css ./my-book
|
|
399
|
+
gutterpress theme import https://example.com/themes/cool/ ./my-book
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
#### `gutterpress theme revert`
|
|
403
|
+
|
|
404
|
+
Re-apply the theme that was active immediately before the current one.
|
|
405
|
+
Reverting twice toggles back — it is a swap, not a history stack.
|
|
406
|
+
|
|
407
|
+
```sh
|
|
408
|
+
gutterpress theme revert ./my-book
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
#### `gutterpress theme remove`
|
|
412
|
+
|
|
413
|
+
Remove a project theme (never a built-in). If it was the active theme, its
|
|
414
|
+
manifest `styles:` entry is dropped too, leaving no theme active.
|
|
415
|
+
|
|
416
|
+
```sh
|
|
417
|
+
gutterpress theme remove zine ./my-book
|
|
418
|
+
```
|
|
419
|
+
|
|
352
420
|
## Exit codes
|
|
353
421
|
|
|
354
422
|
Every command follows the same exit-code contract, so CI can branch on the result without parsing output:
|
|
@@ -360,7 +428,7 @@ Every command follows the same exit-code contract, so CI can branch on the resul
|
|
|
360
428
|
| `2` | Usage — the invocation itself was wrong: a bad flag, positional argument, preset, or value. |
|
|
361
429
|
| `3` | Pipeline — the build/render/export pipeline itself failed for a reason unrelated to usage or findings (I/O error, missing tool, renderer crash). |
|
|
362
430
|
|
|
363
|
-
This applies uniformly across `build`, `preview`, `lint`, `validate`, `preflight`, `audit`, `publish`, `plugin`, `new`, and `doctor`.
|
|
431
|
+
This applies uniformly across `build`, `preview`, `lint`, `validate`, `preflight`, `audit`, `publish`, `plugin`, `theme`, `new`, and `doctor`.
|
|
364
432
|
|
|
365
433
|
## Plugins
|
|
366
434
|
|
package/dist/api/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export { extractVariables, substituteVariables, listSnippets, readSnippet, saveS
|
|
|
33
33
|
export type { SnippetEntry } from "../lib/snippets.ts";
|
|
34
34
|
export { listProjectPlugins, setPluginEnabled, addLocalPlugin, addNpmPlugin, validateProjectPlugins, RECOMMENDED_PLUGINS, PLUGINS_DIR, } from "../lib/plugin-manager.ts";
|
|
35
35
|
export type { ProjectPluginEntry, PluginValidationResult, RecommendedPlugin, PluginKind, } from "../lib/plugin-manager.ts";
|
|
36
|
-
export { listBuiltInThemes, resolveBuiltInTheme, listProjectThemes, getActiveTheme, applyTheme, importThemeFromFolder, importThemeFromUrl, readThemeCss, removeProjectTheme, getPreviousTheme, revertTheme, BUILT_IN_THEME_IDS, THEMES_DIR, } from "../lib/theme-manager.ts";
|
|
36
|
+
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
37
|
export type { ThemeInfo, ThemeMetadata, ResolvedTheme, ApplyThemeTarget, BuiltInThemeId, } from "../lib/theme-manager.ts";
|
|
38
38
|
export { importThemeFromFile } from "../lib/theme-import.ts";
|
|
39
39
|
export type { ThemeImportResult, ThemeImportWarning } from "../lib/theme-import.ts";
|
package/dist/api/index.js
CHANGED
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
connectPublishProvider,
|
|
38
38
|
defaultConfigDir,
|
|
39
39
|
deleteSnippet,
|
|
40
|
+
detectLegacyForkedTheme,
|
|
40
41
|
diagnoseProjectRemote,
|
|
41
42
|
disconnectPublishCredential,
|
|
42
43
|
escapeYamlScalar,
|
|
@@ -106,12 +107,12 @@ import {
|
|
|
106
107
|
syncProject,
|
|
107
108
|
testRemoteAccess,
|
|
108
109
|
validateProjectPlugins
|
|
109
|
-
} from "../index-
|
|
110
|
+
} from "../index-9zf8mtk7.js";
|
|
110
111
|
import {
|
|
111
112
|
BuildError,
|
|
112
113
|
DEFAULT_PRINT_OPTS,
|
|
113
114
|
readyProbeExpr
|
|
114
|
-
} from "../index-
|
|
115
|
+
} from "../index-837htyjy.js";
|
|
115
116
|
import {
|
|
116
117
|
AUTO_SNAPSHOT_MESSAGE,
|
|
117
118
|
HISTORY_PAGE_LIMIT,
|
|
@@ -208,6 +209,7 @@ export {
|
|
|
208
209
|
disconnectPublishCredential,
|
|
209
210
|
diagnoseProjectRemote,
|
|
210
211
|
detectProjectSource,
|
|
212
|
+
detectLegacyForkedTheme,
|
|
211
213
|
deleteSnippet,
|
|
212
214
|
defaultConfigDir,
|
|
213
215
|
connectPublishProvider,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAndReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-w6h5zegm.js";
|
|
4
4
|
import {
|
|
5
5
|
log
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-mk1s46mx.js";
|
|
7
7
|
import {
|
|
8
8
|
UsageError,
|
|
9
9
|
rejectExtraPositionals,
|
|
10
10
|
rejectUnknownFlags
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-08psmhr5.js";
|
|
12
|
+
import"./cli-s8q42x3r.js";
|
|
13
13
|
import"./cli-c41yr7he.js";
|
|
14
14
|
import {
|
|
15
15
|
EXIT_CODES
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuild,
|
|
3
3
|
splitOutPath
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-w6h5zegm.js";
|
|
5
5
|
import {
|
|
6
6
|
log
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-mk1s46mx.js";
|
|
8
8
|
import {
|
|
9
9
|
UsageError,
|
|
10
10
|
parseEngine,
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
parsePdfxFlavor,
|
|
13
13
|
rejectExtraPositionals,
|
|
14
14
|
rejectUnknownFlags
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
15
|
+
} from "./cli-08psmhr5.js";
|
|
16
|
+
import"./cli-s8q42x3r.js";
|
|
17
17
|
import"./cli-c41yr7he.js";
|
|
18
18
|
import {
|
|
19
19
|
BuildError
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Check } from "../types";
|
|
2
|
+
/** One file's rules in the contract. Every key is optional — a file entry
|
|
3
|
+
* with none of these is legal (and pointless) but never an error. */
|
|
4
|
+
export interface CssContractFileRules {
|
|
5
|
+
/**
|
|
6
|
+
* Closed allow-list for this file's TOP-LEVEL content only (direct children
|
|
7
|
+
* of the stylesheet root — deliberately not recursive into `@media`/
|
|
8
|
+
* `@supports`, keeping this a check on the file's own flat structure, not a
|
|
9
|
+
* search through every possible nesting). A plain entry (e.g. ":root")
|
|
10
|
+
* matches a top-level rule's selector, trimmed, exactly. An `@`-prefixed
|
|
11
|
+
* entry (e.g. "@font-face") matches a top-level at-rule's name. Anything
|
|
12
|
+
* else at the top level is a violation.
|
|
13
|
+
*/
|
|
14
|
+
allow?: string[];
|
|
15
|
+
/** Property names (case-insensitive) that must never be declared anywhere
|
|
16
|
+
* in this file, independent of any ownership claim below. */
|
|
17
|
+
"forbid-properties"?: string[];
|
|
18
|
+
/**
|
|
19
|
+
* Property names this file exclusively owns. Checked project-wide: ANY
|
|
20
|
+
* OTHER css file passed to this check (whether or not that file has its
|
|
21
|
+
* own contract entry) that declares one of these properties is flagged —
|
|
22
|
+
* the whole point being that a collision can appear in a file nobody
|
|
23
|
+
* thought to annotate.
|
|
24
|
+
*/
|
|
25
|
+
"owns-properties"?: string[];
|
|
26
|
+
/** Same mechanism as `owns-properties`, keyed by at-rule name (without the
|
|
27
|
+
* leading `@`, e.g. "page" for `@page`). */
|
|
28
|
+
"owns-at-rules"?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Regex source strings (case-insensitive). A rule is flagged when one of
|
|
31
|
+
* its comma-separated selector branches matches a pattern AND nothing
|
|
32
|
+
* precedes the match in that branch — i.e. the matched class/pattern is the
|
|
33
|
+
* outermost compound selector, with no page/chapter/section ancestor
|
|
34
|
+
* qualifying it. `.page .dc-callout` is scoped and passes; a bare
|
|
35
|
+
* `.dc-callout` does not.
|
|
36
|
+
*/
|
|
37
|
+
"forbid-unscoped-selectors"?: string[];
|
|
38
|
+
}
|
|
39
|
+
export interface CssContract {
|
|
40
|
+
files?: Record<string, CssContractFileRules>;
|
|
41
|
+
}
|
|
42
|
+
declare const check: Check;
|
|
43
|
+
export default check;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
// package.json
|
|
5
5
|
var package_default = {
|
|
6
6
|
name: "gutterpress",
|
|
7
|
-
version: "0.10.
|
|
7
|
+
version: "0.10.7-beta.1",
|
|
8
8
|
description: "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
|
|
9
9
|
author: "itlackey",
|
|
10
10
|
license: "MPL-2.0",
|
|
@@ -105,6 +105,9 @@ var package_default = {
|
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
+
// src/lib/cli-args.ts
|
|
109
|
+
import { resolve } from "node:path";
|
|
110
|
+
|
|
108
111
|
// src/constants.ts
|
|
109
112
|
var NETWORK = {
|
|
110
113
|
DEFAULT_PORT: 3579
|
|
@@ -273,5 +276,15 @@ function resolvePort(raw) {
|
|
|
273
276
|
}
|
|
274
277
|
return n;
|
|
275
278
|
}
|
|
279
|
+
function exitForUsage(error) {
|
|
280
|
+
if (error instanceof UsageError) {
|
|
281
|
+
console.error(error.message);
|
|
282
|
+
process.exit(error.exitCode);
|
|
283
|
+
}
|
|
284
|
+
throw error;
|
|
285
|
+
}
|
|
286
|
+
function resolveProjectDir(dir) {
|
|
287
|
+
return resolve(typeof dir === "string" && dir ? dir : process.cwd());
|
|
288
|
+
}
|
|
276
289
|
|
|
277
|
-
export { package_default, DEBOUNCE, UsageError, rejectUnknownFlags, rejectExtraPositionals, parseFormat, parsePdfxFlavor, parseEngine, resolvePort };
|
|
290
|
+
export { package_default, DEBOUNCE, UsageError, rejectUnknownFlags, rejectExtraPositionals, parseFormat, parsePdfxFlavor, parseEngine, resolvePort, exitForUsage, resolveProjectDir };
|
|
@@ -1430,7 +1430,7 @@ import { fileURLToPath } from "node:url";
|
|
|
1430
1430
|
var favicon_default = "./favicon-wkbm9cjn.ico";
|
|
1431
1431
|
|
|
1432
1432
|
// src/assets/manifest.schema.json
|
|
1433
|
-
var manifest_schema_default = "./manifest.schema-
|
|
1433
|
+
var manifest_schema_default = "./manifest.schema-kwnrwv8b.json";
|
|
1434
1434
|
|
|
1435
1435
|
// src/assets/preview/scripts/preview-interface.js
|
|
1436
1436
|
var preview_interface_default = "./preview-interface-9rwz21yw.js";
|