@dogsbay/format-dogsbay-md 0.2.0-beta.128 → 0.2.0-beta.129
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/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/diagnostics.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin-containers.d.ts +13 -0
- package/dist/plugin-containers.js +13 -0
- package/package.json +4 -4
package/dist/browser.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export { dogsbayMdToTree, parseInline, containerOpenBefore, type ParseResult, type ParseOptions } from "./parse.js";
|
|
15
15
|
export { KNOWN_INLINE_DIRECTIVES, type ParseDiagnostic } from "./diagnostics.js";
|
|
16
|
-
export { KNOWN_BLOCK_DIRECTIVES } from "./plugin-containers.js";
|
|
16
|
+
export { KNOWN_BLOCK_DIRECTIVES, LEAF_ONLY_DIRECTIVES, BLOCK_LEAF_DIRECTIVES } from "./plugin-containers.js";
|
|
17
17
|
export { treeToDogsbayMd, nodeToDogsbayMd } from "./serialize.js";
|
|
18
18
|
export type { SerializeOptions } from "./types.js";
|
|
19
19
|
export { inlineToDogsbayMd } from "./inline.js";
|
package/dist/browser.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
export { dogsbayMdToTree, parseInline, containerOpenBefore } from "./parse.js";
|
|
15
15
|
export { KNOWN_INLINE_DIRECTIVES } from "./diagnostics.js";
|
|
16
16
|
// The `:::name` blocks the parser knows (an editor completes names from it)
|
|
17
|
-
export { KNOWN_BLOCK_DIRECTIVES } from "./plugin-containers.js";
|
|
17
|
+
export { KNOWN_BLOCK_DIRECTIVES, LEAF_ONLY_DIRECTIVES, BLOCK_LEAF_DIRECTIVES } from "./plugin-containers.js";
|
|
18
18
|
export { treeToDogsbayMd, nodeToDogsbayMd } from "./serialize.js";
|
|
19
19
|
export { inlineToDogsbayMd } from "./inline.js";
|
|
20
20
|
export { transformCodeRegions, transformProseLines, transformProseSegments, fenceOpenBefore, createFenceTracker, } from "./code-regions.js";
|
package/dist/diagnostics.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* here: the parser passes any leaf through as a node of that type, and only a
|
|
9
9
|
* renderer knows whether it can draw it (render-html reports the ones it can't).
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import { BLOCK_LEAF_DIRECTIVES, GENERIC_CONTAINER } from "./plugin-containers.js";
|
|
12
12
|
import { PRECEDES_TEXT } from "./plugin-inline-directives.js";
|
|
13
13
|
/**
|
|
14
14
|
* Whether a source line closes a container opened with `colons` colons. The
|
|
@@ -71,7 +71,7 @@ function codeLineSet(tokens) {
|
|
|
71
71
|
/** The inline directives the parser turns into nodes (parse.ts inlineDirectiveToNode); any other name stays literal text. */
|
|
72
72
|
export const KNOWN_INLINE_DIRECTIVES = new Set(["kbd", "icon", "math", "mark", "highlight", "button", "badge"]);
|
|
73
73
|
/** Directives that are blocks: `::name{…}` draws one only on a line of its own (parse.ts mapContainerToTreeNode). */
|
|
74
|
-
const BLOCK_DIRECTIVES = new Set(
|
|
74
|
+
const BLOCK_DIRECTIVES = new Set(BLOCK_LEAF_DIRECTIVES);
|
|
75
75
|
/** Inline tokens markdown-it-attrs can give attributes to that the parser has no field for (links and images keep theirs). */
|
|
76
76
|
const ATTRLESS_INLINE = { strong_open: "bold text", em_open: "italic text", s_open: "struck-through text", code_inline: "inline code" };
|
|
77
77
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { transformCodeRegions, transformProseLines, transformProseSegments, fenc
|
|
|
8
8
|
export { maskMinjaInCode, unmaskMinjaInCode, maskAllMinjaOpeners, isMinjaProcessedFence, stripInlineMinjaMarkers, stripFenceMinjaMarkers } from "./minja-mask.js";
|
|
9
9
|
export type { ParseResult, ParseOptions } from "./parse.js";
|
|
10
10
|
export { KNOWN_INLINE_DIRECTIVES, type ParseDiagnostic } from "./diagnostics.js";
|
|
11
|
-
export { KNOWN_BLOCK_DIRECTIVES } from "./plugin-containers.js";
|
|
11
|
+
export { KNOWN_BLOCK_DIRECTIVES, LEAF_ONLY_DIRECTIVES, BLOCK_LEAF_DIRECTIVES } from "./plugin-containers.js";
|
|
12
12
|
export { buildNavFromDirectory } from "./nav.js";
|
|
13
13
|
export type { BuildNavOptions } from "./nav.js";
|
|
14
14
|
export { loadNavFile } from "./nav-file.js";
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { transformCodeRegions, transformProseLines, transformProseSegments, fenc
|
|
|
11
11
|
export { maskMinjaInCode, unmaskMinjaInCode, maskAllMinjaOpeners, isMinjaProcessedFence, stripInlineMinjaMarkers, stripFenceMinjaMarkers } from "./minja-mask.js";
|
|
12
12
|
export { KNOWN_INLINE_DIRECTIVES } from "./diagnostics.js";
|
|
13
13
|
// The `:::name` blocks the parser knows (an editor completes names from it)
|
|
14
|
-
export { KNOWN_BLOCK_DIRECTIVES } from "./plugin-containers.js";
|
|
14
|
+
export { KNOWN_BLOCK_DIRECTIVES, LEAF_ONLY_DIRECTIVES, BLOCK_LEAF_DIRECTIVES } from "./plugin-containers.js";
|
|
15
15
|
export { buildNavFromDirectory } from "./nav.js";
|
|
16
16
|
export { loadNavFile } from "./nav-file.js";
|
|
17
17
|
export { renderDiagrams } from "./renderers/diagrams.js";
|
|
@@ -7,6 +7,19 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type MarkdownIt from "markdown-it";
|
|
9
9
|
export declare const KNOWN_BLOCK_DIRECTIVES: readonly ["tabs", "tab", "steps", "step", "cards", "card", "grid", "grid-item", "details", "callout", "note", "tip", "info", "important", "warning", "caution", "danger", "success", "hint", "attention", "error", "failure", "bug", "question", "abstract", "quote", "button", "figure", "math", "api-endpoint", "api-params", "api-response", "config", "files", "example", "accordion", "accordion-item", "link-card", "autodoc", "api-class", "api-member", "api-doc", "api-source", "youtube", "openapi", "theme"];
|
|
10
|
+
/**
|
|
11
|
+
* Directives with no body, written only as the leaf `::name{…}` (parse.ts mapContainerToTreeNode
|
|
12
|
+
* drops any children; the serializer writes `::`). `youtube` is also a container above, for the
|
|
13
|
+
* empty `:::youtube{…}` + `:::` older serializers wrote; `:::avatar` and `:::child-links` are not
|
|
14
|
+
* blocks at all. Exported for editors, so completion does not offer `:::` or a closer for them.
|
|
15
|
+
*/
|
|
16
|
+
export declare const LEAF_ONLY_DIRECTIVES: readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* Every name `::name{…}` draws as a block on a line of its own: the containers (an empty one,
|
|
19
|
+
* `::grid-item{…}` = `:::grid-item{…}` + `:::`) and the body-less leaves. Inside a line, these
|
|
20
|
+
* are reported (`block-directive-inline`) and kept as text.
|
|
21
|
+
*/
|
|
22
|
+
export declare const BLOCK_LEAF_DIRECTIVES: readonly string[];
|
|
10
23
|
/**
|
|
11
24
|
* The token name for a `:::name` block with a name no renderer knows. It becomes a node of that
|
|
12
25
|
* type (parse.ts), which renderers show as a plain container and report, rather than literal text.
|
|
@@ -66,6 +66,19 @@ export const KNOWN_BLOCK_DIRECTIVES = [
|
|
|
66
66
|
// set (plans/dita-variants-themes.md). A wrapper, so it takes blocks.
|
|
67
67
|
"theme",
|
|
68
68
|
];
|
|
69
|
+
/**
|
|
70
|
+
* Directives with no body, written only as the leaf `::name{…}` (parse.ts mapContainerToTreeNode
|
|
71
|
+
* drops any children; the serializer writes `::`). `youtube` is also a container above, for the
|
|
72
|
+
* empty `:::youtube{…}` + `:::` older serializers wrote; `:::avatar` and `:::child-links` are not
|
|
73
|
+
* blocks at all. Exported for editors, so completion does not offer `:::` or a closer for them.
|
|
74
|
+
*/
|
|
75
|
+
export const LEAF_ONLY_DIRECTIVES = ["youtube", "avatar", "child-links"];
|
|
76
|
+
/**
|
|
77
|
+
* Every name `::name{…}` draws as a block on a line of its own: the containers (an empty one,
|
|
78
|
+
* `::grid-item{…}` = `:::grid-item{…}` + `:::`) and the body-less leaves. Inside a line, these
|
|
79
|
+
* are reported (`block-directive-inline`) and kept as text.
|
|
80
|
+
*/
|
|
81
|
+
export const BLOCK_LEAF_DIRECTIVES = [...KNOWN_BLOCK_DIRECTIVES, ...LEAF_ONLY_DIRECTIVES.filter((n) => !KNOWN_BLOCK_DIRECTIVES.includes(n))];
|
|
69
82
|
/**
|
|
70
83
|
* The token name for a `:::name` block with a name no renderer knows. It becomes a node of that
|
|
71
84
|
* type (parse.ts), which renderers show as a plain container and report, rather than literal text.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dogsbay/format-dogsbay-md",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.129",
|
|
4
4
|
"description": "Dogsbay Markdown dialect — canonical format for TreeNode[] with directives, YAML bodies, and intelligent fallbacks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"markdown-it-footnote": "^4.0.0",
|
|
41
41
|
"markdown-it-front-matter": "^0.2.4",
|
|
42
42
|
"pele": "1.6.0",
|
|
43
|
-
"@dogsbay/minja": "0.2.0-beta.
|
|
44
|
-
"@dogsbay/serialize-core": "0.2.0-beta.
|
|
45
|
-
"@dogsbay/types": "0.2.0-beta.
|
|
43
|
+
"@dogsbay/minja": "0.2.0-beta.129",
|
|
44
|
+
"@dogsbay/serialize-core": "0.2.0-beta.129",
|
|
45
|
+
"@dogsbay/types": "0.2.0-beta.129"
|
|
46
46
|
},
|
|
47
47
|
"license": "MIT",
|
|
48
48
|
"repository": {
|