@dogsbay/format-mkdocs 0.2.0-beta.121 → 0.2.0-beta.123

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.
Files changed (123) hide show
  1. package/dist/cli.d.ts +0 -1
  2. package/dist/cli.js +2 -1
  3. package/dist/export/capabilities.d.ts +22 -0
  4. package/dist/export/capabilities.js +213 -0
  5. package/dist/export/to-astro.d.ts +0 -1
  6. package/dist/export/to-astro.js +0 -1
  7. package/dist/export/to-mkdocs-project.d.ts +0 -1
  8. package/dist/export/to-mkdocs-project.js +0 -1
  9. package/dist/export/to-mkdocs.d.ts +0 -1
  10. package/dist/export/to-mkdocs.js +24 -5
  11. package/dist/importer.d.ts +0 -1
  12. package/dist/importer.js +0 -1
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/inline-walker.d.ts +0 -1
  16. package/dist/inline-walker.js +0 -1
  17. package/dist/loader.d.ts +0 -1
  18. package/dist/loader.js +0 -1
  19. package/dist/parse.d.ts +0 -1
  20. package/dist/parse.js +0 -1
  21. package/dist/renderers/mermaid.d.ts +0 -1
  22. package/dist/renderers/mermaid.js +0 -1
  23. package/dist/rules/admonition.d.ts +0 -1
  24. package/dist/rules/admonition.js +0 -1
  25. package/dist/rules/annotations.d.ts +0 -1
  26. package/dist/rules/annotations.js +0 -1
  27. package/dist/rules/autodoc.d.ts +0 -1
  28. package/dist/rules/autodoc.js +0 -1
  29. package/dist/rules/blocks.d.ts +0 -1
  30. package/dist/rules/blocks.js +0 -1
  31. package/dist/rules/content-tabs.d.ts +0 -1
  32. package/dist/rules/content-tabs.js +0 -1
  33. package/dist/rules/docusaurus-admonitions.d.ts +0 -1
  34. package/dist/rules/docusaurus-admonitions.js +0 -1
  35. package/dist/rules/file-include.d.ts +0 -1
  36. package/dist/rules/file-include.js +0 -1
  37. package/dist/rules/footnotes.d.ts +0 -1
  38. package/dist/rules/footnotes.js +0 -1
  39. package/dist/rules/icon-shortcode.d.ts +0 -1
  40. package/dist/rules/icon-shortcode.js +0 -1
  41. package/dist/rules/keys.d.ts +0 -1
  42. package/dist/rules/keys.js +0 -1
  43. package/dist/rules/link-rewrite.d.ts +0 -1
  44. package/dist/rules/link-rewrite.js +0 -1
  45. package/dist/rules/math.d.ts +0 -1
  46. package/dist/rules/math.js +0 -1
  47. package/dist/rules/md-in-html.d.ts +0 -1
  48. package/dist/rules/md-in-html.js +0 -1
  49. package/dist/rules/snippets.d.ts +0 -1
  50. package/dist/rules/snippets.js +0 -1
  51. package/dist/rules/templates.d.ts +0 -1
  52. package/dist/rules/templates.js +0 -1
  53. package/dist/rules/variants.d.ts +0 -1
  54. package/dist/rules/variants.js +0 -1
  55. package/dist/tree.d.ts +0 -1
  56. package/dist/tree.js +0 -1
  57. package/dist/utils/indent.d.ts +0 -1
  58. package/dist/utils/indent.js +0 -1
  59. package/dist/utils/types.d.ts +0 -1
  60. package/dist/utils/types.js +0 -1
  61. package/dist/walker.d.ts +0 -1
  62. package/dist/walker.js +0 -1
  63. package/package.json +5 -5
  64. package/dist/cli.d.ts.map +0 -1
  65. package/dist/cli.js.map +0 -1
  66. package/dist/export/to-astro.d.ts.map +0 -1
  67. package/dist/export/to-astro.js.map +0 -1
  68. package/dist/export/to-mkdocs-project.d.ts.map +0 -1
  69. package/dist/export/to-mkdocs-project.js.map +0 -1
  70. package/dist/export/to-mkdocs.d.ts.map +0 -1
  71. package/dist/export/to-mkdocs.js.map +0 -1
  72. package/dist/importer.d.ts.map +0 -1
  73. package/dist/importer.js.map +0 -1
  74. package/dist/index.d.ts.map +0 -1
  75. package/dist/index.js.map +0 -1
  76. package/dist/inline-walker.d.ts.map +0 -1
  77. package/dist/inline-walker.js.map +0 -1
  78. package/dist/loader.d.ts.map +0 -1
  79. package/dist/loader.js.map +0 -1
  80. package/dist/parse.d.ts.map +0 -1
  81. package/dist/parse.js.map +0 -1
  82. package/dist/renderers/mermaid.d.ts.map +0 -1
  83. package/dist/renderers/mermaid.js.map +0 -1
  84. package/dist/rules/admonition.d.ts.map +0 -1
  85. package/dist/rules/admonition.js.map +0 -1
  86. package/dist/rules/annotations.d.ts.map +0 -1
  87. package/dist/rules/annotations.js.map +0 -1
  88. package/dist/rules/autodoc.d.ts.map +0 -1
  89. package/dist/rules/autodoc.js.map +0 -1
  90. package/dist/rules/blocks.d.ts.map +0 -1
  91. package/dist/rules/blocks.js.map +0 -1
  92. package/dist/rules/content-tabs.d.ts.map +0 -1
  93. package/dist/rules/content-tabs.js.map +0 -1
  94. package/dist/rules/docusaurus-admonitions.d.ts.map +0 -1
  95. package/dist/rules/docusaurus-admonitions.js.map +0 -1
  96. package/dist/rules/file-include.d.ts.map +0 -1
  97. package/dist/rules/file-include.js.map +0 -1
  98. package/dist/rules/footnotes.d.ts.map +0 -1
  99. package/dist/rules/footnotes.js.map +0 -1
  100. package/dist/rules/icon-shortcode.d.ts.map +0 -1
  101. package/dist/rules/icon-shortcode.js.map +0 -1
  102. package/dist/rules/keys.d.ts.map +0 -1
  103. package/dist/rules/keys.js.map +0 -1
  104. package/dist/rules/link-rewrite.d.ts.map +0 -1
  105. package/dist/rules/link-rewrite.js.map +0 -1
  106. package/dist/rules/math.d.ts.map +0 -1
  107. package/dist/rules/math.js.map +0 -1
  108. package/dist/rules/md-in-html.d.ts.map +0 -1
  109. package/dist/rules/md-in-html.js.map +0 -1
  110. package/dist/rules/snippets.d.ts.map +0 -1
  111. package/dist/rules/snippets.js.map +0 -1
  112. package/dist/rules/templates.d.ts.map +0 -1
  113. package/dist/rules/templates.js.map +0 -1
  114. package/dist/rules/variants.d.ts.map +0 -1
  115. package/dist/rules/variants.js.map +0 -1
  116. package/dist/tree.d.ts.map +0 -1
  117. package/dist/tree.js.map +0 -1
  118. package/dist/utils/indent.d.ts.map +0 -1
  119. package/dist/utils/indent.js.map +0 -1
  120. package/dist/utils/types.d.ts.map +0 -1
  121. package/dist/utils/types.js.map +0 -1
  122. package/dist/walker.d.ts.map +0 -1
  123. package/dist/walker.js.map +0 -1
