@dogsbay/types 0.2.0-beta.16 → 0.2.0-beta.160

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,20 @@ 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 page is its folder's index, served at `/<slug>/` where a leaf is served at `/<slug>`
29
+ * (Docusaurus's category index docs). Written as `<slug>/index.md`, which every Dogsbay MD
30
+ * reader serves at the same slug.
31
+ */
32
+ folderIndex?: boolean;
19
33
  /** Page title */
20
34
  title: string;
21
35
  /** Page content as TreeNode[] */
@@ -24,6 +38,26 @@ export interface ExportPage {
24
38
  headings: Heading[];
25
39
  /** Target URL for redirect/navigation pages (no body content, just a link) */
26
40
  redirect?: string;
41
+ /**
42
+ * Marks an include fragment (not a routable page): content meant to be
43
+ * `{% include %}`'d into other pages. Exporters write it as a plain `.md`
44
+ * include target at its slug — no frontmatter, no title, no nav entry. Used
45
+ * by structural-partial import modes (Docusaurus `--partial-mode include`,
46
+ * AsciiDoc fragments).
47
+ */
48
+ fragment?: boolean;
49
+ /**
50
+ * The page uses template-page syntax (plans/page-templates.md): Dogsbay-MD
51
+ * writes `template: jinja` in its front matter so the build renders it as
52
+ * a template page. Set by importers converting partials with parameters.
53
+ */
54
+ template?: boolean;
55
+ /**
56
+ * A template partial's declared parameters (`name`, or `name?` when
57
+ * optional). Dogsbay-MD writes them as front matter `params:` on the
58
+ * fragment, and the build validates every include against them.
59
+ */
60
+ templateParams?: string[];
27
61
  /**
28
62
  * Raw frontmatter data from the source page. Includes all YAML fields that
29
63
  * were present in the original source (title, description, tags, custom
@@ -60,6 +94,26 @@ export interface ExportPage {
60
94
  * See plans/multi-source-content.md.
61
95
  */
62
96
  multiSource?: MultiSourceMeta;
97
+ /**
98
+ * Direct-from-source markdown body, when the importer can produce
99
+ * one. Bypasses the TreeNode round-trip for callers that want to
100
+ * preserve the source's line structure verbatim (most importantly,
101
+ * `migrate-asciidoc`, which would otherwise see markdown-it fold
102
+ * adjacent non-blank lines into one paragraph and the
103
+ * format-dogsbay-md serializer flatten that paragraph onto a single
104
+ * line — turning every `ifdef` / `endif` block in the original
105
+ * `.adoc` into an unreadable wall of text).
106
+ *
107
+ * Importers that produce a faithful direct-from-source markdown
108
+ * (currently `format-asciidoc`) populate this field. Importers that
109
+ * don't (most format plugins) leave it `undefined` and consumers
110
+ * fall back to the TreeNode-derived body via `treeToDogsbayMd`.
111
+ *
112
+ * The TreeNode round-trip is still the canonical path for runtime
113
+ * rendering — `bodyMarkdown` is a migration-time convenience that
114
+ * doesn't change the import contract.
115
+ */
116
+ bodyMarkdown?: string;
63
117
  }
64
118
  /**
65
119
  * Per-page axis metadata. Set by the loader's aggregator when
@@ -81,6 +135,14 @@ export interface MultiSourceMeta {
81
135
  * page across versions / locales".
82
136
  */
83
137
  originalSlug: string;
138
+ /**
139
+ * With a `products:` block (@dogsbay/site-files products.ts): the
140
+ * version's URL segment, which may differ from its id (`latest` for
141
+ * `3.32`; `""` when the version is served at the product's root).
142
+ */
143
+ versionPath?: string;
144
+ /** With a `products:` block: the URL segments of the product's other versions (what a root version's menu leaves out). */
145
+ siblingVersionPaths?: string[];
84
146
  }
