@dogsbay/types 0.2.0-beta.1 → 0.2.0-beta.100
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/dist/directives.d.ts +125 -0
- package/dist/directives.d.ts.map +1 -0
- package/dist/directives.js +27 -0
- package/dist/directives.js.map +1 -0
- package/dist/format.d.ts +177 -4
- package/dist/format.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/meta.d.ts +26 -4
- package/dist/meta.d.ts.map +1 -1
- package/dist/meta.js +34 -6
- package/dist/meta.js.map +1 -1
- package/dist/tree.d.ts +42 -0
- package/dist/tree.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,125 @@
|
|
|
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>>;
|
|
125
|
+
//# sourceMappingURL=directives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAQtD,gFAAgF;AAChF,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,IAAI,EAAE,aAAa,CAAC;IACpB,sDA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clude = (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
|
+
}
|
|
27
|
+
//# sourceMappingURL=directives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directives.js","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":"AAyEA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAW,EAAwB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC;AAC7F,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAW,EAAoB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;AACjF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAW,EAAmB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;AAC/E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAW,EAAyB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,eAAe,CAAC;AACjG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAW,EAA2B,EAAE,CACvE,aAAa,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;AAsDvE,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,UAAU;IACV,kBAAkB;IAClB,sBAAsB;CACvB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAA2B,EAA4B,EAAE,CACzF,sBAAsB,CAAC,GAAG,CAAE,CAAsB,CAAC,IAAI,CAAC,CAAC;AAE3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,CAAU,CAAC;AAGjG,oEAAoE;AACpE,MAAM,UAAU,WAAW,CAAC,IAAc;IACxC,MAAM,GAAG,GAA4C,EAAE,CAAC;IACxD,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,KAAK,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/format.d.ts
CHANGED
|
@@ -24,6 +24,14 @@ export interface ExportPage {
|
|
|
24
24
|
headings: Heading[];
|
|
25
25
|
/** Target URL for redirect/navigation pages (no body content, just a link) */
|
|
26
26
|
redirect?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Marks an include fragment (not a routable page): content meant to be
|
|
29
|
+
* `{% include %}`'d into other pages. Exporters write it as a plain `.md`
|
|
30
|
+
* include target at its slug — no frontmatter, no title, no nav entry. Used
|
|
31
|
+
* by structural-partial import modes (Docusaurus `--partial-mode include`,
|
|
32
|
+
* AsciiDoc fragments).
|
|
33
|
+
*/
|
|
34
|
+
fragment?: boolean;
|
|
27
35
|
/**
|
|
28
36
|
* Raw frontmatter data from the source page. Includes all YAML fields that
|
|
29
37
|
* were present in the original source (title, description, tags, custom
|
|
@@ -60,6 +68,26 @@ export interface ExportPage {
|
|
|
60
68
|
* See plans/multi-source-content.md.
|
|
61
69
|
*/
|
|
62
70
|
multiSource?: MultiSourceMeta;
|
|
71
|
+
/**
|
|
72
|
+
* Direct-from-source markdown body, when the importer can produce
|
|
73
|
+
* one. Bypasses the TreeNode round-trip for callers that want to
|
|
74
|
+
* preserve the source's line structure verbatim (most importantly,
|
|
75
|
+
* `migrate-asciidoc`, which would otherwise see markdown-it fold
|
|
76
|
+
* adjacent non-blank lines into one paragraph and the
|
|
77
|
+
* format-dogsbay-md serializer flatten that paragraph onto a single
|
|
78
|
+
* line — turning every `ifdef` / `endif` block in the original
|
|
79
|
+
* `.adoc` into an unreadable wall of text).
|
|
80
|
+
*
|
|
81
|
+
* Importers that produce a faithful direct-from-source markdown
|
|
82
|
+
* (currently `format-asciidoc`) populate this field. Importers that
|
|
83
|
+
* don't (most format plugins) leave it `undefined` and consumers
|
|
84
|
+
* fall back to the TreeNode-derived body via `treeToDogsbayMd`.
|
|
85
|
+
*
|
|
86
|
+
* The TreeNode round-trip is still the canonical path for runtime
|
|
87
|
+
* rendering — `bodyMarkdown` is a migration-time convenience that
|
|
88
|
+
* doesn't change the import contract.
|
|
89
|
+
*/
|
|
90
|
+
bodyMarkdown?: string;
|
|
63
91
|
}
|
|
64
92
|
/**
|
|
65
93
|
* Per-page axis metadata. Set by the loader's aggregator when
|
|
@@ -93,6 +121,39 @@ export interface NavItem {
|
|
|
93
121
|
label: string;
|
|
94
122
|
href?: string;
|
|
95
123
|
children?: NavItem[];
|
|
124
|
+
/**
|
|
125
|
+
* Granularity book view (plans/granularity-views.md). Opt-in, per nav node:
|
|
126
|
+
* - "yes" — emit one rolled-up single page for this node's subtree.
|
|
127
|
+
* - "children" — emit a single page for each direct child (chapters); a
|
|
128
|
+
* child may override with its own "no".
|
|
129
|
+
* - "no" — no single page (the default when omitted).
|
|
130
|
+
*/
|
|
131
|
+
singlePage?: "yes" | "no" | "children";
|
|
132
|
+
/**
|
|
133
|
+
* A state marker rendered beside the label — structured DATA, not text
|
|
134
|
+
* baked into `label`. Release comparisons use it for changed/new/removed
|
|
135
|
+
* pages; the same slot serves "new since your last visit", deprecation
|
|
136
|
+
* flags, and version badges.
|
|
137
|
+
*
|
|
138
|
+
* The renderer is responsible for making it perceivable WITHOUT colour
|
|
139
|
+
* (distinct glyph + visually-hidden text) — see SidebarNavTree.
|
|
140
|
+
*
|
|
141
|
+
* A branch may carry a marker for its SUBTREE: a collapsed group hides
|
|
142
|
+
* its children, so a change inside it must signal outward (the same
|
|
143
|
+
* visibility rule the diff renderer applies to tabs).
|
|
144
|
+
*/
|
|
145
|
+
mark?: NavMark;
|
|
146
|
+
}
|
|
147
|
+
export type NavMarkKind = "added" | "changed" | "removed" | "moved";
|
|
148
|
+
export interface NavMark {
|
|
149
|
+
kind: NavMarkKind;
|
|
150
|
+
/**
|
|
151
|
+
* Announced to assistive tech and shown on hover. Defaults to `kind`.
|
|
152
|
+
* A branch aggregating its subtree says so ("3 pages changed").
|
|
153
|
+
*/
|
|
154
|
+
label?: string;
|
|
155
|
+
/** True when this marker summarizes DESCENDANTS, not the item itself. */
|
|
156
|
+
subtree?: boolean;
|
|
96
157
|
}
|
|
97
158
|
/**
|
|
98
159
|
* Standard interface for format plugins.
|
|
@@ -114,13 +175,80 @@ export interface FormatPlugin {
|
|
|
114
175
|
/** Format-specific CLI options for export */
|
|
115
176
|
exportOptions?: FormatOption[];
|
|
116
177
|
/** Import: read source format, produce pages + nav */
|
|
117
|
-
import?(source: string, opts: Record<string, unknown>): Promise<
|
|
118
|
-
pages: ExportPage[];
|
|
119
|
-
nav: NavItem[];
|
|
120
|
-
}>;
|
|
178
|
+
import?(source: string, opts: Record<string, unknown>): Promise<ImportResult>;
|
|
121
179
|
/** Export: write pages + nav to target format */
|
|
122
180
|
export?(pages: ExportPage[], nav: NavItem[], output: string, opts: Record<string, unknown>): Promise<void>;
|
|
123
181
|
}
|
|
182
|
+
export interface ImportResult {
|
|
183
|
+
pages: ExportPage[];
|
|
184
|
+
nav: NavItem[];
|
|
185
|
+
/**
|
|
186
|
+
* Directories whose CONTENTS should be mounted at `_assets/` in the output,
|
|
187
|
+
* so the `/_assets/…` refs importers rewrite image paths to actually
|
|
188
|
+
* resolve.
|
|
189
|
+
*
|
|
190
|
+
* An importer that knows where its media lives (a Starlight `src/assets`, a
|
|
191
|
+
* Docusaurus `static/`) declares it here. Without this the reference
|
|
192
|
+
* survives the conversion and the FILE does not — a page count, a retention
|
|
193
|
+
* score and a clean exit all look fine while every image 404s.
|
|
194
|
+
*
|
|
195
|
+
* `into` targets an `_assets/<into>` subdir; `mediaOnly` copies only media
|
|
196
|
+
* files, for the case where the mounted dir is the docs tree itself and
|
|
197
|
+
* carries co-located images.
|
|
198
|
+
*/
|
|
199
|
+
assetMounts?: {
|
|
200
|
+
dir: string;
|
|
201
|
+
into?: string;
|
|
202
|
+
mediaOnly?: boolean;
|
|
203
|
+
exclude?: string[];
|
|
204
|
+
}[];
|
|
205
|
+
/**
|
|
206
|
+
* Directory that page slugs are relative to, when it is NOT the path the
|
|
207
|
+
* user passed on the command line.
|
|
208
|
+
*
|
|
209
|
+
* MkDocs keeps its pages under `docs/`, Hugo under `content/`, a Docusaurus
|
|
210
|
+
* instance under its own docs dir — so a page at slug `guide/install`
|
|
211
|
+
* writing `{% include "_snippets/note.md" %}` means
|
|
212
|
+
* `<source>/docs/_snippets/note.md`, not `<source>/_snippets/note.md`.
|
|
213
|
+
* Resolving includes against the CLI argument missed every fragment in
|
|
214
|
+
* those corpora, which (since unresolved includes now fail the run) turned
|
|
215
|
+
* a working conversion into a hard error.
|
|
216
|
+
*
|
|
217
|
+
* Omit when slugs are relative to `source` itself.
|
|
218
|
+
*/
|
|
219
|
+
contentRoot?: string;
|
|
220
|
+
/**
|
|
221
|
+
* SEVERAL content roots, each mounted under a slug prefix — the Antora
|
|
222
|
+
* PLAYBOOK case (#067): `docs/guides/` → `guides/`, `docs/server-admin-4.9/`
|
|
223
|
+
* → `server-admin/server-4.9/`. Fragments (partials, examples, images)
|
|
224
|
+
* under each `dir` are mirrored beneath its `prefix` so a page at
|
|
225
|
+
* `guides/deploy/x` writing `{% include "../../modules/ROOT/partials/y.md" %}`
|
|
226
|
+
* finds `<content>/guides/modules/ROOT/partials/y.md`. Takes precedence
|
|
227
|
+
* over `contentRoot` when present. `prefix` is `""` for the root mount.
|
|
228
|
+
*/
|
|
229
|
+
sourceMounts?: {
|
|
230
|
+
dir: string;
|
|
231
|
+
prefix: string;
|
|
232
|
+
}[];
|
|
233
|
+
/**
|
|
234
|
+
* Antora playbook mode (#067): loaded components by NAME → root dir +
|
|
235
|
+
* slug prefix, for the engine's cross-component resource-ID
|
|
236
|
+
* resolution in fragments (pages get it via the plugin's own parse).
|
|
237
|
+
*/
|
|
238
|
+
antoraComponents?: Record<string, {
|
|
239
|
+
dir: string;
|
|
240
|
+
prefix: string;
|
|
241
|
+
}>;
|
|
242
|
+
/**
|
|
243
|
+
* Attribute values the CORPUS declares (Antora playbook + component
|
|
244
|
+
* `asciidoc.attributes`, an AsciiBinder distro map, …) that the site
|
|
245
|
+
* build must resolve — a `{{ serverversion49 }}` the migrate emitted
|
|
246
|
+
* shipped as literal `{serverversion49}` because nothing wrote them into
|
|
247
|
+
* `dogsbay.config.yml` (#067 review). Migrate persists these under the
|
|
248
|
+
* user's own `--attribute` values (user wins).
|
|
249
|
+
*/
|
|
250
|
+
corpusAttributes?: Record<string, unknown>;
|
|
251
|
+
}
|
|
124
252
|
export interface FormatOption {
|
|
125
253
|
flags: string;
|
|
126
254
|
description: string;
|
|
@@ -270,6 +398,30 @@ export interface SiteConfig {
|
|
|
270
398
|
* human-facing UI cluster.
|
|
271
399
|
*/
|
|
272
400
|
llmActions?: LlmActionsConfig;
|
|
401
|
+
/**
|
|
402
|
+
* Resolved glyphs for the internal/external link-icon affordance.
|
|
403
|
+
* When present, `DocsLayout` marks links in the prose with a small
|
|
404
|
+
* trailing icon so readers can tell internal navigation from links
|
|
405
|
+
* that leave the site. Sourced from `content.linkIcons` in
|
|
406
|
+
* `dogsbay.config.yml` and normalized by the CLI. Omitted (whole
|
|
407
|
+
* object absent) when the feature is off. Either side may be absent
|
|
408
|
+
* to show an icon for only that link kind. A core feature — not tied
|
|
409
|
+
* to any importer. See plans/link-resolution-and-icons.md.
|
|
410
|
+
*/
|
|
411
|
+
linkIcons?: LinkIconsConfig;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Resolved glyphs for the internal/external link-icon affordance
|
|
415
|
+
* (`SiteConfig.linkIcons`). Classification is by href shape at render
|
|
416
|
+
* time: external = absolute (`http(s)://`) or protocol-relative
|
|
417
|
+
* (`//host`); internal = root/relative. An absent side shows no icon
|
|
418
|
+
* for that kind.
|
|
419
|
+
*/
|
|
420
|
+
export interface LinkIconsConfig {
|
|
421
|
+
/** Glyph appended after external links (e.g. "↗"). */
|
|
422
|
+
external?: string;
|
|
423
|
+
/** Glyph appended after internal links (e.g. "→"). */
|
|
424
|
+
internal?: string;
|
|
273
425
|
}
|
|
274
426
|
/**
|
|
275
427
|
* Closed list of LLM provider deep-link targets. Each one is a
|
|
@@ -329,6 +481,27 @@ export interface TaxonomyDisplay {
|
|
|
329
481
|
prefixes?: Record<string, TagPrefixDisplay>;
|
|
330
482
|
/** Per-slug label overrides; key = full slug, value = display string. */
|
|
331
483
|
labels?: Record<string, string>;
|
|
484
|
+
/**
|
|
485
|
+
* Sort weight for the facet column in the search dialog. Lower
|
|
486
|
+
* numbers appear first; unset facets sort alphabetically after
|
|
487
|
+
* any pinned ones. Use this to pin "Type" or "Audience" to the
|
|
488
|
+
* top of the sidebar even though they sort later by name.
|
|
489
|
+
*/
|
|
490
|
+
order?: number;
|
|
491
|
+
/**
|
|
492
|
+
* Render this facet as a hierarchical tree in the search dialog
|
|
493
|
+
* instead of a flat checkbox list. Two render strategies depending
|
|
494
|
+
* on the value shape:
|
|
495
|
+
* - Values containing `/` are treated as slash-encoded paths
|
|
496
|
+
* (`concept/a11y` → `concept → a11y`). Common for tag taxonomies.
|
|
497
|
+
* - Values without `/` derive their tree from `nav.json` document
|
|
498
|
+
* order (the auto-`category` facet shape).
|
|
499
|
+
* Parent click auto-selects all descendant values; three-state
|
|
500
|
+
* checkboxes reflect partial selection. Off by default — set true
|
|
501
|
+
* on `category` and on slash-nested tag taxonomies.
|
|
502
|
+
* See plans/hierarchical-facets.md.
|
|
503
|
+
*/
|
|
504
|
+
hierarchical?: boolean;
|
|
332
505
|
}
|
|
333
506
|
/**
|
|
334
507
|
* Display config for one taxonomy prefix. Color is one of the
|
package/dist/format.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,IAAI,EAAE,QAAQ,EAAE,CAA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@@
|
|
|
1
|
-
export type { TreeNode, InlineNode, InlineText, InlineLink, InlineImage, InlineCode, InlineFootnoteRef, InlineKbd, InlineIcon, InlineMath, InlineHtml, InlineBreak } from "./tree.js";
|
|
1
|
+
export type { TreeNode, InlineNode, InlineText, InlineLink, InlineAttrs, InlineImage, InlineCode, InlineFootnoteRef, InlineKbd, InlineIcon, InlineMath, InlineHtml, InlineBreak } from "./tree.js";
|
|
2
|
+
export type { ConditionalNode, IncludeNode, VarDefNode, DirectiveRawNode, DirectiveBlockNode, InlineVariable, InlineConditionalSpan, InlineDirectiveRaw, InlineDirectiveNode, InlineNodeWithDirectives, ProfilingAttr, } from "./directives.js";
|
|
3
|
+
export { isConditional, isInclude, isVarDef, isDirectiveRaw, isDirectiveBlock, isInlineDirective, PROFILING_ATTRS, profilingOf, } from "./directives.js";
|
|
2
4
|
export { treeToJson, chunkByHeadings, extractText } from "./json.js";
|
|
3
5
|
export type { RagChunk } from "./json.js";
|
|
4
|
-
export type { ExportPage, Heading, NavItem, FormatPlugin, FormatOption, SiteConfig, PlausibleConfig, TagPrefixDisplay, TagPaletteName, TaxonomyDisplay, LlmActionsConfig, LlmActionsPlacement, LlmProviderName } from "./format.js";
|
|
6
|
+
export type { ExportPage, Heading, NavItem, NavMark, NavMarkKind, FormatPlugin, FormatOption, ImportResult, SiteConfig, PlausibleConfig, TagPrefixDisplay, TagPaletteName, TaxonomyDisplay, LlmActionsConfig, LlmActionsPlacement, LlmProviderName, LinkIconsConfig } from "./format.js";
|
|
5
7
|
export type { PageMeta, PageStatus, ParseMetaOptions } from "./meta.js";
|
|
6
|
-
export { parseMeta } from "./meta.js";
|
|
8
|
+
export { STATUS_VALUES, parseMeta } from "./meta.js";
|
|
7
9
|
export type { DogsbayPlugin, DogsbayPluginContext, DogsbayPluginFactory, PluginVisibleConfig, PluginLogger, PluginRule, PluginIssue, PluginConfigEntry, EmitFilesHelpers, AstroIntegrationRef, } from "./plugin.js";
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACnM,YAAY,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,SAAS,EACT,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACzR,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACrD,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { isConditional, isInclude, isVarDef, isDirectiveRaw, isDirectiveBlock, isInlineDirective, PROFILING_ATTRS, profilingOf, } from "./directives.js";
|
|
1
2
|
export { treeToJson, chunkByHeadings, extractText } from "./json.js";
|
|
2
|
-
export { parseMeta } from "./meta.js";
|
|
3
|
+
export { STATUS_VALUES, parseMeta } from "./meta.js";
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,aAAa,EACb,SAAS,EACT,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIrE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/meta.d.ts
CHANGED
|
@@ -19,13 +19,19 @@ export interface PageMeta {
|
|
|
19
19
|
tags?: string[];
|
|
20
20
|
/**
|
|
21
21
|
* Broader grouping. Auto-derived from path when frontmatter
|
|
22
|
-
* doesn't supply a valid value
|
|
23
|
-
*
|
|
24
|
-
* `
|
|
22
|
+
* doesn't supply a valid value, emitted as **cumulative slash-
|
|
23
|
+
* paths** so each value uniquely identifies its position in the
|
|
24
|
+
* hierarchy (`content/guides/oauth/setup.md` →
|
|
25
|
+
* `["guides", "guides/oauth"]`). The bare top segment is
|
|
26
|
+
* preserved so simple queries like `category:guides` still match
|
|
27
|
+
* the whole subtree. Override with `category: foo` or
|
|
28
|
+
* `category: [foo, bar]` (explicit values pass through
|
|
29
|
+
* unchanged — no auto-prefix).
|
|
25
30
|
*
|
|
26
31
|
* No first-class "belongs nowhere" sentinel in v1: `category: []`
|
|
27
32
|
* falls through to slug-derived default. See
|
|
28
|
-
* plans/metadata-and-taxonomies.md
|
|
33
|
+
* plans/metadata-and-taxonomies.md and
|
|
34
|
+
* plans/hierarchical-facets.md.
|
|
29
35
|
*/
|
|
30
36
|
category?: string[];
|
|
31
37
|
/**
|
|
@@ -41,6 +47,16 @@ export interface PageMeta {
|
|
|
41
47
|
/** ISO date strings. Consumers parse to Date when needed. */
|
|
42
48
|
updated?: string;
|
|
43
49
|
created?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Post authors. Accepts a single string or a list in frontmatter;
|
|
52
|
+
* always normalized to a list here so consumers have one shape.
|
|
53
|
+
*
|
|
54
|
+
* Added for the blog capability (plans/blog-capability.md) — it was
|
|
55
|
+
* the only field a post needs that PageMeta did not already carry.
|
|
56
|
+
* Absent means "no byline", never "unknown author": the layout omits
|
|
57
|
+
* the row entirely rather than rendering a placeholder.
|
|
58
|
+
*/
|
|
59
|
+
author?: string[];
|
|
44
60
|
/** Sort hint for navigation/list pages. Lower weight first. */
|
|
45
61
|
weight?: number;
|
|
46
62
|
/**
|
|
@@ -77,6 +93,12 @@ export interface ParseMetaOptions {
|
|
|
77
93
|
*/
|
|
78
94
|
taxonomyNames?: readonly string[];
|
|
79
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Closed enum for status validation. Exported so the frontmatter CHECKER
|
|
98
|
+
* (packages/commands) reports exactly the values this parser drops, instead
|
|
99
|
+
* of restating the list a third time.
|
|
100
|
+
*/
|
|
101
|
+
export declare const STATUS_VALUES: readonly PageStatus[];
|
|
80
102
|
/**
|
|
81
103
|
* Parse and normalize frontmatter into `PageMeta`. Pure function;
|
|
82
104
|
* no I/O. Unknown frontmatter keys are not lifted — they stay in
|
package/dist/meta.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,+EAA+E;AAC/E,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,CAAC;AAEvE,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,+EAA+E;AAC/E,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,CAAC;AAEvE,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,6EAA6E;IAC7E,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACvC;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,UAAU,EAK9C,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAChD,OAAO,GAAE,gBAAqB,GAC7B,QAAQ,CA2CV"}
|
package/dist/meta.js
CHANGED
|
@@ -8,8 +8,12 @@
|
|
|
8
8
|
*
|
|
9
9
|
* See plans/metadata-and-taxonomies.md for the design rationale.
|
|
10
10
|
*/
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Closed enum for status validation. Exported so the frontmatter CHECKER
|
|
13
|
+
* (packages/commands) reports exactly the values this parser drops, instead
|
|
14
|
+
* of restating the list a third time.
|
|
15
|
+
*/
|
|
16
|
+
export const STATUS_VALUES = [
|
|
13
17
|
"draft",
|
|
14
18
|
"preview",
|
|
15
19
|
"stable",
|
|
@@ -58,6 +62,9 @@ export function parseMeta(frontmatter, options = {}) {
|
|
|
58
62
|
const created = coerceIsoDate(fm.created);
|
|
59
63
|
if (created)
|
|
60
64
|
meta.created = created;
|
|
65
|
+
const author = coerceStringArray(fm.author);
|
|
66
|
+
if (author)
|
|
67
|
+
meta.author = author;
|
|
61
68
|
if (typeof fm.weight === "number" && Number.isFinite(fm.weight)) {
|
|
62
69
|
meta.weight = fm.weight;
|
|
63
70
|
}
|
|
@@ -71,13 +78,29 @@ export function parseMeta(frontmatter, options = {}) {
|
|
|
71
78
|
}
|
|
72
79
|
/**
|
|
73
80
|
* Auto-derive `category` from a slug. The leaf segment is treated
|
|
74
|
-
* as the page filename and dropped; remaining segments
|
|
75
|
-
*
|
|
81
|
+
* as the page filename and dropped; remaining segments emit as
|
|
82
|
+
* **cumulative slash-paths**, so each value uniquely identifies its
|
|
83
|
+
* position in the document hierarchy.
|
|
76
84
|
*
|
|
77
85
|
* - `"guides/auth"` → `["guides"]`
|
|
78
|
-
* - `"guides/oauth/setup"` → `["guides", "oauth"]`
|
|
86
|
+
* - `"guides/oauth/setup"` → `["guides", "guides/oauth"]`
|
|
87
|
+
* - `"installing/installing_aws/ipi/foo"` → `["installing", "installing/installing_aws", "installing/installing_aws/ipi"]`
|
|
79
88
|
* - `"intro"` → undefined (no parent path)
|
|
80
89
|
* - `""` / undefined → undefined
|
|
90
|
+
*
|
|
91
|
+
* Why cumulative instead of bare segments: a leaf name like `ipi`
|
|
92
|
+
* appears at multiple positions across a large corpus (under
|
|
93
|
+
* `installing/installing_aws/`, `installing/installing_azure/`, …).
|
|
94
|
+
* Bare segments would collide as Pagefind filter values, so the
|
|
95
|
+
* search dialog's hierarchical-facet tree can't distinguish
|
|
96
|
+
* positions and tree-click cascades leak across siblings. Cumulative
|
|
97
|
+
* paths disambiguate fully and also let the search dialog detect
|
|
98
|
+
* the slash-encoded shape automatically (no nav.json needed to build
|
|
99
|
+
* the tree). The containment semantic is preserved — every page
|
|
100
|
+
* under `installing/` still carries the bare-prefix `"installing"`
|
|
101
|
+
* value as its top-level entry, so existing filter queries like
|
|
102
|
+
* `category:installing` continue to match the whole subtree.
|
|
103
|
+
* See plans/hierarchical-facets.md ("Open follow-ups").
|
|
81
104
|
*/
|
|
82
105
|
function deriveCategoryFromSlug(slug) {
|
|
83
106
|
if (!slug)
|
|
@@ -85,7 +108,12 @@ function deriveCategoryFromSlug(slug) {
|
|
|
85
108
|
const parts = slug.split("/").filter((p) => p.length > 0);
|
|
86
109
|
if (parts.length < 2)
|
|
87
110
|
return undefined;
|
|
88
|
-
|
|
111
|
+
const parents = parts.slice(0, -1);
|
|
112
|
+
const out = [];
|
|
113
|
+
for (let i = 0; i < parents.length; i++) {
|
|
114
|
+
out.push(parents.slice(0, i + 1).join("/"));
|
|
115
|
+
}
|
|
116
|
+
return out;
|
|
89
117
|
}
|
|
90
118
|
function coerceStringArray(value) {
|
|
91
119
|
if (typeof value === "string") {
|
package/dist/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAA0B;IAClD,OAAO;IACP,SAAS;IACT,QAAQ;IACR,YAAY;CACb,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,SAAS,CACvB,WAAgD,EAChD,UAA4B,EAAE;IAE9B,MAAM,EAAE,GAAG,WAAW,IAAI,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,MAAM,IAAI,GAAG,iBAAiB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,IAAI;QAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAE3B,MAAM,QAAQ,GACZ,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,sBAAsB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,IAAI,QAAQ;QAAE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAEvC,IAAI,OAAO,EAAE,CAAC,IAAI,KAAK,QAAQ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AS;QAC5E,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1C,IAAI,KAAK;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IAC/B,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC"}
|
package/dist/tree.d.ts
CHANGED
|
@@ -49,8 +49,25 @@ export interface InlineLink {
|
|
|
49
49
|
type: "link";
|
|
50
50
|
href: string;
|
|
51
51
|
title?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Attributes from a trailing `{...}` block, e.g.
|
|
54
|
+
* `[text](href){.class #id style="..."}`. `id`, `class`, and `style`
|
|
55
|
+
* are first-class; any other key passes through to the renderer.
|
|
56
|
+
*/
|
|
57
|
+
attrs?: InlineAttrs;
|
|
52
58
|
children: InlineNode[];
|
|
53
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Attribute set for inline elements (links and images). Mirrors the
|
|
62
|
+
* shape of block-level attribute blocks but lives on the inline node
|
|
63
|
+
* so renderers can apply id/class/style to the emitted element.
|
|
64
|
+
*/
|
|
65
|
+
export interface InlineAttrs {
|
|
66
|
+
id?: string;
|
|
67
|
+
class?: string;
|
|
68
|
+
style?: string;
|
|
69
|
+
[key: string]: string | undefined;
|
|
70
|
+
}
|
|
54
71
|
/** Image (block or inline depending on context). */
|
|
55
72
|
export interface InlineImage {
|
|
56
73
|
type: "image";
|
|
@@ -59,11 +76,36 @@ export interface InlineImage {
|
|
|
59
76
|
title?: string;
|
|
60
77
|
width?: number;
|
|
61
78
|
height?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Attributes from a trailing `{...}` block, e.g.
|
|
81
|
+
* `{.class #id width="64"}`. `id`, `class`, and `style`
|
|
82
|
+
* are first-class; any other key passes through to the renderer.
|
|
83
|
+
* Mirrors `InlineLink.attrs`.
|
|
84
|
+
*/
|
|
85
|
+
attrs?: InlineAttrs;
|
|
62
86
|
}
|
|
63
87
|
/** Inline code span. */
|
|
64
88
|
export interface InlineCode {
|
|
65
89
|
type: "code";
|
|
66
90
|
text: string;
|
|
91
|
+
/**
|
|
92
|
+
* The span carries the `{minja}` build-processing opt-in
|
|
93
|
+
* (`` `x`{minja} `` — the inline twin of the `{minja}` fence marker;
|
|
94
|
+
* planted by the AsciiDoc engine on spans holding attribute refs).
|
|
95
|
+
* Parser and serializer round-trip it so a normalize pass or an
|
|
96
|
+
* editor save can't silently flip the span back to masked (#030).
|
|
97
|
+
*/
|
|
98
|
+
minja?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Formatting inherited from an enclosing strong/em/strike span
|
|
101
|
+
* (`**\`code\` text**`). Without these the parser dropped the wrapper
|
|
102
|
+
* on the code node and serializers re-emitted the caption as
|
|
103
|
+
* `\`LVMCluster\`** CR fields**` — bold broken, literal `**` visible
|
|
104
|
+
* (issue #045).
|
|
105
|
+
*/
|
|
106
|
+
bold?: boolean;
|
|
107
|
+
italic?: boolean;
|
|
108
|
+
strikethrough?: boolean;
|
|
67
109
|
}
|
|
68
110
|
/** Highlighted/marked text (==text== in Obsidian/pymdownx.mark). */
|
|
69
111
|
export interface InlineHighlight {
|
package/dist/tree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../src/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACvB,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IAEb,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,uCAAuC;IACvC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEtB,yEAA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AAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kBAAkB;AAClB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;CACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dogsbay/types",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.100",
|
|
4
4
|
"description": "Universal document tree model for Dogsbay format loaders and renderers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"types"
|
|
23
23
|
],
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"typescript": "^5.
|
|
26
|
-
"vitest": "^
|
|
25
|
+
"typescript": "^5.9.3",
|
|
26
|
+
"vitest": "^4.1.10"
|
|
27
27
|
},
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"repository": {
|