package/dist/cli.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  import type { FormatPlugin } from "@dogsbay/types";
2
2
  export declare const plugin: FormatPlugin;
3
- //# sourceMappingURL=cli.d.ts.map
package/dist/cli.js CHANGED
@@ -3,10 +3,12 @@ import { dirname, extname, join } from "node:path";
3
3
  import { importMkdocsProject } from "./importer.js";
4
4
  import { exportMkdocsProject } from "./export/to-mkdocs-project.js";
5
5
  import { formatLedgerReport } from "@dogsbay/serialize-core";
6
+ import { MKDOCS_CAPABILITIES } from "./export/capabilities.js";
6
7
  export const plugin = {
7
8
  name: "mkdocs",
8
9
  canImport: true,
9
10
  canExport: true,
11
+ capabilities: MKDOCS_CAPABILITIES,
10
12
  detectSource: (path) => existsSync(join(path, "mkdocs.yml")),
11
13
  importOptions: [
12
14
  { flags: "--theme <name>", description: "Theme preset (default, material)", default: "default" },
@@ -138,4 +140,3 @@ function mkdocsTheme(opts) {
138
140
  }
139
141
  return "material";
140
142
  }
141
- //# sourceMappingURL=cli.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * What the MkDocs (Material + PyMdown) exporter can and cannot represent.
3
+ *
4
+ * This is a CONTRACT, not commentary: `validateCapabilities` rejects any
5
+ * non-full entry without a note, and `tests/capabilities.test.ts` asserts every
6
+ * row of the component × format matrix (`MATRIX_ROWS` in
7
+ * @dogsbay/serialize-core) is declared exactly once. Each cell was set by
8
+ * reading `to-mkdocs.ts` / `to-mkdocs-project.ts` AND running the serializer
9
+ * on real parsed dogsbay-md, not from the extension list.
10
+ *
11
+ * Support levels:
12
+ * full — round-trips faithfully (given the extensions the project
13
+ * emitter enables in mkdocs.yml)
14
+ * partial — survives with reduced fidelity (styling/semantics lost)
15
+ * none — no MkDocs construct; the wrapper is dropped and the content
16
+ * flattened into plain blocks (recorded as the node type)
17
+ *
18
+ * A `partial` here is not necessarily recorded per page — several are known
19
+ * structural limits the serializer does not ledger (noted where so).
20
+ */
21
+ import type { CapabilityDeclaration } from "@dogsbay/serialize-core";
22
+ export declare const MKDOCS_CAPABILITIES: CapabilityDeclaration[];
@@ -0,0 +1,213 @@
1
+ export const MKDOCS_CAPABILITIES = [
2
+ // ── Blocks ──────────────────────────────────────────────
3
+ {
4
+ feature: "heading",
5
+ support: "partial",
6
+ rendersAs: "`#`–`######` with the authored id as `{ #id }` (attr_list)",
7
+ note: "The id survives; heading classes (`{.cls}`) are dropped, unrecorded.",
8
+ },
9
+ { feature: "paragraph", support: "full" },
10
+ { feature: "blockquote", support: "full", rendersAs: "`> …`" },
11
+ { feature: "unordered-list", support: "full", rendersAs: "`- item`, four-space continuation; task items via pymdownx.tasklist" },
12
+ { feature: "ordered-list", support: "full", rendersAs: "`1. item` (start number kept)" },
13
+ { feature: "hr", support: "full", rendersAs: "`---`" },
14
+ {
15
+ feature: "table",
16
+ support: "partial",
17
+ rendersAs: "GFM pipe table; `<table markdown>` with `markdown=\"block\"` cells when a cell holds block content or spans",
18
+ note: "The table's caption, id and classes are dropped, unrecorded.",
19
+ },
20
+ {
21
+ feature: "code",
22
+ support: "partial",
23
+ rendersAs: "fence with language, `title=\"…\"` and `hl_lines` (pymdownx.highlight + superfences)",
24
+ note: "Code annotations are not recreated: the `(N)!` markers come back as literal `(N)` in the code (no `.annotate` class, no `content.code.annotate` feature), unrecorded.",
25
+ },
26
+ {
27
+ feature: "math-block",
28
+ support: "partial",
29
+ rendersAs: "`$$ … $$` (pymdownx.arithmatex, generic)",
30
+ note: "The LaTeX survives, but arithmatex `generic` needs MathJax/KaTeX in `extra_javascript` and the emitted mkdocs.yml adds none, so it is not typeset until one is added.",
31
+ },
32
+ { feature: "deflist", support: "full", rendersAs: "`Term` / `: definition` (def_list)" },
33
+ { feature: "figure", support: "full", rendersAs: "`<figure markdown>` + `<figcaption>` (md_in_html); the bare image when there is no caption" },
34
+ { feature: "footnote-list", support: "full", rendersAs: "`[^label]: …` (footnotes)" },
35
+ { feature: "html", support: "full", rendersAs: "raw HTML passed through, site-rooted asset paths made relative" },
36
+ { feature: "html-container", support: "full", rendersAs: "`<tag attrs markdown>` (md_in_html); `on*` attributes stripped" },
37
+ {
38
+ feature: "diagram",
39
+ support: "partial",
40
+ rendersAs: "```mermaid fence (superfences custom fence → Material's Mermaid)",
41
+ note: "Only Mermaid is rendered. Any other diagram language (plantuml, d2, …) is emitted as a fence no configured extension renders, so it shows as source code — unrecorded.",
42
+ },
43
+ { feature: "youtube", support: "full", rendersAs: "`<iframe>` on youtube-nocookie.com" },
44
+ // ── Components ──────────────────────────────────────────
45
+ {
46
+ feature: "callout",
47
+ support: "partial",
48
+ rendersAs: "`!!! type \"title\"` (admonition)",
49
+ note: "Variants Material lacks map to the nearest (`caution`/`important` → warning, keeping the word as the title); a custom per-callout icon is dropped, unrecorded.",
50
+ },
51
+ { feature: "details", support: "full", rendersAs: "`??? type \"title\"` / `???+` when open (pymdownx.details)" },
52
+ { feature: "details-sheet", support: "partial", rendersAs: "a normal collapsible block", note: "MkDocs Material has no side-sheet component: a `sheet` details is written as an ordinary collapsible block, content intact." },
53
+ { feature: "theme", support: "partial", rendersAs: "the content, unthemed", note: "MkDocs Material has no scoped themes: the wrapper is dropped and the content kept, in the page's own theme." },
54
+ { feature: "tabs-variant", support: "partial", rendersAs: "the default tabs", note: "MkDocs Material draws one tab style: a pills or underline variant shows as the default." },
55
+ { feature: "tone", support: "partial", rendersAs: "untinted cards", note: "MkDocs Material cards take no tone: the colour is lost, the content kept." },
56
+ { feature: "tabs", support: "full", rendersAs: "`=== \"Label\"` (pymdownx.tabbed, alternate_style)" },
57
+ {
58
+ feature: "steps",
59
+ support: "partial",
60
+ rendersAs: "ordered list with bold step titles",
61
+ note: "MkDocs has no steps component; recorded as `steps` degraded.",
62
+ },
63
+ {
64
+ feature: "accordion",
65
+ support: "partial",
66
+ rendersAs: "one `??? note \"Label\"` fold per item (pymdownx.details)",
67
+ note: "Material has no accordion: items fold independently, so opening one does not close the others, and a `defaultValue` is not applied.",
68
+ },
69
+ {
70
+ feature: "cards",
71
+ support: "partial",
72
+ rendersAs: "`<div class=\"grid cards\" markdown>` list (Material grid cards)",
73
+ note: "A column count is dropped — Material's grid is responsive. Unrecorded.",
74
+ },
75
+ {
76
+ feature: "card",
77
+ support: "partial",
78
+ rendersAs: "grid-card list item: bold title, body, `[:octicons-arrow-right-24: Title](href)`",
79
+ note: "The card's icon is dropped (unrecorded); an href becomes a trailing link rather than a clickable card.",
80
+ },
81
+ {
82
+ feature: "link-card",
83
+ support: "partial",
84
+ rendersAs: "bold title, description, trailing arrow link (a grid card when inside `cards`)",
85
+ note: "No link-card component; outside a card grid it is plain blocks. Unrecorded.",
86
+ },
87
+ {
88
+ feature: "files",
89
+ support: "partial",
90
+ rendersAs: "the nested list",
91
+ note: "No file-tree view: folders and files are a nested bulleted list.",
92
+ },
93
+ {
94
+ feature: "grid",
95
+ support: "partial",
96
+ rendersAs: "`<div class=\"grid cards\" markdown>` list",
97
+ note: "Rendered with CARD styling (not Material's plain `grid`); the column count is dropped and each `grid-item` wrapper is recorded as `grid-item`.",
98
+ },
99
+ {
100
+ feature: "link-button",
101
+ support: "partial",
102
+ rendersAs: "`[label](href){ .md-button .md-button--primary }`",
103
+ note: "Always the primary style — a variant is dropped. An unsafe href is dropped and recorded.",
104
+ },
105
+ {
106
+ feature: "related",
107
+ support: "partial",
108
+ rendersAs: "bold label + the link list",
109
+ note: "No related-links component: the semantic block becomes plain markdown.",
110
+ },
111
+ {
112
+ feature: "example",
113
+ support: "partial",
114
+ rendersAs: "the rendered children as plain blocks",
115
+ note: "No MkDocs example container: the wrapper is dropped (recorded) and the example's source listing (`props.source`) is lost; the preview content is kept.",
116
+ },
117
+ {
118
+ feature: "container",
119
+ support: "partial",
120
+ rendersAs: "the children as plain blocks",
121
+ note: "No MkDocs equivalent: the wrapper, its name and classes are dropped (recorded); the content is kept.",
122
+ },
123
+ {
124
+ feature: "annotation-list",
125
+ support: "partial",
126
+ rendersAs: "a plain ordered list after the code block",
127
+ note: "Material code annotations are not recreated (see `code`): the list renders as an ordinary numbered list. Unrecorded.",
128
+ },
129
+ // ── API reference ───────────────────────────────────────
130
+ {
131
+ feature: "endpoint",
132
+ support: "none",
133
+ rendersAs: "children only, or `<!-- unsupported: endpoint -->`",
134
+ note: "No case: method, path and summary are lost; any children are kept as plain blocks. Recorded as `endpoint` (action `degraded`, even when nothing survives).",
135
+ },
136
+ {
137
+ feature: "api-doc",
138
+ support: "partial",
139
+ rendersAs: "the docstring HTML converted to inline markdown",
140
+ note: "`props.html` is FLATTENED to one line: paragraphs, lists and code blocks run together with no separators (`<p>A.</p><ul><li>one</li>` → `A.one`). Unrecorded. Children-only api-docs are fine.",
141
+ },
142
+ {
143
+ feature: "api-class",
144
+ support: "partial",
145
+ rendersAs: "`### kind \\`name\\``, `Bases:` line, signature as a python fence",
146
+ note: "Plain headings and code, not mkdocstrings' object markup; the signature is always labelled python.",
147
+ },
148
+ {
149
+ feature: "api-member",
150
+ support: "partial",
151
+ rendersAs: "`#### kind \\`name\\``, signature as a python fence",
152
+ note: "As api-class.",
153
+ },
154
+ {
155
+ feature: "api-params",
156
+ support: "partial",
157
+ rendersAs: "raw HTML PARAMETER/DESCRIPTION table (mkdocstrings' layout)",
158
+ note: "Raw HTML without mkdocstrings' classes, so Material styles it as a plain table.",
159
+ },
160
+ {
161
+ feature: "api-source",
162
+ support: "partial",
163
+ rendersAs: "`*Source: file:line*` + a python fence",
164
+ note: "Not a collapsible source block; the code is always labelled python.",
165
+ },
166
+ // ── Inline ──────────────────────────────────────────────
167
+ {
168
+ feature: "link",
169
+ support: "partial",
170
+ rendersAs: "`[text](href \"title\"){ attrs }`; exported pages as relative `.md` links",
171
+ note: "An inline `:button[…]` link loses its button styling (no `.md-button`), unrecorded. An unsafe href is dropped (text kept) and recorded.",
172
+ },
173
+ {
174
+ feature: "image",
175
+ support: "full",
176
+ rendersAs: "`![alt](src \"title\"){ width height }` with a page-relative path (an unsafe src is refused, alt kept, and recorded)",
177
+ },
178
+ { feature: "kbd", support: "full", rendersAs: "`++ctrl+s++` (pymdownx.keys); a non-name key as a quoted key" },
179
+ {
180
+ feature: "math",
181
+ support: "partial",
182
+ rendersAs: "`$…$` (pymdownx.arithmatex, generic)",
183
+ note: "As math-block: not typeset until MathJax/KaTeX is added to `extra_javascript`.",
184
+ },
185
+ { feature: "highlight", support: "full", rendersAs: "`==text==` (pymdownx.mark)" },
186
+ {
187
+ feature: "badge",
188
+ support: "partial",
189
+ rendersAs: "plain text",
190
+ note: "No badge construct: the label is kept, the variant dropped. Recorded as `badge` degraded.",
191
+ },
192
+ {
193
+ feature: "icon",
194
+ support: "partial",
195
+ rendersAs: "`:name:` (pymdownx.emoji, Material/octicons/fontawesome/simple icon sets)",
196
+ note: "The library prefix is dropped (`lucide:check` → `:check:`); a name outside the Material emoji index renders as literal `:name:` text. Unrecorded.",
197
+ },
198
+ { feature: "footnote-ref", support: "full", rendersAs: "`[^label]` (footnotes)" },
199
+ { feature: "html-inline", support: "full", rendersAs: "raw inline HTML passed through" },
200
+ // ── Named concerns the exporter already records ─────────
201
+ {
202
+ feature: "include",
203
+ support: "partial",
204
+ rendersAs: "`--8<-- \"path\"` (pymdownx.snippets)",
205
+ note: "Includes are realized before export; one that arrives unresolved is emitted as a snippet reference and recorded.",
206
+ },
207
+ {
208
+ feature: "nav-entry",
209
+ support: "partial",
210
+ rendersAs: "mkdocs.yml `nav:` entry",
211
+ note: "A nav entry pointing at a page not in the export (or a section with no exported pages) is dropped and recorded.",
212
+ },
213
+ ];
@@ -23,4 +23,3 @@ export declare function escapeAttr(s: string): string;
23
23
  /** Escape text for use directly in an Astro template (not inside an expression). */
24
24
  export declare function escapeTemplate(s: string): string;
25
25
  export declare function treeToAstro(nodes: TreeNode[], options?: AstroGenOptions): AstroGenResult;
26
- //# sourceMappingURL=to-astro.d.ts.map
@@ -557,4 +557,3 @@ function indentStr(text, spaces) {
557
557
  function escapeHtml(s) {
558
558
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
559
559
  }
560
- //# sourceMappingURL=to-astro.js.map
@@ -36,4 +36,3 @@ export interface MkdocsProjectExport {
36
36
  * Returns file map (path → content) including mkdocs.yml and all .md files.
37
37
  */
38
38
  export declare function exportMkdocsProject(pages: ExportPage[], nav: NavItem[], options: MkdocsProjectOptions): MkdocsProjectExport;
39
- //# sourceMappingURL=to-mkdocs-project.d.ts.map
@@ -405,4 +405,3 @@ function buildMkdocsYml(options, extensions, navYaml) {
405
405
  lines.push("");
406
406
  return lines.join("\n");
407
407
  }
408
- //# sourceMappingURL=to-mkdocs-project.js.map
@@ -53,4 +53,3 @@ export declare function mkdocsHref(href: string): string;
53
53
  /** Normalise an href or slug to the slug form pages are keyed by. */
54
54
  export declare function hrefToSlugKey(href: string): string;
55
55
  export type { NavItem };
56
- //# sourceMappingURL=to-mkdocs.d.ts.map
@@ -1,4 +1,4 @@
1
- import { walkInline, applyTextFlags, renderLeaf, indent, prefixLines, pickCodeFence, codeSpan, stripHtml, inlineHtmlToMarkdown, renderUnknownNode, listStart, calloutVariant, leafHtml, isSafeHref, markdownDestination, markdownLatex, safeAnchorId, footnoteLabel, } from "@dogsbay/serialize-core";
1
+ import { walkInline, applyTextFlags, renderLeaf, indent, prefixLines, pickCodeFence, codeSpan, stripHtml, inlineHtmlToMarkdown, renderUnknownNode, listStart, calloutVariant, leafHtml, isSafeHref, markdownDestination, markdownLatex, safeAnchorId, footnoteLabel, renderAroundGroup, } from "@dogsbay/serialize-core";
2
2
  // Module-level, saved and restored around each treeToMkdocs call. Correct
3
3
  // for synchronous nesting only: nothing in this module may `await`, or one
4
4
  // page's context bleeds into the next.
@@ -38,8 +38,20 @@ function nodeToMkdocs(node) {
38
38
  return calloutToMkdocs(node);
39
39
  case "details":
40
40
  return detailsToMkdocs(node);
41
+ case "accordion":
42
+ // pymdownx.details folds, one per item, titled with the item's label.
43
+ // Material has no accordion grouping, so each folds on its own
44
+ return (node.children ?? [])
45
+ .map((c) => c.type === "accordion-item"
46
+ ? detailsToMkdocs({ ...c, props: { title: (c.props?.label ?? c.props?.title), open: c.props?.open } })
47
+ : nodeToMkdocs(c))
48
+ .filter(Boolean)
49
+ .join("\n\n");
50
+ case "accordion-item":
51
+ // A lone item (outside an accordion) is one fold, as inside one
52
+ return detailsToMkdocs({ ...node, props: { title: (node.props?.label ?? node.props?.title), open: node.props?.open } });
41
53
  case "tabs":
42
- return tabsToMkdocs(node);
54
+ return renderAroundGroup(node, "tab", tabsToMkdocs, nodeToMkdocs, "\n\n");
43
55
  case "tab":
44
56
  return tabToMkdocs(node);
45
57
  case "code":
@@ -86,6 +98,10 @@ function nodeToMkdocs(node) {
86
98
  case "html":
87
99
  return relativizeHtmlAssets(node.html ?? "");
88
100
  case "html-container":
101
+ // Parsed from raw HTML (a one-line `<details>` body), the content is in
102
+ // `html` with no children; rendering only children dropped it
103
+ if (!node.children?.length && node.html)
104
+ return relativizeHtmlAssets(node.html);
89
105
  return htmlContainerToMkdocs(node);
90
106
  case "figure": {
91
107
  const caption = node.props?.caption;
@@ -140,7 +156,9 @@ function nodeToMkdocs(node) {
140
156
  return renderUnknownNode(node, {
141
157
  policy: "html",
142
158
  renderChildren: (kids) => joinBlocks(kids),
143
- report: (type, detail) => report(`node:${type}`, detail ?? ""),
159
+ // The bare type: the feature name in MKDOCS_CAPABILITIES (a
160
+ // `node:` prefix made every recorded loss look undeclared)
161
+ report: (type, detail) => report(type, detail ?? ""),
144
162
  join: "\n\n",
145
163
  });
146
164
  }
@@ -520,7 +538,9 @@ function admonitionType(node) {
520
538
  return ADMONITION_ALIASES[raw] ?? raw;
521
539
  }
522
540
  function admonitionTitle(node, type) {
523
- const title = node.props?.title;
541
+ // `summary` is dogsbay-md's alias for a details title. Only when `title` is
542
+ // ABSENT: `title: null` is an explicit empty title (`!!! note ""`)
543
+ const title = (node.props?.title !== undefined ? node.props.title : node.props?.summary);
524
544
  if (title === null)
525
545
  return ' ""';
526
546
  if (title === undefined)
@@ -957,4 +977,3 @@ export function hrefToSlugKey(href) {
957
977
  .replace(/^\/+|\/+$/g, "")
958
978
  .replace(/\.md$/, "");
959
979
  }
960
- //# sourceMappingURL=to-mkdocs.js.map
@@ -27,4 +27,3 @@ export declare function readMkdocsConfig(sourceDir: string): MkdocsConfig;
27
27
  * Import a MkDocs project: parse all pages and extract navigation.
28
28
  */
29
29
  export declare function importMkdocsProject(sourceDir: string, opts?: Record<string, unknown>): Promise<MkdocsImportResult>;
30
- //# sourceMappingURL=importer.d.ts.map
package/dist/importer.js CHANGED
@@ -373,4 +373,3 @@ function extractMacrosData(config, sourceDir) {
373
373
  }
374
374
  return Object.keys(result).length > 0 ? result : null;
375
375
  }
376
- //# sourceMappingURL=importer.js.map
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export { parseToTree } from "./parse.js";
7
7
  export { parseShortcode } from "./rules/icon-shortcode.js";
8
8
  export { treeToMkdocs } from "./export/to-mkdocs.js";
9
9
  export { exportMkdocsProject } from "./export/to-mkdocs-project.js";
10
+ export { MKDOCS_CAPABILITIES } from "./export/capabilities.js";
10
11
  export type { MkdocsProjectOptions, MkdocsProjectExport } from "./export/to-mkdocs-project.js";
11
12
  export interface MkdocsPluginOptions {
12
13
  admonitions?: boolean;
@@ -71,4 +72,3 @@ export declare function mkdocsPlugin(md: MarkdownIt, options?: MkdocsPluginOptio
71
72
  * the migrate-mkdocs FastAPI smoke.
72
73
  */
73
74
  export declare function configureFromMkdocs(extensions: unknown): MkdocsPluginOptions;
74
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export { parseShortcode } from "./rules/icon-shortcode.js";
7
7
  // MkDocs serializer (TreeNode[] → MkDocs markdown)
8
8
  export { treeToMkdocs } from "./export/to-mkdocs.js";
9
9
  export { exportMkdocsProject } from "./export/to-mkdocs-project.js";
10
+ export { MKDOCS_CAPABILITIES } from "./export/capabilities.js";
10
11
  import { admonitionPlugin } from "./rules/admonition.js";
11
12
  import { blocksPlugin } from "./rules/blocks.js";
12
13
  import { contentTabsPlugin } from "./rules/content-tabs.js";
@@ -203,4 +204,3 @@ function normalizeExtensions(raw) {
203
204
  }
204
205
  return [];
205
206
  }
206
- //# sourceMappingURL=index.js.map
@@ -14,4 +14,3 @@ import type { InlineNode } from "@dogsbay/types";
14
14
  * Convert markdown-it inline token children into structured InlineNode[].
15
15
  */
16
16
  export declare function walkInlineTokens(tokens: Token[] | null): InlineNode[];
17
- //# sourceMappingURL=inline-walker.d.ts.map
@@ -164,4 +164,3 @@ export function walkInlineTokens(tokens) {
164
164
  }
165
165
  return result;
166
166
  }
167
- //# sourceMappingURL=inline-walker.js.map
package/dist/loader.d.ts CHANGED
@@ -39,4 +39,3 @@ export declare function parseMkdocsMarkdown(source: string, md: MarkdownIt, opti
39
39
  globalOptions?: Record<string, unknown>;
40
40
  };
41
41
  }): Promise<MkdocsParseResult>;
42
- //# sourceMappingURL=loader.d.ts.map
package/dist/loader.js CHANGED
@@ -761,4 +761,3 @@ function slugify(text) {
761
761
  .trim()
762
762
  || "tab"; // fallback for titles that are entirely punctuation
763
763
  }
764
- //# sourceMappingURL=loader.js.map
package/dist/parse.d.ts CHANGED
@@ -9,4 +9,3 @@ export declare function parseToTree(md: MarkdownIt, src: string, envOverrides?:
9
9
  tree: TreeNode[];
10
10
  env: Record<string, unknown>;
11
11
  };
12
- //# sourceMappingURL=parse.d.ts.map
package/dist/parse.js CHANGED
@@ -43,4 +43,3 @@ export function parseToTree(md, src, envOverrides) {
43
43
  }
44
44
  return { tree, env };
45
45
  }
46
- //# sourceMappingURL=parse.js.map
@@ -6,4 +6,3 @@
6
6
  * identical diagrams across pages.
7
7
  */
8
8
  export declare function renderMermaidSvg(code: string): Promise<string | null>;
9
- //# sourceMappingURL=mermaid.d.ts.map
@@ -114,4 +114,3 @@ export async function renderMermaidSvg(code) {
114
114
  catch { /* ignore */ }
115
115
  }
116
116
  }
117
- //# sourceMappingURL=mermaid.js.map
@@ -3,4 +3,3 @@ import type MarkdownIt from "markdown-it";
3
3
  * Register the admonition block rule with markdown-it.
4
4
  */
5
5
  export declare function admonitionPlugin(md: MarkdownIt): void;
6
- //# sourceMappingURL=admonition.d.ts.map
@@ -70,4 +70,3 @@ export function admonitionPlugin(md) {
70
70
  alt: ["paragraph", "reference", "blockquote", "list"],
71
71
  });
72
72
  }