85
147
  /**
86
148
  * Navigation item for sidebar/TOC structures.
@@ -93,6 +155,39 @@ export interface NavItem {
93
155
  label: string;
94
156
  href?: string;
95
157
  children?: NavItem[];
158
+ /**
159
+ * Granularity book view (plans/granularity-views.md). Opt-in, per nav node:
160
+ * - "yes" — emit one rolled-up single page for this node's subtree.
161
+ * - "children" — emit a single page for each direct child (chapters); a
162
+ * child may override with its own "no".
163
+ * - "no" — no single page (the default when omitted).
164
+ */
165
+ singlePage?: "yes" | "no" | "children";
166
+ /**
167
+ * A state marker rendered beside the label — structured DATA, not text
168
+ * baked into `label`. Release comparisons use it for changed/new/removed
169
+ * pages; the same slot serves "new since your last visit", deprecation
170
+ * flags, and version badges.
171
+ *
172
+ * The renderer is responsible for making it perceivable WITHOUT colour
173
+ * (distinct glyph + visually-hidden text) — see SidebarNavTree.
174
+ *
175
+ * A branch may carry a marker for its SUBTREE: a collapsed group hides
176
+ * its children, so a change inside it must signal outward (the same
177
+ * visibility rule the diff renderer applies to tabs).
178
+ */
179
+ mark?: NavMark;
180
+ }
181
+ export type NavMarkKind = "added" | "changed" | "removed" | "moved";
182
+ export interface NavMark {
183
+ kind: NavMarkKind;
184
+ /**
185
+ * Announced to assistive tech and shown on hover. Defaults to `kind`.
186
+ * A branch aggregating its subtree says so ("3 pages changed").
187
+ */
188
+ label?: string;
189
+ /** True when this marker summarizes DESCENDANTS, not the item itself. */
190
+ subtree?: boolean;
96
191
  }
97
192
  /**
98
193
  * Standard interface for format plugins.
@@ -114,12 +209,160 @@ export interface FormatPlugin {
114
209
  /** Format-specific CLI options for export */
115
210
  exportOptions?: FormatOption[];
116
211
  /** Import: read source format, produce pages + nav */
117
- import?(source: string, opts: Record<string, unknown>): Promise<{
118
- pages: ExportPage[];
119
- nav: NavItem[];
120
- }>;
212
+ import?(source: string, opts: Record<string, unknown>): Promise<ImportResult>;
121
213
  /** Export: write pages + nav to target format */
122
214
  export?(pages: ExportPage[], nav: NavItem[], output: string, opts: Record<string, unknown>): Promise<void>;
