@dogsbay/types 0.2.0-beta.17 → 0.2.0-beta.170

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.
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Directive nodes — source-level DITA/Jinja authoring constructs.
3
+ *
4
+ * ── Corpus survey (2026-07-06) ────────────────────────────────────────
5
+ * The authoritative directive vocabulary is @dogsbay/minja's AST
6
+ * (packages/minja/src/types.ts):
7
+ * - variable `{{ name }}` → VariableNode { name }
8
+ * - if/elif/else `{% if expr %}…` → IfNode { condition, trueBranch, elif[], else }
9
+ * - include `{% include "path" %}` → IncludeNode { path }
10
+ * - set `{% set name = expr %}` → SetNode { name, value }
11
+ * - switch / leveloffset / comment → richer forms
12
+ * AsciiDoc `ifdef`/`ifndef` convert to minja `if` (adoc2md-modular);
13
+ * DITA conref/keyref map to includes/variables (format-dita). Profiling
14
+ * attributes (`@platform`/`@audience`) are plain node `props`, filtered
15
+ * at build via ditaval — no new node type needed.
16
+ *
17
+ * ── Why these types exist ─────────────────────────────────────────────
18
+ * Today these constructs are resolved to a STRING before TreeNode exists
19
+ * (standalone minja; see docs-dev/editor-framework-decision.md). TreeNode
20
+ * is the resolved-output model and has no representation of them. The
21
+ * editor edits the *unresolved source*, so it needs them as first-class,
22
+ * round-trippable nodes. The definitions below are ADDITIVE:
23
+ * - block directives ride TreeNode's open `type: string` — NO union change;
24
+ * - inline directives extend InlineNode via `InlineNodeWithDirectives`
25
+ * (below) rather than the base union, so the monorepo's ~10 exhaustive
26
+ * InlineNode consumers keep compiling. Folding them into the base
27
+ * union and updating those consumers is Phase 2 — see
28
+ * plans/editor-directive-model.md.
29
+ *
30
+ * ── Fidelity rule ─────────────────────────────────────────────────────
31
+ * Anything not modeled first-class (elif/else chains, switch, leveloffset,
32
+ * unknown directives) is preserved verbatim as a `directive-raw` node — a
33
+ * source-of-truth tool must never drop a construct it cannot fully model.
34
+ */
35
+ import type { TreeNode, InlineNode } from "./tree.js";
36
+ /** `{% if test %} … {% endif %}` — guarded flow content. elif/else: Phase 2. */
37
+ export interface ConditionalNode extends TreeNode {
38
+ type: "conditional";
39
+ /** raw expression source, e.g. `platform == "mac"` */
40
+ props: {
41
+ test: string;
42
+ };
43
+ children: TreeNode[];
44
+ }
45
+ /** `{% include "src" %}` — transclusion of another topic/fragment. */
46
+ export interface IncludeNode extends TreeNode {
47
+ type: "include";
48
+ /** `src` is the include target as written; extra keys pass through */
49
+ props: {
50
+ src: string;
51
+ [key: string]: unknown;
52
+ };
53
+ }
54
+ /** `{% set name = value %}` — in-document variable definition. */
55
+ export interface VarDefNode extends TreeNode {
56
+ type: "var-def";
57
+ /** `value` is the raw value-expression source */
58
+ props: {
59
+ name: string;
60
+ value: string;
61
+ };
62
+ }
63
+ /** Any directive not modeled first-class, preserved verbatim for round-trip. */
64
+ export interface DirectiveRawNode extends TreeNode {
65
+ type: "directive-raw";
66
+ /** `source` is the exact span; `kind` is a best-effort hint (e.g. "switch") */
67
+ props: {
68
+ source: string;
69
+ kind?: string;
70
+ };
71
+ }
72
+ export type DirectiveBlockNode = ConditionalNode | IncludeNode | VarDefNode | DirectiveRawNode;
73
+ export declare const isConditional: (n: TreeNode) => n is ConditionalNode;
74
+ export declare const isInclude: (n: TreeNode) => n is IncludeNode;
75
+ export declare const isVarDef: (n: TreeNode) => n is VarDefNode;
76
+ export declare const isDirectiveRaw: (n: TreeNode) => n is DirectiveRawNode;
77
+ export declare const isDirectiveBlock: (n: TreeNode) => n is DirectiveBlockNode;
78
+ /**
79
+ * Inline `{{ expr }}` — a variable/expression chip.
80
+ *
81
+ * The optional flags mirror InlineText's flat formatting annotations:
82
+ * a directive inside `**…**` carries its containing span's formatting
83
+ * (there is no wrapper node in the flat inline model to carry it).
84
+ */
85
+ export interface InlineVariable {
86
+ type: "variable";
87
+ /** raw source between the braces, e.g. `product.name` */
88
+ expr: string;
89
+ bold?: boolean;
90
+ italic?: boolean;
91
+ strikethrough?: boolean;
92
+ }
93
+ /** Inline conditional span: content shown only when `test` holds. */
94
+ export interface InlineConditionalSpan {
95
+ type: "conditional-span";
96
+ /** raw expression source */
97
+ test: string;
98
+ children: InlineNode[];
99
+ bold?: boolean;
100
+ italic?: boolean;
101
+ strikethrough?: boolean;
102
+ }
103
+ /** Inline directive not modeled first-class, preserved verbatim. */
104
+ export interface InlineDirectiveRaw {
105
+ type: "directive-raw-inline";
106
+ /** exact source span */
107
+ source: string;
108
+ bold?: boolean;
109
+ italic?: boolean;
110
+ strikethrough?: boolean;
111
+ }
112
+ export type InlineDirectiveNode = InlineVariable | InlineConditionalSpan | InlineDirectiveRaw;
113
+ /**
114
+ * InlineNode extended with directive members. Directive-aware code (the
115
+ * editor, the preserve-mode parser) uses this; the base `InlineNode` union
116
+ * stays unchanged so existing exhaustive consumers keep compiling. Phase 2
117
+ * folds these into the base union and updates those consumers.
118
+ */
119
+ export type InlineNodeWithDirectives = InlineNode | InlineDirectiveNode;
120
+ export declare const isInlineDirective: (n: InlineNodeWithDirectives) => n is InlineDirectiveNode;
121
+ export declare const PROFILING_ATTRS: readonly ["platform", "product", "audience", "rev", "otherprops"];
122
+ export type ProfilingAttr = (typeof PROFILING_ATTRS)[number];
123
+ /** Extract the profiling attributes present on a node's `props`. */
124
+ export declare function profilingOf(node: TreeNode): Partial<Record<ProfilingAttr, unknown>>;
@@ -0,0 +1,26 @@
1
+ export const isConditional = (n) => n.type === "conditional";
2
+ export const isInclude = (n) => n.type === "include";
3
+ export const isVarDef = (n) => n.type === "var-def";
4
+ export const isDirectiveRaw = (n) => n.type === "directive-raw";
5
+ export const isDirectiveBlock = (n) => isConditional(n) || isInclude(n) || isVarDef(n) || isDirectiveRaw(n);
6
+ const INLINE_DIRECTIVE_TYPES = new Set([
7
+ "variable",
8
+ "conditional-span",
9
+ "directive-raw-inline",
10
+ ]);
11
+ export const isInlineDirective = (n) => INLINE_DIRECTIVE_TYPES.has(n.type);
12
+ /* ───────────────────── profiling attributes ───────────────────────────
13
+ * DITA-style profiling — the *attribute* form of a conditional (the
14
+ * *wrapper* form is ConditionalNode). Lives in plain `props`, filtered at
15
+ * build via ditaval. A reserved-key convention, not a type change.
16
+ */
17
+ export const PROFILING_ATTRS = ["platform", "product", "audience", "rev", "otherprops"];
18
+ /** Extract the profiling attributes present on a node's `props`. */
19
+ export function profilingOf(node) {
20
+ const out = {};
21
+ for (const key of PROFILING_ATTRS) {
22
+ if (node.props && key in node.props)
23
+ out[key] = node.props[key];
24
+ }
25
+ return out;
26
+ }
package/dist/format.d.ts CHANGED
@@ -16,6 +16,26 @@ export interface Heading {
16
16
  export interface ExportPage {
17
17
  /** File path relative to docs root, e.g. "getting-started" or "guides/install" */
18
18
  slug: string;
19
+ /**
20
+ * The source file, relative to the content root (`agent/index.md`), for an
21
+ * importer whose pages keep the author's relative links. Relative links are
22
+ * written against the FILE, and a directory's `index.md` has the directory
23
+ * as its slug, so the slug alone cannot say where `./overview` points.
24
+ * Importers that rewrite links to root-absolute leave it unset.
25
+ */
26
+ sourcePath?: string;
27
+ /**
28
+ * The file the importer read the page from, as it opened it (absolute): set by the dogsbay-md
29
+ * loader for a page parsed with a source map (`site dev`'s block records), so a site of several
30
+ * sources knows which source a page came from (`sourcePath` alone is the same in each).
31
+ */
32
+ sourceFile?: string;
33
+ /**
34
+ * The page is its folder's index, served at `/<slug>/` where a leaf is served at `/<slug>`
35
+ * (Docusaurus's category index docs). Written as `<slug>/index.md`, which every Dogsbay MD
36
+ * reader serves at the same slug.
37
+ */
38
+ folderIndex?: boolean;
19
39
  /** Page title */
20
40
  title: string;
21
41
  /** Page content as TreeNode[] */
@@ -24,6 +44,26 @@ export interface ExportPage {
24
44
  headings: Heading[];
25
45
  /** Target URL for redirect/navigation pages (no body content, just a link) */
26
46
  redirect?: string;
47
+ /**
48
+ * Marks an include fragment (not a routable page): content meant to be
49
+ * `{% include %}`'d into other pages. Exporters write it as a plain `.md`
50
+ * include target at its slug — no frontmatter, no title, no nav entry. Used
51
+ * by structural-partial import modes (Docusaurus `--partial-mode include`,
52
+ * AsciiDoc fragments).
53
+ */
54
+ fragment?: boolean;
55
+ /**
56
+ * The page uses template-page syntax (plans/page-templates.md): Dogsbay-MD
57
+ * writes `template: jinja` in its front matter so the build renders it as
58
+ * a template page. Set by importers converting partials with parameters.
59
+ */
60
+ template?: boolean;
61
+ /**
62
+ * A template partial's declared parameters (`name`, or `name?` when
63
+ * optional). Dogsbay-MD writes them as front matter `params:` on the
64
+ * fragment, and the build validates every include against them.
65
+ */
66
+ templateParams?: string[];
27
67
  /**
28
68
  * Raw frontmatter data from the source page. Includes all YAML fields that
29
69
  * were present in the original source (title, description, tags, custom
@@ -60,6 +100,26 @@ export interface ExportPage {
60
100
  * See plans/multi-source-content.md.
61
101
  */
62
102
  multiSource?: MultiSourceMeta;
103
+ /**
104
+ * Direct-from-source markdown body, when the importer can produce
105
+ * one. Bypasses the TreeNode round-trip for callers that want to
106
+ * preserve the source's line structure verbatim (most importantly,
107
+ * `migrate-asciidoc`, which would otherwise see markdown-it fold
108
+ * adjacent non-blank lines into one paragraph and the
109
+ * format-dogsbay-md serializer flatten that paragraph onto a single
110
+ * line — turning every `ifdef` / `endif` block in the original
111
+ * `.adoc` into an unreadable wall of text).
112
+ *
113
+ * Importers that produce a faithful direct-from-source markdown
114
+ * (currently `format-asciidoc`) populate this field. Importers that
115
+ * don't (most format plugins) leave it `undefined` and consumers
116
+ * fall back to the TreeNode-derived body via `treeToDogsbayMd`.
117
+ *
118
+ * The TreeNode round-trip is still the canonical path for runtime
119
+ * rendering — `bodyMarkdown` is a migration-time convenience that
120
+ * doesn't change the import contract.
121
+ */
122
+ bodyMarkdown?: string;
63
123
  }
64
124
  /**
65
125
  * Per-page axis metadata. Set by the loader's aggregator when
@@ -81,6 +141,14 @@ export interface MultiSourceMeta {
81
141
  * page across versions / locales".
82
142
  */
83
143
  originalSlug: string;
144
+ /**
145
+ * With a `products:` block (@dogsbay/site-files products.ts): the
146
+ * version's URL segment, which may differ from its id (`latest` for
147
+ * `3.32`; `""` when the version is served at the product's root).
148
+ */
149
+ versionPath?: string;
150
+ /** With a `products:` block: the URL segments of the product's other versions (what a root version's menu leaves out). */
151
+ siblingVersionPaths?: string[];
84
152
  }
85
153
  /**
86
154
  * Navigation item for sidebar/TOC structures.
@@ -93,6 +161,39 @@ export interface NavItem {
93
161
  label: string;
94
162
  href?: string;
95
163
  children?: NavItem[];
164
+ /**
165
+ * Granularity book view (plans/granularity-views.md). Opt-in, per nav node:
166
+ * - "yes" — emit one rolled-up single page for this node's subtree.
167
+ * - "children" — emit a single page for each direct child (chapters); a
168
+ * child may override with its own "no".
169
+ * - "no" — no single page (the default when omitted).
170
+ */
171
+ singlePage?: "yes" | "no" | "children";
172
+ /**
173
+ * A state marker rendered beside the label — structured DATA, not text
174
+ * baked into `label`. Release comparisons use it for changed/new/removed
175
+ * pages; the same slot serves "new since your last visit", deprecation
176
+ * flags, and version badges.
177
+ *
178
+ * The renderer is responsible for making it perceivable WITHOUT colour
179
+ * (distinct glyph + visually-hidden text) — see SidebarNavTree.
180
+ *
181
+ * A branch may carry a marker for its SUBTREE: a collapsed group hides
182
+ * its children, so a change inside it must signal outward (the same
183
+ * visibility rule the diff renderer applies to tabs).
184
+ */
185
+ mark?: NavMark;
186
+ }
187
+ export type NavMarkKind = "added" | "changed" | "removed" | "moved";
188
+ export interface NavMark {
189
+ kind: NavMarkKind;
190
+ /**
191
+ * Announced to assistive tech and shown on hover. Defaults to `kind`.
192
+ * A branch aggregating its subtree says so ("3 pages changed").
193
+ */
194
+ label?: string;
195
+ /** True when this marker summarizes DESCENDANTS, not the item itself. */
196
+ subtree?: boolean;
96
197
  }