73
- //# sourceMappingURL=admonition.js.map
@@ -3,4 +3,3 @@ import type MarkdownIt from "markdown-it";
3
3
  * Register the annotations post-process rule with markdown-it.
4
4
  */
5
5
  export declare function annotationsPlugin(md: MarkdownIt): void;
6
- //# sourceMappingURL=annotations.d.ts.map
@@ -54,4 +54,3 @@ function annotationsRule(state) {
54
54
  export function annotationsPlugin(md) {
55
55
  md.core.ruler.push("annotations", annotationsRule);
56
56
  }
57
- //# sourceMappingURL=annotations.js.map
@@ -4,4 +4,3 @@ import { type AutodocOptions } from "@dogsbay/autodoc-python";
4
4
  * Called from the loader (async context) before md.parse().
5
5
  */
6
6
  export declare function preprocessAutodoc(source: string, options: AutodocOptions): Promise<string>;
7
- //# sourceMappingURL=autodoc.d.ts.map
@@ -98,4 +98,3 @@ export async function preprocessAutodoc(source, options) {
98
98
  }
99
99
  return changed ? lines.join("\n") : source;
100
100
  }
101
- //# sourceMappingURL=autodoc.js.map
@@ -3,4 +3,3 @@ import type MarkdownIt from "markdown-it";
3
3
  * Register the blocks syntax rule with markdown-it.