215
+ /**
216
+ * What the exporter can represent, per TreeNode type: one cell of the
217
+ * component × format matrix (`MATRIX_ROWS` in @dogsbay/serialize-core).
218
+ * Required of every exporter — the CLI's capability-matrix test fails on a
219
+ * missing cell. Same shape as serialize-core's `CapabilityDeclaration`.
220
+ */
221
+ capabilities?: readonly FormatCapability[];
222
+ }
223
+ /** One feature's support in one export format (see `FormatPlugin.capabilities`). */
224
+ export interface FormatCapability {
225
+ feature: string;
226
+ support: "full" | "partial" | "none";
227
+ /** Required when support is not "full": how it degrades. */
228
+ note?: string;
229
+ rendersAs?: string;
230
+ }
231
+ export interface ImportResult {
232
+ pages: ExportPage[];
233
+ nav: NavItem[];
234
+ /**
235
+ * Directories whose CONTENTS should be mounted at `_assets/` in the output,
236
+ * so the `/_assets/…` refs importers rewrite image paths to actually
237
+ * resolve.
238
+ *
239
+ * An importer that knows where its media lives (a Starlight `src/assets`, a
240
+ * Docusaurus `static/`) declares it here. Without this the reference
241
+ * survives the conversion and the FILE does not — a page count, a retention
242
+ * score and a clean exit all look fine while every image 404s.
243
+ *
244
+ * `into` targets an `_assets/<into>` subdir; `mediaOnly` copies only media
245
+ * files, for the case where the mounted dir is the docs tree itself and
246
+ * carries co-located images.
247
+ */
248
+ assetMounts?: {
249
+ dir: string;
250
+ into?: string;
251
+ mediaOnly?: boolean;
252
+ exclude?: string[];
253
+ /** Folders of the mount, relative to it, left out whole (VitePress: `public`, a mount of its own). */
254
+ skip?: string[];
255
+ /**
256
+ * Only these files of the mount, relative to it. Read by `@dogsbay/corpus` `mountCopies` (the
257
+ * Dogsbay MD export, the browser imports) only: set it only for Dogsbay MD output.
258
+ */
259
+ files?: string[];
260
+ /**
261
+ * Public directory the mount lands in. Defaults to `_assets` — the name
262
+ * every IMPORTER rewrites its refs to. Hand-authored content differs: an
263
+ * author who has not read docs/images.md types `/images/logo.png`, so
264
+ * `format-dogsbay-md` also recognises `images/` and `assets/` and sets
265
+ * this to whichever it found. The copy must preserve the name, or the
266
+ * reference and the file disagree — the exact failure this field's
267
+ * neighbours exist to prevent.
268
+ */
269
+ root?: string;
270
+ }[];
271
+ /**
272
+ * Directory that page slugs are relative to, when it is NOT the path the
273
+ * user passed on the command line.
274
+ *
275
+ * MkDocs keeps its pages under `docs/`, Hugo under `content/`, a Docusaurus
276
+ * instance under its own docs dir — so a page at slug `guide/install`
277
+ * writing `{% include "_snippets/note.md" %}` means
278
+ * `<source>/docs/_snippets/note.md`, not `<source>/_snippets/note.md`.
279
+ * Resolving includes against the CLI argument missed every fragment in
280
+ * those corpora, which (since unresolved includes now fail the run) turned
281
+ * a working conversion into a hard error.
282
+ *
283
+ * Omit when slugs are relative to `source` itself.
284
+ */
285
+ contentRoot?: string;
286
+ /**
287
+ * SEVERAL content roots, each mounted under a slug prefix — the Antora
288
+ * PLAYBOOK case (#067): `docs/guides/` → `guides/`, `docs/server-admin-4.9/`
289
+ * → `server-admin/server-4.9/`. Fragments (partials, examples, images)
290
+ * under each `dir` are mirrored beneath its `prefix` so a page at
291
+ * `guides/deploy/x` writing `{% include "../../modules/ROOT/partials/y.md" %}`
292
+ * finds `<content>/guides/modules/ROOT/partials/y.md`. Takes precedence
293
+ * over `contentRoot` when present. `prefix` is `""` for the root mount.
294
+ */
295
+ sourceMounts?: {
296
+ dir: string;
297
+ prefix: string;
298
+ }[];
299
+ /**
300
+ * Antora playbook mode (#067): loaded components by NAME → root dir +
301
+ * slug prefix, for the engine's cross-component resource-ID
302
+ * resolution in fragments (pages get it via the plugin's own parse).
303
+ */
304
+ antoraComponents?: Record<string, {
305
+ dir: string;
306
+ prefix: string;
307
+ }>;
308
+ /**
309
+ * Attribute values the CORPUS declares (Antora playbook + component
310
+ * `asciidoc.attributes`, an AsciiBinder distro map, …) that the site
311
+ * build must resolve — a `{{ serverversion49 }}` the migrate emitted
312
+ * shipped as literal `{serverversion49}` because nothing wrote them into
313
+ * `dogsbay.config.yml` (#067 review). Migrate persists these under the
314
+ * user's own `--attribute` values (user wins).
315
+ */
316
+ corpusAttributes?: Record<string, unknown>;
317
+ /**
318
+ * What the import could not convert cleanly, by source file and line (the file is relative
319
+ * to the corpus root). A host lists these (the playground under Problems, the CLI in its
320
+ * summary); `MIGRATION.md` carries them too. Known loss, never silent loss.
321
+ */
322
+ ledger?: ImportLedgerEntry[];
323
+ /**
324
+ * Data files the import wrote for its pages (docs/data-files.md): `path` is relative to the
325
+ * data folder. Set only when the host asked for Dogsbay MD output, which reads them; the host
326
+ * writes them into `data/` beside the content.
327
+ */
328
+ dataFiles?: {
329
+ path: string;
330
+ text: string;
331
+ }[];
332
+ /**
333
+ * API viewer pages made API pages of their own (`openapi: "split"`, docs/openapi.md): each is a
334
+ * `from: openapi` source the host writes into dogsbay.config.yml, over the copied spec
335
+ * (`spec`, a `/_assets/…` path in the output) and MOUNTED at the page (`mount`, its slug).
336
+ * `pages` is how many pages the build makes from the spec, when it read.
337
+ */
338
+ apiSources?: {
339
+ spec: string;
340
+ mount: string;
341
+ pages?: number;
342
+ }[];
343
+ }
344
+ /** One note from an import: what was not converted cleanly, and where. */
345
+ export interface ImportLedgerEntry {
346
+ /** Source file, relative to the corpus root. */
347
+ file?: string;
348
+ /** 1-based line in that file, front matter included. */
349
+ line?: number;
350
+ /**
351
+ * The converted page the note is about, as a path in the migrated project
352
+ * (`content/guide/x.md`); set by the browser imports' `migrate` (and GitBook's project
353
+ * writer, which the CLI shares). Absent when the file
354
+ * became no page of its own (a config, a sidebar, a partial spliced into other pages).
355
+ */
356
+ page?: string;
357
+ /**
358
+ * 1-based line in `page`, front matter included, where the construct is. Given only
359
+ * when that line holds it: no line rather than a wrong one.
360
+ */
361
+ pageLine?: number;
362
+ severity: "info" | "warning";
363
+ /** Stable kebab-case kind, e.g. `unmapped-construct`, `slug-collision`. */
364
+ code: string;
365
+ message: string;
123
366
  }
