@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.
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +2 -1
- package/dist/export/capabilities.d.ts +22 -0
- package/dist/export/capabilities.js +213 -0
- package/dist/export/to-astro.d.ts +0 -1
- package/dist/export/to-astro.js +0 -1
- package/dist/export/to-mkdocs-project.d.ts +0 -1
- package/dist/export/to-mkdocs-project.js +0 -1
- package/dist/export/to-mkdocs.d.ts +0 -1
- package/dist/export/to-mkdocs.js +24 -5
- package/dist/importer.d.ts +0 -1
- package/dist/importer.js +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/inline-walker.d.ts +0 -1
- package/dist/inline-walker.js +0 -1
- package/dist/loader.d.ts +0 -1
- package/dist/loader.js +0 -1
- package/dist/parse.d.ts +0 -1
- package/dist/parse.js +0 -1
- package/dist/renderers/mermaid.d.ts +0 -1
- package/dist/renderers/mermaid.js +0 -1
- package/dist/rules/admonition.d.ts +0 -1
- package/dist/rules/admonition.js +0 -1
- package/dist/rules/annotations.d.ts +0 -1
- package/dist/rules/annotations.js +0 -1
- package/dist/rules/autodoc.d.ts +0 -1
- package/dist/rules/autodoc.js +0 -1
- package/dist/rules/blocks.d.ts +0 -1
- package/dist/rules/blocks.js +0 -1
- package/dist/rules/content-tabs.d.ts +0 -1
- package/dist/rules/content-tabs.js +0 -1
- package/dist/rules/docusaurus-admonitions.d.ts +0 -1
- package/dist/rules/docusaurus-admonitions.js +0 -1
- package/dist/rules/file-include.d.ts +0 -1
- package/dist/rules/file-include.js +0 -1
- package/dist/rules/footnotes.d.ts +0 -1
- package/dist/rules/footnotes.js +0 -1
- package/dist/rules/icon-shortcode.d.ts +0 -1
- package/dist/rules/icon-shortcode.js +0 -1
- package/dist/rules/keys.d.ts +0 -1
- package/dist/rules/keys.js +0 -1
- package/dist/rules/link-rewrite.d.ts +0 -1
- package/dist/rules/link-rewrite.js +0 -1
- package/dist/rules/math.d.ts +0 -1
- package/dist/rules/math.js +0 -1
- package/dist/rules/md-in-html.d.ts +0 -1
- package/dist/rules/md-in-html.js +0 -1
- package/dist/rules/snippets.d.ts +0 -1
- package/dist/rules/snippets.js +0 -1
- package/dist/rules/templates.d.ts +0 -1
- package/dist/rules/templates.js +0 -1
- package/dist/rules/variants.d.ts +0 -1
- package/dist/rules/variants.js +0 -1
- package/dist/tree.d.ts +0 -1
- package/dist/tree.js +0 -1
- package/dist/utils/indent.d.ts +0 -1
- package/dist/utils/indent.js +0 -1
- package/dist/utils/types.d.ts +0 -1
- package/dist/utils/types.js +0 -1
- package/dist/walker.d.ts +0 -1
- package/dist/walker.js +0 -1
- package/package.json +5 -5
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/export/to-astro.d.ts.map +0 -1
- package/dist/export/to-astro.js.map +0 -1
- package/dist/export/to-mkdocs-project.d.ts.map +0 -1
- package/dist/export/to-mkdocs-project.js.map +0 -1
- package/dist/export/to-mkdocs.d.ts.map +0 -1
- package/dist/export/to-mkdocs.js.map +0 -1
- package/dist/importer.d.ts.map +0 -1
- package/dist/importer.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inline-walker.d.ts.map +0 -1
- package/dist/inline-walker.js.map +0 -1
- package/dist/loader.d.ts.map +0 -1
- package/dist/loader.js.map +0 -1
- package/dist/parse.d.ts.map +0 -1
- package/dist/parse.js.map +0 -1
- package/dist/renderers/mermaid.d.ts.map +0 -1
- package/dist/renderers/mermaid.js.map +0 -1
- package/dist/rules/admonition.d.ts.map +0 -1
- package/dist/rules/admonition.js.map +0 -1
- package/dist/rules/annotations.d.ts.map +0 -1
- package/dist/rules/annotations.js.map +0 -1
- package/dist/rules/autodoc.d.ts.map +0 -1
- package/dist/rules/autodoc.js.map +0 -1
- package/dist/rules/blocks.d.ts.map +0 -1
- package/dist/rules/blocks.js.map +0 -1
- package/dist/rules/content-tabs.d.ts.map +0 -1
- package/dist/rules/content-tabs.js.map +0 -1
- package/dist/rules/docusaurus-admonitions.d.ts.map +0 -1
- package/dist/rules/docusaurus-admonitions.js.map +0 -1
- package/dist/rules/file-include.d.ts.map +0 -1
- package/dist/rules/file-include.js.map +0 -1
- package/dist/rules/footnotes.d.ts.map +0 -1
- package/dist/rules/footnotes.js.map +0 -1
- package/dist/rules/icon-shortcode.d.ts.map +0 -1
- package/dist/rules/icon-shortcode.js.map +0 -1
- package/dist/rules/keys.d.ts.map +0 -1
- package/dist/rules/keys.js.map +0 -1
- package/dist/rules/link-rewrite.d.ts.map +0 -1
- package/dist/rules/link-rewrite.js.map +0 -1
- package/dist/rules/math.d.ts.map +0 -1
- package/dist/rules/math.js.map +0 -1
- package/dist/rules/md-in-html.d.ts.map +0 -1
- package/dist/rules/md-in-html.js.map +0 -1
- package/dist/rules/snippets.d.ts.map +0 -1
- package/dist/rules/snippets.js.map +0 -1
- package/dist/rules/templates.d.ts.map +0 -1
- package/dist/rules/templates.js.map +0 -1
- package/dist/rules/variants.d.ts.map +0 -1
- package/dist/rules/variants.js.map +0 -1
- package/dist/tree.d.ts.map +0 -1
- package/dist/tree.js.map +0 -1
- package/dist/utils/indent.d.ts.map +0 -1
- package/dist/utils/indent.js.map +0 -1
- package/dist/utils/types.d.ts.map +0 -1
- package/dist/utils/types.js.map +0 -1
- package/dist/walker.d.ts.map +0 -1
- package/dist/walker.js.map +0 -1
package/dist/cli.d.ts
CHANGED
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: "`{ 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
|
package/dist/export/to-astro.js
CHANGED
|
@@ -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
|
package/dist/export/to-mkdocs.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
package/dist/importer.d.ts
CHANGED
|
@@ -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
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
|
package/dist/inline-walker.d.ts
CHANGED
package/dist/inline-walker.js
CHANGED
package/dist/loader.d.ts
CHANGED
package/dist/loader.js
CHANGED
package/dist/parse.d.ts
CHANGED
package/dist/parse.js
CHANGED
package/dist/rules/admonition.js
CHANGED
package/dist/rules/autodoc.d.ts
CHANGED
package/dist/rules/autodoc.js
CHANGED
package/dist/rules/blocks.d.ts
CHANGED
package/dist/rules/blocks.js
CHANGED
|
@@ -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
|
package/dist/rules/footnotes.js
CHANGED
package/dist/rules/keys.d.ts
CHANGED
package/dist/rules/keys.js
CHANGED
package/dist/rules/math.d.ts
CHANGED
package/dist/rules/math.js
CHANGED
package/dist/rules/md-in-html.js
CHANGED
package/dist/rules/snippets.d.ts
CHANGED
package/dist/rules/snippets.js
CHANGED