97
198
  /**
98
199
  * Standard interface for format plugins.
@@ -114,12 +215,160 @@ export interface FormatPlugin {
114
215
  /** Format-specific CLI options for export */
115
216
  exportOptions?: FormatOption[];
116
217
  /** Import: read source format, produce pages + nav */
117
- import?(source: string, opts: Record<string, unknown>): Promise<{
118
- pages: ExportPage[];
119
- nav: NavItem[];
120
- }>;
218
+ import?(source: string, opts: Record<string, unknown>): Promise<ImportResult>;
121
219
  /** Export: write pages + nav to target format */
122
220
  export?(pages: ExportPage[], nav: NavItem[], output: string, opts: Record<string, unknown>): Promise<void>;
221
+ /**
222
+ * What the exporter can represent, per TreeNode type: one cell of the
223
+ * component × format matrix (`MATRIX_ROWS` in @dogsbay/serialize-core).
224
+ * Required of every exporter — the CLI's capability-matrix test fails on a
225
+ * missing cell. Same shape as serialize-core's `CapabilityDeclaration`.
226
+ */
227
+ capabilities?: readonly FormatCapability[];
228
+ }
229
+ /** One feature's support in one export format (see `FormatPlugin.capabilities`). */
230
+ export interface FormatCapability {
231
+ feature: string;
232
+ support: "full" | "partial" | "none";
233
+ /** Required when support is not "full": how it degrades. */
234
+ note?: string;
235
+ rendersAs?: string;
236
+ }
237
+ export interface ImportResult {
238
+ pages: ExportPage[];
239
+ nav: NavItem[];
240
+ /**
241
+ * Directories whose CONTENTS should be mounted at `_assets/` in the output,
242
+ * so the `/_assets/…` refs importers rewrite image paths to actually
243
+ * resolve.
244
+ *
245
+ * An importer that knows where its media lives (a Starlight `src/assets`, a
246
+ * Docusaurus `static/`) declares it here. Without this the reference
247
+ * survives the conversion and the FILE does not — a page count, a retention
248
+ * score and a clean exit all look fine while every image 404s.
249
+ *
250
+ * `into` targets an `_assets/<into>` subdir; `mediaOnly` copies only media
251
+ * files, for the case where the mounted dir is the docs tree itself and
252
+ * carries co-located images.
253
+ */
254
+ assetMounts?: {
255
+ dir: string;
256
+ into?: string;
257
+ mediaOnly?: boolean;
258
+ exclude?: string[];
259
+ /** Folders of the mount, relative to it, left out whole (VitePress: `public`, a mount of its own). */
260
+ skip?: string[];
261
+ /**
262
+ * Only these files of the mount, relative to it. Read by `@dogsbay/corpus` `mountCopies` (the
263
+ * Dogsbay MD export, the browser imports) only: set it only for Dogsbay MD output.
264
+ */
265
+ files?: string[];
266
+ /**
267
+ * Public directory the mount lands in. Defaults to `_assets` — the name
268
+ * every IMPORTER rewrites its refs to. Hand-authored content differs: an
269
+ * author who has not read docs/images.md types `/images/logo.png`, so
270
+ * `format-dogsbay-md` also recognises `images/` and `assets/` and sets
271
+ * this to whichever it found. The copy must preserve the name, or the
272
+ * reference and the file disagree — the exact failure this field's
273
+ * neighbours exist to prevent.
274
+ */
275
+ root?: string;
276
+ }[];
277
+ /**
278
+ * Directory that page slugs are relative to, when it is NOT the path the
279
+ * user passed on the command line.
280
+ *
281
+ * MkDocs keeps its pages under `docs/`, Hugo under `content/`, a Docusaurus
282
+ * instance under its own docs dir — so a page at slug `guide/install`
283
+ * writing `{% include "_snippets/note.md" %}` means
284
+ * `<source>/docs/_snippets/note.md`, not `<source>/_snippets/note.md`.
285
+ * Resolving includes against the CLI argument missed every fragment in
286
+ * those corpora, which (since unresolved includes now fail the run) turned
287
+ * a working conversion into a hard error.
288
+ *
289
+ * Omit when slugs are relative to `source` itself.
290
+ */
291
+ contentRoot?: string;
292
+ /**
293
+ * SEVERAL content roots, each mounted under a slug prefix — the Antora
294
+ * PLAYBOOK case (#067): `docs/guides/` → `guides/`, `docs/server-admin-4.9/`
295
+ * → `server-admin/server-4.9/`. Fragments (partials, examples, images)
296
+ * under each `dir` are mirrored beneath its `prefix` so a page at
297
+ * `guides/deploy/x` writing `{% include "../../modules/ROOT/partials/y.md" %}`
298
+ * finds `<content>/guides/modules/ROOT/partials/y.md`. Takes precedence
299
+ * over `contentRoot` when present. `prefix` is `""` for the root mount.
300
+ */
301
+ sourceMounts?: {
302
+ dir: string;
303
+ prefix: string;
304
+ }[];
305
+ /**
306
+ * Antora playbook mode (#067): loaded components by NAME → root dir +
307
+ * slug prefix, for the engine's cross-component resource-ID
308
+ * resolution in fragments (pages get it via the plugin's own parse).
309
+ */
310
+ antoraComponents?: Record<string, {
311
+ dir: string;
312
+ prefix: string;
313
+ }>;
314
+ /**
315
+ * Attribute values the CORPUS declares (Antora playbook + component
316
+ * `asciidoc.attributes`, an AsciiBinder distro map, …) that the site
317
+ * build must resolve — a `{{ serverversion49 }}` the migrate emitted
318
+ * shipped as literal `{serverversion49}` because nothing wrote them into
319
+ * `dogsbay.config.yml` (#067 review). Migrate persists these under the
320
+ * user's own `--attribute` values (user wins).
321
+ */
322
+ corpusAttributes?: Record<string, unknown>;
323
+ /**
324
+ * What the import could not convert cleanly, by source file and line (the file is relative
325
+ * to the corpus root). A host lists these (the playground under Problems, the CLI in its
326
+ * summary); `MIGRATION.md` carries them too. Known loss, never silent loss.
327
+ */
328
+ ledger?: ImportLedgerEntry[];
329
+ /**
330
+ * Data files the import wrote for its pages (docs/data-files.md): `path` is relative to the
331
+ * data folder. Set only when the host asked for Dogsbay MD output, which reads them; the host
332
+ * writes them into `data/` beside the content.
333
+ */
334
+ dataFiles?: {
335
+ path: string;
336
+ text: string;
337
+ }[];
338
+ /**
339
+ * API viewer pages made API pages of their own (`openapi: "split"`, docs/openapi.md): each is a
340
+ * `from: openapi` source the host writes into dogsbay.config.yml, over the copied spec
341
+ * (`spec`, a `/_assets/…` path in the output) and MOUNTED at the page (`mount`, its slug).
342
+ * `pages` is how many pages the build makes from the spec, when it read.
343
+ */
344
+ apiSources?: {
345
+ spec: string;
346
+ mount: string;
347
+ pages?: number;
348
+ }[];
349
+ }
350
+ /** One note from an import: what was not converted cleanly, and where. */
351
+ export interface ImportLedgerEntry {
352
+ /** Source file, relative to the corpus root. */
353
+ file?: string;
354
+ /** 1-based line in that file, front matter included. */
355
+ line?: number;
356
+ /**
357
+ * The converted page the note is about, as a path in the migrated project
358
+ * (`content/guide/x.md`); set by the browser imports' `migrate` (and GitBook's project
359
+ * writer, which the CLI shares). Absent when the file
360
+ * became no page of its own (a config, a sidebar, a partial spliced into other pages).
361
+ */
362
+ page?: string;
363
+ /**
364
+ * 1-based line in `page`, front matter included, where the construct is. Given only
365
+ * when that line holds it: no line rather than a wrong one.
366
+ */
367
+ pageLine?: number;
368
+ severity: "info" | "warning";
369
+ /** Stable kebab-case kind, e.g. `unmapped-construct`, `slug-collision`. */
370
+ code: string;
371
+ message: string;
123
372
  }