124
367
  export interface FormatOption {
125
368
  flags: string;
@@ -157,6 +400,8 @@ export interface PlausibleConfig {
157
400
  export interface SiteConfig {
158
401
  /** Site name shown in header, page title suffixes, copyright notices. */
159
402
  siteName: string;
403
+ /** The line under the site name in the sidebar header (`site.tagline`). Default "Documentation". */
404
+ tagline?: string;
160
405
  /**
161
406
  * Canonical site URL. Required for `<link rel="canonical">`,
162
407
  * sitemap.xml entries, and absolute OG meta tags. Without it, those
@@ -197,6 +442,11 @@ export interface SiteConfig {
197
442
  editUri?: string;
198
443
  /** Footer copyright text. */
199
444
  copyright?: string;
445
+ /**
446
+ * "Powered by DogsBay" footer attribution. Defaults to true for generated
447
+ * sites; `poweredBy: false` in dogsbay.config.yml removes it entirely.
448
+ */
449
+ poweredBy?: boolean;
200
450
  /**
201
451
  * Brand keywords for the site, used by the
202
452
  * `seo/h1-brand-keyword` audit rule to verify that landing
@@ -223,6 +473,12 @@ export interface SiteConfig {
223
473
  * chips with prefix-keyed colors. See plans/tag-display-config.md.
224
474
  */
225
475
  tagPrefixes?: Record<string, TagPrefixDisplay>;
476
+ /**
477
+ * Color tag chips whose prefix has no color with a palette color
478
+ * chosen by a hash of the first segment. Sourced from
479
+ * `taxonomies.tags.autoColor`. See plans/tag-auto-color.md.
480
+ */
481
+ tagAutoColor?: boolean;
226
482
  /**
227
483
  * Per-tag leaf-label overrides (slug → display string). URLs and
228
484
  * taxonomy term-page paths still use the slug; only chip text
@@ -270,6 +526,30 @@ export interface SiteConfig {
270
526
  * human-facing UI cluster.
271
527
  */
272
528
  llmActions?: LlmActionsConfig;
529
+ /**
530
+ * Resolved glyphs for the internal/external link-icon affordance.
531
+ * When present, `DocsLayout` marks links in the prose with a small
532
+ * trailing icon so readers can tell internal navigation from links
533
+ * that leave the site. Sourced from `content.linkIcons` in
534
+ * `dogsbay.config.yml` and normalized by the CLI. Omitted (whole
535
+ * object absent) when the feature is off. Either side may be absent
536
+ * to show an icon for only that link kind. A core feature — not tied
537
+ * to any importer. See plans/link-resolution-and-icons.md.
538
+ */
539
+ linkIcons?: LinkIconsConfig;
540
+ }
541
+ /**
542
+ * Resolved glyphs for the internal/external link-icon affordance
543
+ * (`SiteConfig.linkIcons`). Classification is by href shape at render
544
+ * time: external = absolute (`http(s)://`) or protocol-relative
545
+ * (`//host`); internal = root/relative. An absent side shows no icon
546
+ * for that kind.
547
+ */
548
+ export interface LinkIconsConfig {
549
+ /** Glyph appended after external links (e.g. "↗"). */
550
+ external?: string;
551
+ /** Glyph appended after internal links (e.g. "→"). */
552
+ internal?: string;
273
553
  }
274
554
  /**
275
555
  * Closed list of LLM provider deep-link targets. Each one is a
@@ -329,6 +609,27 @@ export interface TaxonomyDisplay {
329
609
  prefixes?: Record<string, TagPrefixDisplay>;
330
610
  /** Per-slug label overrides; key = full slug, value = display string. */
331
611
  labels?: Record<string, string>;
612
+ /**
613
+ * Sort weight for the facet column in the search dialog. Lower
614
+ * numbers appear first; unset facets sort alphabetically after
615
+ * any pinned ones. Use this to pin "Type" or "Audience" to the
616
+ * top of the sidebar even though they sort later by name.
617
+ */
618
+ order?: number;
619
+ /**
620
+ * Render this facet as a hierarchical tree in the search dialog
621
+ * instead of a flat checkbox list. Two render strategies depending
622
+ * on the value shape:
623
+ * - Values containing `/` are treated as slash-encoded paths
624
+ * (`concept/a11y` → `concept → a11y`). Common for tag taxonomies.
625
+ * - Values without `/` derive their tree from `nav.json` document
626
+ * order (the auto-`category` facet shape).
627
+ * Parent click auto-selects all descendant values; three-state
628
+ * checkboxes reflect partial selection. Off by default — set true
629
+ * on `category` and on slash-nested tag taxonomies.
630
+ * See plans/hierarchical-facets.md.
631
+ */
632
+ hierarchical?: boolean;
332
633
  }
333
634
  /**
334
635
  * Display config for one taxonomy prefix. Color is one of the
@@ -347,4 +648,3 @@ export interface TagPrefixDisplay {
347
648
  * type-narrow without importing CLI internals.
348
649
  */
349
650
  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;