4
4
  */
5
5
  export declare function blocksPlugin(md: MarkdownIt): void;
6
- //# sourceMappingURL=blocks.d.ts.map
@@ -169,4 +169,3 @@ export function blocksPlugin(md) {
169
169
  alt: ["paragraph", "reference", "blockquote", "list"],
170
170
  });
171
171
  }
172
- //# sourceMappingURL=blocks.js.map
@@ -3,4 +3,3 @@ import type MarkdownIt from "markdown-it";
3
3
  * Register the content tabs block rule with markdown-it.
4
4
  */
5
5
  export declare function contentTabsPlugin(md: MarkdownIt): void;
6
- //# sourceMappingURL=content-tabs.d.ts.map
@@ -64,4 +64,3 @@ export function contentTabsPlugin(md) {
64
64
  alt: ["paragraph", "reference", "blockquote", "list"],
65
65
  });
66
66
  }
67
- //# sourceMappingURL=content-tabs.js.map
@@ -4,4 +4,3 @@ import type MarkdownIt from "markdown-it";
4
4
  * Opt-in only — conflicts with mkdocstrings ::: directive.
5
5
  */
6
6
  export declare function docusaurusAdmonitionsPlugin(md: MarkdownIt): void;
7
- //# sourceMappingURL=docusaurus-admonitions.d.ts.map
@@ -98,4 +98,3 @@ export function docusaurusAdmonitionsPlugin(md) {
98
98
  alt: ["paragraph", "reference", "blockquote", "list"],
99
99
  });