124
373
  export interface FormatOption {
125
374
  flags: string;
@@ -157,6 +406,8 @@ export interface PlausibleConfig {
157
406
  export interface SiteConfig {
158
407
  /** Site name shown in header, page title suffixes, copyright notices. */
159
408
  siteName: string;
409
+ /** The line under the site name in the sidebar header (`site.tagline`). Default "Documentation". */
410
+ tagline?: string;
160
411
  /**
161
412
  * Canonical site URL. Required for `<link rel="canonical">`,
162
413
  * sitemap.xml entries, and absolute OG meta tags. Without it, those
@@ -197,6 +448,11 @@ export interface SiteConfig {
197
448
  editUri?: string;
198
449
  /** Footer copyright text. */
199
450
  copyright?: string;
451
+ /**
452
+ * "Powered by DogsBay" footer attribution. Defaults to true for generated
453
+ * sites; `poweredBy: false` in dogsbay.config.yml removes it entirely.
454
+ */
455
+ poweredBy?: boolean;
200
456
  /**
201
457
  * Brand keywords for the site, used by the
202
458
  * `seo/h1-brand-keyword` audit rule to verify that landing
@@ -223,6 +479,12 @@ export interface SiteConfig {
223
479
  * chips with prefix-keyed colors. See plans/tag-display-config.md.
224
480
  */
225
481
  tagPrefixes?: Record<string, TagPrefixDisplay>;
482
+ /**
483
+ * Color tag chips whose prefix has no color with a palette color
484
+ * chosen by a hash of the first segment. Sourced from
485
+ * `taxonomies.tags.autoColor`. See plans/tag-auto-color.md.
486
+ */
487
+ tagAutoColor?: boolean;
226
488
  /**
227
489
  * Per-tag leaf-label overrides (slug → display string). URLs and
228
490
  * taxonomy term-page paths still use the slug; only chip text
@@ -270,6 +532,30 @@ export interface SiteConfig {
270
532
  * human-facing UI cluster.
271
533
  */
272
534
  llmActions?: LlmActionsConfig;
535
+ /**
536
+ * Resolved glyphs for the internal/external link-icon affordance.
537
+ * When present, `DocsLayout` marks links in the prose with a small
538
+ * trailing icon so readers can tell internal navigation from links
539
+ * that leave the site. Sourced from `content.linkIcons` in
540
+ * `dogsbay.config.yml` and normalized by the CLI. Omitted (whole
541
+ * object absent) when the feature is off. Either side may be absent
542
+ * to show an icon for only that link kind. A core feature — not tied
543
+ * to any importer. See plans/link-resolution-and-icons.md.
544
+ */
545
+ linkIcons?: LinkIconsConfig;
546
+ }
547
+ /**
548
+ * Resolved glyphs for the internal/external link-icon affordance
549
+ * (`SiteConfig.linkIcons`). Classification is by href shape at render
550
+ * time: external = absolute (`http(s)://`) or protocol-relative
551
+ * (`//host`); internal = root/relative. An absent side shows no icon
552
+ * for that kind.
553
+ */
554
+ export interface LinkIconsConfig {
555
+ /** Glyph appended after external links (e.g. "↗"). */
556
+ external?: string;
557
+ /** Glyph appended after internal links (e.g. "→"). */
558
+ internal?: string;
273
559
  }
274
560
  /**
275
561
  * Closed list of LLM provider deep-link targets. Each one is a
@@ -329,6 +615,27 @@ export interface TaxonomyDisplay {
329
615
  prefixes?: Record<string, TagPrefixDisplay>;
330
616
  /** Per-slug label overrides; key = full slug, value = display string. */
331
617
  labels?: Record<string, string>;
618
+ /**
619
+ * Sort weight for the facet column in the search dialog. Lower
620
+ * numbers appear first; unset facets sort alphabetically after
621
+ * any pinned ones. Use this to pin "Type" or "Audience" to the
622
+ * top of the sidebar even though they sort later by name.
623
+ */
624
+ order?: number;
625
+ /**
626
+ * Render this facet as a hierarchical tree in the search dialog
627
+ * instead of a flat checkbox list. Two render strategies depending
628
+ * on the value shape:
629
+ * - Values containing `/` are treated as slash-encoded paths
630
+ * (`concept/a11y` → `concept → a11y`). Common for tag taxonomies.
631
+ * - Values without `/` derive their tree from `nav.json` document
632
+ * order (the auto-`category` facet shape).
633
+ * Parent click auto-selects all descendant values; three-state
634
+ * checkboxes reflect partial selection. Off by default — set true
635
+ * on `category` and on slash-nested tag taxonomies.
636
+ * See plans/hierarchical-facets.md.
637
+ */
638
+ hierarchical?: boolean;
332
639
  }
333
640
  /**
334
641
  * Display config for one taxonomy prefix. Color is one of the
@@ -347,4 +654,3 @@ export interface TagPrefixDisplay {
347
654
  * type-narrow without importing CLI internals.
348
655
  */
349
656
  export type TagPaletteName = "blue" | "amber" | "emerald" | "violet" | "rose" | "slate";
350
- //# sourceMappingURL=format.d.ts.map
package/dist/format.js CHANGED
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=format.js.map
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The frontmatter checker: one page's frontmatter against the vocabulary in
3
+ * frontmatter-schema.ts and the site's policy. Pure, so every surface reports
4
+ * the same findings:
5
+ *
6
+ * - `dogsbay validate` (@dogsbay/commands), which adds a one-click fix;
7
+ * - the `frontmatter/valid` rule of `@dogsbay/site-check`, run by
8
+ * `dogsbay site check` and `dogsbay-ssg check`.
9
+ */
10
+ import { type FrontmatterPolicy } from "./frontmatter-schema.js";
11
+ export interface FrontmatterFinding {
12
+ severity: "error" | "warning";
13
+ /** `frontmatter-type`, `frontmatter-required`, … (the codes `dogsbay validate` reports). */
14
+ code: string;
15
+ message: string;
16
+ /** The top-level key the finding is about, when there is one. */
17
+ key?: string;
18
+ /** 1-based line of that key, when `keyLines` has it. */
19
+ line?: number;
20
+ /** Near-miss values for a closed set. */
21
+ candidates?: string[];
22
+ /** A replacement safe to apply without asking (a case-only slip): set `key` to `value`. */
23
+ fix?: {
24
+ key: string;
25
+ value: string;
26
+ label: string;
27
+ };
28
+ }
29
+ /**
30
+ * Findings for one page. `path` is the page's source path as the policy's
31
+ * `roots` see it (the globs match its content-relative form); `keyLines`
32
+ * gives each key's line (`frontmatterKeyLines(source)`).
33
+ */
34
+ export declare function checkFrontmatter(frontmatter: Record<string, unknown> | undefined, path: string, policy: FrontmatterPolicy, keyLines?: Map<string, number>): FrontmatterFinding[];
35
+ /**
36
+ * The policy from a parsed `dogsbay.config.*` object: declared `taxonomies:`
37
+ * (their `values`/`hierarchical` ARE the check), `propSchema:`, and the
38
+ * opt-in `content.frontmatter` strictness. `roots` are the content roots
39
+ * (`content.sources[].path`). A malformed `content.frontmatter.unknown` sets
40
+ * `invalid` rather than being guessed around.
41
+ */
42
+ export declare function frontmatterPolicyFromConfig(cfg: Record<string, unknown> | null | undefined, roots: string[]): FrontmatterPolicy;