100
100
  }
101
- //# sourceMappingURL=docusaurus-admonitions.js.map
@@ -25,4 +25,3 @@ export declare function remapHighlights(hlNums: number[], lnNums: number[]): num
25
25
  * Runs after snippets but before normalize.
26
26
  */
27
27
  export declare function fileIncludePlugin(md: MarkdownIt, options: FileIncludeOptions): void;
28
- //# sourceMappingURL=file-include.d.ts.map
@@ -195,4 +195,3 @@ function createFileIncludeRule(options) {
195
195
  export function fileIncludePlugin(md, options) {
196
196
  md.core.ruler.before("normalize", "file_include", createFileIncludeRule(options));
197
197
  }
198
- //# sourceMappingURL=file-include.js.map
@@ -3,4 +3,3 @@ import type MarkdownIt from "markdown-it";
3
3
  * Register footnote block + inline rules with markdown-it.
4
4
  */
5
5
  export declare function footnotesPlugin(md: MarkdownIt): void;
6
- //# sourceMappingURL=footnotes.d.ts.map
@@ -158,4 +158,3 @@ export function footnotesPlugin(md) {
158
158
  return `<fn-ref data-label="${label}"></fn-ref>`;
159
159
  };
160
160
  }
161
- //# sourceMappingURL=footnotes.js.map
@@ -27,4 +27,3 @@ export declare function parseShortcode(raw: string): ParsedShortcode;
27
27
  */
28
28
  export declare function iconShortcodePlugin(md: MarkdownIt): void;
29
29
  export {};
30
- //# sourceMappingURL=icon-shortcode.d.ts.map
@@ -166,4 +166,3 @@ function iconShortcodeRule(state, silent) {
166
166
  export function iconShortcodePlugin(md) {
167
167
  md.inline.ruler.after("image", "icon_shortcode", iconShortcodeRule);
168
168
  }
169
- //# sourceMappingURL=icon-shortcode.js.map
@@ -3,4 +3,3 @@ import type MarkdownIt from "markdown-it";
3
3
  * Register the keyboard keys inline rule with markdown-it.
4
4
  */
5
5
  export declare function keysPlugin(md: MarkdownIt): void;
6
- //# sourceMappingURL=keys.d.ts.map
@@ -27,4 +27,3 @@ function keysRule(state, silent) {
27
27
  export function keysPlugin(md) {
28
28
  md.inline.ruler.before("escape", "keys", keysRule);
29
29
  }
30
- //# sourceMappingURL=keys.js.map
@@ -4,4 +4,3 @@ export interface LinkRewriteOptions {
4
4
  baseUrl?: string;
5
5
  }
6
6
  export declare function linkRewritePlugin(md: MarkdownIt, options?: LinkRewriteOptions): void;
7
- //# sourceMappingURL=link-rewrite.d.ts.map
@@ -90,4 +90,3 @@ function rewriteAssetPath(src, fileDir) {
90
90
  export function linkRewritePlugin(md, options = {}) {
91
91
  md.core.ruler.push("link_rewrite", createLinkRewriteRule(options));
92
92
  }
93
- //# sourceMappingURL=link-rewrite.js.map
@@ -11,4 +11,3 @@ import type MarkdownIt from "markdown-it";
11
11
  * Register math rules with markdown-it.
12
12
  */
13
13
  export declare function mathPlugin(md: MarkdownIt): void;
14
- //# sourceMappingURL=math.d.ts.map
@@ -111,4 +111,3 @@ export function mathPlugin(md) {
111
111
  alt: ["paragraph", "reference", "blockquote"],
112
112
  });
113
113
  }
114
- //# sourceMappingURL=math.js.map
@@ -3,4 +3,3 @@ import type MarkdownIt from "markdown-it";
3
3
  * Register the md_in_html core rule with markdown-it.
4
4
  */
5
5
  export declare function mdInHtmlPlugin(md: MarkdownIt): void;
6
- //# sourceMappingURL=md-in-html.d.ts.map
@@ -132,4 +132,3 @@ function mdInHtmlRule(state) {
132
132
  export function mdInHtmlPlugin(md) {
133
133
  md.core.ruler.push("md_in_html", mdInHtmlRule);
134
134
  }
135
- //# sourceMappingURL=md-in-html.js.map
@@ -7,4 +7,3 @@ export interface SnippetsOptions {
7
7
  * Register the snippets core rule with markdown-it.
8
8
  */
9
9
  export declare function snippetsPlugin(md: MarkdownIt, options: SnippetsOptions): void;
10
- //# sourceMappingURL=snippets.d.ts.map
@@ -106,4 +106,3 @@ function createSnippetsRule(options) {
106
106
  export function snippetsPlugin(md, options) {
107
107
  md.core.ruler.before("normalize", "snippets", createSnippetsRule(options));
108
108
  }
109
- //# sourceMappingURL=snippets.js.map
@@ -12,4 +12,3 @@ export interface TemplatesOptions {
12
12
  * Must run BEFORE all other core rules (templates expand first).
13
13
  */
14
14
  export declare function templatesPlugin(md: MarkdownIt, options: TemplatesOptions): void;
15
- //# sourceMappingURL=templates.d.ts.map