@zudojs/docs 0.0.1

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 (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -0
  3. package/dist/docsTypes/documentationContent.d.ts +80 -0
  4. package/dist/docsTypes/documentationContent.d.ts.map +1 -0
  5. package/dist/docsTypes/documentationContent.js +8 -0
  6. package/dist/docsTypes/documentationContent.js.map +1 -0
  7. package/dist/docsTypes/documentationDocument.d.ts +29 -0
  8. package/dist/docsTypes/documentationDocument.d.ts.map +1 -0
  9. package/dist/docsTypes/documentationDocument.js +8 -0
  10. package/dist/docsTypes/documentationDocument.js.map +1 -0
  11. package/dist/docsTypes/documentationMetadata.d.ts +60 -0
  12. package/dist/docsTypes/documentationMetadata.d.ts.map +1 -0
  13. package/dist/docsTypes/documentationMetadata.js +5 -0
  14. package/dist/docsTypes/documentationMetadata.js.map +1 -0
  15. package/dist/docsTypes/documentationNavigation.d.ts +34 -0
  16. package/dist/docsTypes/documentationNavigation.d.ts.map +1 -0
  17. package/dist/docsTypes/documentationNavigation.js +8 -0
  18. package/dist/docsTypes/documentationNavigation.js.map +1 -0
  19. package/dist/docsTypes/documentationProvider.d.ts +21 -0
  20. package/dist/docsTypes/documentationProvider.d.ts.map +1 -0
  21. package/dist/docsTypes/documentationProvider.js +8 -0
  22. package/dist/docsTypes/documentationProvider.js.map +1 -0
  23. package/dist/docsTypes/index.d.ts +11 -0
  24. package/dist/docsTypes/index.d.ts.map +1 -0
  25. package/dist/docsTypes/index.js +7 -0
  26. package/dist/docsTypes/index.js.map +1 -0
  27. package/dist/document/documentBuilder.core.d.ts +50 -0
  28. package/dist/document/documentBuilder.core.d.ts.map +1 -0
  29. package/dist/document/documentBuilder.core.js +78 -0
  30. package/dist/document/documentBuilder.core.js.map +1 -0
  31. package/dist/document/index.d.ts +8 -0
  32. package/dist/document/index.d.ts.map +1 -0
  33. package/dist/document/index.js +7 -0
  34. package/dist/document/index.js.map +1 -0
  35. package/dist/examples/examples.core.d.ts +38 -0
  36. package/dist/examples/examples.core.d.ts.map +1 -0
  37. package/dist/examples/examples.core.js +56 -0
  38. package/dist/examples/examples.core.js.map +1 -0
  39. package/dist/examples/index.d.ts +8 -0
  40. package/dist/examples/index.d.ts.map +1 -0
  41. package/dist/examples/index.js +7 -0
  42. package/dist/examples/index.js.map +1 -0
  43. package/dist/frontmatter/frontmatter.core.d.ts +7 -0
  44. package/dist/frontmatter/frontmatter.core.d.ts.map +1 -0
  45. package/dist/frontmatter/frontmatter.core.js +6 -0
  46. package/dist/frontmatter/frontmatter.core.js.map +1 -0
  47. package/dist/frontmatter/frontmatter.parser.d.ts +15 -0
  48. package/dist/frontmatter/frontmatter.parser.d.ts.map +1 -0
  49. package/dist/frontmatter/frontmatter.parser.js +82 -0
  50. package/dist/frontmatter/frontmatter.parser.js.map +1 -0
  51. package/dist/frontmatter/frontmatter.serializer.d.ts +9 -0
  52. package/dist/frontmatter/frontmatter.serializer.d.ts.map +1 -0
  53. package/dist/frontmatter/frontmatter.serializer.js +31 -0
  54. package/dist/frontmatter/frontmatter.serializer.js.map +1 -0
  55. package/dist/frontmatter/frontmatter.types.d.ts +26 -0
  56. package/dist/frontmatter/frontmatter.types.d.ts.map +1 -0
  57. package/dist/frontmatter/frontmatter.types.js +5 -0
  58. package/dist/frontmatter/frontmatter.types.js.map +1 -0
  59. package/dist/frontmatter/index.d.ts +8 -0
  60. package/dist/frontmatter/index.d.ts.map +1 -0
  61. package/dist/frontmatter/index.js +7 -0
  62. package/dist/frontmatter/index.js.map +1 -0
  63. package/dist/generator/generator.types.d.ts +11 -0
  64. package/dist/generator/generator.types.d.ts.map +1 -0
  65. package/dist/generator/generator.types.js +5 -0
  66. package/dist/generator/generator.types.js.map +1 -0
  67. package/dist/generator/generatorJson.core.d.ts +13 -0
  68. package/dist/generator/generatorJson.core.d.ts.map +1 -0
  69. package/dist/generator/generatorJson.core.js +36 -0
  70. package/dist/generator/generatorJson.core.js.map +1 -0
  71. package/dist/generator/generatorMarkdown.core.d.ts +10 -0
  72. package/dist/generator/generatorMarkdown.core.d.ts.map +1 -0
  73. package/dist/generator/generatorMarkdown.core.js +72 -0
  74. package/dist/generator/generatorMarkdown.core.js.map +1 -0
  75. package/dist/generator/generatorMarkdownNodes.d.ts +9 -0
  76. package/dist/generator/generatorMarkdownNodes.d.ts.map +1 -0
  77. package/dist/generator/generatorMarkdownNodes.js +64 -0
  78. package/dist/generator/generatorMarkdownNodes.js.map +1 -0
  79. package/dist/generator/index.d.ts +10 -0
  80. package/dist/generator/index.d.ts.map +1 -0
  81. package/dist/generator/index.js +9 -0
  82. package/dist/generator/index.js.map +1 -0
  83. package/dist/index.d.ts +19 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.js +28 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/navigation/index.d.ts +7 -0
  88. package/dist/navigation/index.d.ts.map +1 -0
  89. package/dist/navigation/index.js +7 -0
  90. package/dist/navigation/index.js.map +1 -0
  91. package/dist/navigation/navigation.core.d.ts +25 -0
  92. package/dist/navigation/navigation.core.d.ts.map +1 -0
  93. package/dist/navigation/navigation.core.js +85 -0
  94. package/dist/navigation/navigation.core.js.map +1 -0
  95. package/dist/registry/index.d.ts +7 -0
  96. package/dist/registry/index.d.ts.map +1 -0
  97. package/dist/registry/index.js +7 -0
  98. package/dist/registry/index.js.map +1 -0
  99. package/dist/registry/registry.core.d.ts +62 -0
  100. package/dist/registry/registry.core.d.ts.map +1 -0
  101. package/dist/registry/registry.core.js +90 -0
  102. package/dist/registry/registry.core.js.map +1 -0
  103. package/dist/utils/index.d.ts +7 -0
  104. package/dist/utils/index.d.ts.map +1 -0
  105. package/dist/utils/index.js +7 -0
  106. package/dist/utils/index.js.map +1 -0
  107. package/dist/utils/utils.helper.d.ts +34 -0
  108. package/dist/utils/utils.helper.d.ts.map +1 -0
  109. package/dist/utils/utils.helper.js +82 -0
  110. package/dist/utils/utils.helper.js.map +1 -0
  111. package/dist/validator/index.d.ts +11 -0
  112. package/dist/validator/index.d.ts.map +1 -0
  113. package/dist/validator/index.js +10 -0
  114. package/dist/validator/index.js.map +1 -0
  115. package/dist/validator/validator.types.d.ts +20 -0
  116. package/dist/validator/validator.types.d.ts.map +1 -0
  117. package/dist/validator/validator.types.js +5 -0
  118. package/dist/validator/validator.types.js.map +1 -0
  119. package/dist/validator/validatorAll/index.d.ts +8 -0
  120. package/dist/validator/validatorAll/index.d.ts.map +1 -0
  121. package/dist/validator/validatorAll/index.js +8 -0
  122. package/dist/validator/validatorAll/index.js.map +1 -0
  123. package/dist/validator/validatorAll/validatorAll.core.d.ts +10 -0
  124. package/dist/validator/validatorAll/validatorAll.core.d.ts.map +1 -0
  125. package/dist/validator/validatorAll/validatorAll.core.js +31 -0
  126. package/dist/validator/validatorAll/validatorAll.core.js.map +1 -0
  127. package/dist/validator/validatorAll/validatorNavigation.core.d.ts +10 -0
  128. package/dist/validator/validatorAll/validatorNavigation.core.d.ts.map +1 -0
  129. package/dist/validator/validatorAll/validatorNavigation.core.js +29 -0
  130. package/dist/validator/validatorAll/validatorNavigation.core.js.map +1 -0
  131. package/dist/validator/validatorDocument.core.d.ts +10 -0
  132. package/dist/validator/validatorDocument.core.d.ts.map +1 -0
  133. package/dist/validator/validatorDocument.core.js +45 -0
  134. package/dist/validator/validatorDocument.core.js.map +1 -0
  135. package/dist/validator/validatorDuplicates.core.d.ts +10 -0
  136. package/dist/validator/validatorDuplicates.core.d.ts.map +1 -0
  137. package/dist/validator/validatorDuplicates.core.js +28 -0
  138. package/dist/validator/validatorDuplicates.core.js.map +1 -0
  139. package/dist/validator/validatorLinks.core.d.ts +10 -0
  140. package/dist/validator/validatorLinks.core.d.ts.map +1 -0
  141. package/dist/validator/validatorLinks.core.js +56 -0
  142. package/dist/validator/validatorLinks.core.js.map +1 -0
  143. package/package.json +49 -0
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Code example modeling and validation.
3
+ *
4
+ * Examples are first-class objects that can be validated,
5
+ * rendered, and included in generated documentation.
6
+ */
7
+ /**
8
+ * Validates a documentation example.
9
+ */
10
+ export function validateExample(example) {
11
+ const errors = [];
12
+ if (!example.id || example.id.trim().length === 0) {
13
+ errors.push("Example ID is required.");
14
+ }
15
+ if (!example.language || example.language.trim().length === 0) {
16
+ errors.push(`Example "${example.id}" requires a language.`);
17
+ }
18
+ if (!example.code || example.code.trim().length === 0) {
19
+ errors.push(`Example "${example.id}" requires code content.`);
20
+ }
21
+ return {
22
+ valid: errors.length === 0,
23
+ errors,
24
+ };
25
+ }
26
+ /**
27
+ * Renders an example as a markdown code block.
28
+ */
29
+ export function renderExampleMarkdown(example) {
30
+ const lines = [];
31
+ if (example.title) {
32
+ lines.push(`### ${example.title}`);
33
+ lines.push("");
34
+ }
35
+ if (example.description) {
36
+ lines.push(example.description);
37
+ lines.push("");
38
+ }
39
+ lines.push("```" + example.language);
40
+ lines.push(example.code.trim());
41
+ lines.push("```");
42
+ return lines.join("\n");
43
+ }
44
+ /**
45
+ * Renders an example as a JSON-serializable object.
46
+ */
47
+ export function exampleToJSON(example) {
48
+ return {
49
+ id: example.id,
50
+ title: example.title,
51
+ language: example.language,
52
+ code: example.code,
53
+ description: example.description,
54
+ };
55
+ }
56
+ //# sourceMappingURL=examples.core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"examples.core.js","sourceRoot":"","sources":["../../src/examples/examples.core.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwBH;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,OAA6B;IAE7B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClD,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI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CAAC,EAAE;QACd,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;KACjC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @zudojs/docs/examples
3
+ *
4
+ * Code example modeling, validation, and rendering for documentation.
5
+ */
6
+ export { validateExample, renderExampleMarkdown, exampleToJSON, } from "./examples.core.js";
7
+ export type { DocumentationExample, ExampleValidationResult, } from "./examples.core.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/examples/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @zudojs/docs/examples
3
+ *
4
+ * Code example modeling, validation, and rendering for documentation.
5
+ */
6
+ export { validateExample, renderExampleMarkdown, exampleToJSON, } from "./examples.core.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/examples/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,aAAa,GACd,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Frontmatter module — re-exports from focused files.
3
+ */
4
+ export { parseFrontmatter } from "./frontmatter.parser.js";
5
+ export { serializeFrontmatter } from "./frontmatter.serializer.js";
6
+ export type { ParsedFrontmatter, FrontmatterMetadata, } from "./frontmatter.types.js";
7
+ //# sourceMappingURL=frontmatter.core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.core.d.ts","sourceRoot":"","sources":["../../src/frontmatter/frontmatter.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,YAAY,EACV,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Frontmatter module — re-exports from focused files.
3
+ */
4
+ export { parseFrontmatter } from "./frontmatter.parser.js";
5
+ export { serializeFrontmatter } from "./frontmatter.serializer.js";
6
+ //# sourceMappingURL=frontmatter.core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.core.js","sourceRoot":"","sources":["../../src/frontmatter/frontmatter.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Frontmatter parser for markdown documentation.
3
+ *
4
+ * Parses YAML-like frontmatter delimited by `---` markers
5
+ * and extracts metadata alongside the remaining content.
6
+ */
7
+ import type { ParsedFrontmatter } from "./frontmatter.types.js";
8
+ /**
9
+ * Parses YAML-like frontmatter from a markdown string.
10
+ *
11
+ * Expects content to begin with `---`, followed by key-value pairs,
12
+ * followed by another `---`.
13
+ */
14
+ export declare function parseFrontmatter(raw: string): ParsedFrontmatter;
15
+ //# sourceMappingURL=frontmatter.parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.parser.d.ts","sourceRoot":"","sources":["../../src/frontmatter/frontmatter.parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,wBAAwB,CAAC;AAIhC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAsB/D"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Frontmatter parser for markdown documentation.
3
+ *
4
+ * Parses YAML-like frontmatter delimited by `---` markers
5
+ * and extracts metadata alongside the remaining content.
6
+ */
7
+ const FRONTMATTER_DELIMITER = "---";
8
+ /**
9
+ * Parses YAML-like frontmatter from a markdown string.
10
+ *
11
+ * Expects content to begin with `---`, followed by key-value pairs,
12
+ * followed by another `---`.
13
+ */
14
+ export function parseFrontmatter(raw) {
15
+ const trimmed = raw.trimStart();
16
+ if (!trimmed.startsWith(FRONTMATTER_DELIMITER)) {
17
+ return { metadata: {}, content: raw };
18
+ }
19
+ const afterFirst = trimmed.slice(FRONTMATTER_DELIMITER.length);
20
+ const endIndex = afterFirst.indexOf(FRONTMATTER_DELIMITER);
21
+ if (endIndex === -1) {
22
+ return { metadata: {}, content: raw };
23
+ }
24
+ const yamlBlock = afterFirst.slice(0, endIndex).trim();
25
+ const remainingContent = afterFirst
26
+ .slice(endIndex + FRONTMATTER_DELIMITER.length)
27
+ .trimStart();
28
+ const metadata = parseYamlLike(yamlBlock);
29
+ return { metadata, content: remainingContent };
30
+ }
31
+ /**
32
+ * Minimal YAML-like parser for frontmatter key-value pairs.
33
+ */
34
+ function parseYamlLike(yaml) {
35
+ const result = {};
36
+ const lines = yaml.split("\n");
37
+ let currentKey = null;
38
+ let currentArray = null;
39
+ for (const line of lines) {
40
+ const trimmed = line.trim();
41
+ if (trimmed.startsWith("- ")) {
42
+ if (currentKey && currentArray) {
43
+ currentArray.push(trimmed.slice(2).trim());
44
+ }
45
+ continue;
46
+ }
47
+ if (currentKey && currentArray) {
48
+ result[currentKey] = Object.freeze(currentArray);
49
+ currentArray = null;
50
+ currentKey = null;
51
+ }
52
+ const colonIndex = trimmed.indexOf(":");
53
+ if (colonIndex === -1)
54
+ continue;
55
+ const key = trimmed.slice(0, colonIndex).trim();
56
+ const value = trimmed.slice(colonIndex + 1).trim();
57
+ if (value === "") {
58
+ currentKey = key;
59
+ currentArray = [];
60
+ continue;
61
+ }
62
+ result[key] = parseScalar(value);
63
+ }
64
+ if (currentKey && currentArray) {
65
+ result[currentKey] = Object.freeze(currentArray);
66
+ }
67
+ return Object.freeze(result);
68
+ }
69
+ /**
70
+ * Parses a scalar YAML value into its appropriate JS type.
71
+ */
72
+ function parseScalar(value) {
73
+ if (value === "true")
74
+ return true;
75
+ if (value === "false")
76
+ return false;
77
+ if (/^\d+$/.test(value)) {
78
+ return Number(value);
79
+ }
80
+ return value;
81
+ }
82
+ //# sourceMappingURL=frontmatter.parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.parser.js","sourceRoot":"","sources":["../../src/frontmatter/frontmatter.parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,EAAE,CAAC;QAC/C,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAE3D,IAAI,QAAQ,KAAK,CAAC,CAAC,EAAE,CAAC;QACpB,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IACvD,MAAM,gBAAgB,GAAG,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AC,UAAU,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAEnD,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YACjB,UAAU,GAAG,GAAG,CAAC;YACjB,YAAY,GAAG,EAAE,CAAC;YAClB,SAAS;QACX,CAAC;QAED,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,UAAU,IAAI,YAAY,EAAE,CAAC;QAC/B,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAwB,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,KAAa;IAChC,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAEpC,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Frontmatter serializer — converts metadata back to YAML-like format.
3
+ */
4
+ import type { FrontmatterMetadata } from "./frontmatter.types.js";
5
+ /**
6
+ * Serializes metadata back into a frontmatter string.
7
+ */
8
+ export declare function serializeFrontmatter(metadata: FrontmatterMetadata, content: string): string;
9
+ //# sourceMappingURL=frontmatter.serializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.serializer.d.ts","sourceRoot":"","sources":["../../src/frontmatter/frontmatter.serializer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAIlE;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,MAAM,GACd,MAAM,CAuBR"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Frontmatter serializer — converts metadata back to YAML-like format.
3
+ */
4
+ const FRONTMATTER_DELIMITER = "---";
5
+ /**
6
+ * Serializes metadata back into a frontmatter string.
7
+ */
8
+ export function serializeFrontmatter(metadata, content) {
9
+ const lines = [FRONTMATTER_DELIMITER];
10
+ for (const [key, value] of Object.entries(metadata)) {
11
+ if (value === undefined || value === null)
12
+ continue;
13
+ if (Array.isArray(value)) {
14
+ lines.push(`${key}:`);
15
+ for (const item of value) {
16
+ lines.push(` - ${item}`);
17
+ }
18
+ }
19
+ else if (typeof value === "boolean") {
20
+ lines.push(`${key}: ${value ? "true" : "false"}`);
21
+ }
22
+ else {
23
+ lines.push(`${key}: ${value}`);
24
+ }
25
+ }
26
+ lines.push(FRONTMATTER_DELIMITER);
27
+ lines.push("");
28
+ lines.push(content);
29
+ return lines.join("\n");
30
+ }
31
+ //# sourceMappingURL=frontmatter.serializer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.serializer.js","sourceRoot":"","sources":["../../src/frontmatter/frontmatter.serializer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAEpC;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAA6B,EAC7B,OAAe;IAEf,MAAM,KAAK,GAAa,CAAC,qBAAqB,CAAC,CAAC;IAEhD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;YAAE,SAAS;QAEpD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;YACtB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,KAAK,EAAE,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAClC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEpB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Type definitions for frontmatter parsing.
3
+ */
4
+ /**
5
+ * Parsed frontmatter result.
6
+ */
7
+ export interface ParsedFrontmatter {
8
+ readonly metadata: FrontmatterMetadata;
9
+ readonly content: string;
10
+ }
11
+ /**
12
+ * Metadata extracted from frontmatter.
13
+ */
14
+ export interface FrontmatterMetadata {
15
+ readonly title?: string;
16
+ readonly description?: string;
17
+ readonly category?: string;
18
+ readonly tags?: readonly string[];
19
+ readonly version?: string;
20
+ readonly status?: string;
21
+ readonly deprecated?: boolean;
22
+ readonly deprecatedMessage?: string;
23
+ readonly visibility?: string;
24
+ readonly [key: string]: unknown;
25
+ }
26
+ //# sourceMappingURL=frontmatter.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.types.d.ts","sourceRoot":"","sources":["../../src/frontmatter/frontmatter.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Type definitions for frontmatter parsing.
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=frontmatter.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.types.js","sourceRoot":"","sources":["../../src/frontmatter/frontmatter.types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @zudojs/docs/frontmatter
3
+ *
4
+ * YAML frontmatter parsing and serialization for markdown documentation.
5
+ */
6
+ export { parseFrontmatter, serializeFrontmatter } from "./frontmatter.core.js";
7
+ export type { ParsedFrontmatter, FrontmatterMetadata, } from "./frontmatter.core.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/frontmatter/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,YAAY,EACV,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @zudojs/docs/frontmatter
3
+ *
4
+ * YAML frontmatter parsing and serialization for markdown documentation.
5
+ */
6
+ export { parseFrontmatter, serializeFrontmatter } from "./frontmatter.core.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/frontmatter/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Type definitions for documentation generators.
3
+ */
4
+ /**
5
+ * Options for markdown generation.
6
+ */
7
+ export interface MarkdownGeneratorOptions {
8
+ readonly includeFrontmatter?: boolean;
9
+ readonly includeMeta?: boolean;
10
+ }
11
+ //# sourceMappingURL=generator.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.types.d.ts","sourceRoot":"","sources":["../../src/generator/generator.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Type definitions for documentation generators.
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=generator.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.types.js","sourceRoot":"","sources":["../../src/generator/generator.types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * JSON output generation for documentation documents.
3
+ */
4
+ import type { DocumentationDocument } from "../docsTypes/index.js";
5
+ /**
6
+ * Generates a JSON representation of a document.
7
+ */
8
+ export declare function generateJSON(document: DocumentationDocument): Record<string, unknown>;
9
+ /**
10
+ * Generates a JSON index for an entire registry of documents.
11
+ */
12
+ export declare function generateIndex(documents: readonly DocumentationDocument[]): Record<string, unknown>[];
13
+ //# sourceMappingURL=generatorJson.core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatorJson.core.d.ts","sourceRoot":"","sources":["../../src/generator/generatorJson.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,qBAAqB,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAczB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,SAAS,qBAAqB,EAAE,GAC1C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAU3B"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * JSON output generation for documentation documents.
3
+ */
4
+ /**
5
+ * Generates a JSON representation of a document.
6
+ */
7
+ export function generateJSON(document) {
8
+ return {
9
+ id: document.id,
10
+ title: document.title,
11
+ description: document.description,
12
+ category: document.category,
13
+ tags: document.tags,
14
+ version: document.version,
15
+ status: document.status,
16
+ deprecated: document.deprecated,
17
+ deprecatedMessage: document.deprecatedMessage,
18
+ content: document.content,
19
+ metadata: document.metadata,
20
+ };
21
+ }
22
+ /**
23
+ * Generates a JSON index for an entire registry of documents.
24
+ */
25
+ export function generateIndex(documents) {
26
+ return documents.map((doc) => ({
27
+ id: doc.id,
28
+ title: doc.title,
29
+ description: doc.description,
30
+ category: doc.category,
31
+ tags: doc.tags,
32
+ version: doc.version,
33
+ status: doc.status,
34
+ }));
35
+ }
36
+ //# sourceMappingURL=generatorJson.core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatorJson.core.js","sourceRoot":"","sources":["../../src/generator/generatorJson.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,QAA+B;IAE/B,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,EAAE;QACf,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;QAC7C,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;KAC5B,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,SAA2C;IAE3C,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC7B,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,MAAM,EAAE,GAAG,CAAC,MAAM;KACnB,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Markdown output generation for documentation documents.
3
+ */
4
+ import type { DocumentationDocument } from "../docsTypes/index.js";
5
+ import type { MarkdownGeneratorOptions } from "./generator.types.js";
6
+ /**
7
+ * Generates a markdown string from a document.
8
+ */
9
+ export declare function generateMarkdown(document: DocumentationDocument, options?: MarkdownGeneratorOptions): string;
10
+ //# sourceMappingURL=generatorMarkdown.core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatorMarkdown.core.d.ts","sourceRoot":"","sources":["../../src/generator/generatorMarkdown.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,qBAAqB,EAEtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGrE;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,GAAE,wBAA6B,GACrC,MAAM,CA6DR"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Markdown output generation for documentation documents.
3
+ */
4
+ import { nodesToMarkdown } from "./generatorMarkdownNodes.js";
5
+ /**
6
+ * Generates a markdown string from a document.
7
+ */
8
+ export function generateMarkdown(document, options = {}) {
9
+ const { includeFrontmatter = true, includeMeta = false } = options;
10
+ const lines = [];
11
+ if (includeFrontmatter) {
12
+ lines.push("---");
13
+ lines.push(`title: ${document.title}`);
14
+ if (document.description) {
15
+ lines.push(`description: ${document.description}`);
16
+ }
17
+ if (document.category) {
18
+ lines.push(`category: ${document.category}`);
19
+ }
20
+ if (document.tags && document.tags.length > 0) {
21
+ lines.push("tags:");
22
+ for (const tag of document.tags) {
23
+ lines.push(` - ${tag}`);
24
+ }
25
+ }
26
+ if (document.version) {
27
+ lines.push(`version: ${document.version}`);
28
+ }
29
+ if (document.status) {
30
+ lines.push(`status: ${document.status}`);
31
+ }
32
+ lines.push("---");
33
+ lines.push("");
34
+ }
35
+ if (document.deprecated) {
36
+ lines.push("> **DEPRECATED:**");
37
+ if (document.deprecatedMessage) {
38
+ lines.push(">");
39
+ lines.push(`> ${document.deprecatedMessage}`);
40
+ }
41
+ lines.push("");
42
+ }
43
+ lines.push(contentToMarkdown(document.content));
44
+ if (includeMeta && document.metadata) {
45
+ lines.push("");
46
+ lines.push("---");
47
+ lines.push("");
48
+ if (document.metadata.owner) {
49
+ lines.push(`**Owner:** ${document.metadata.owner}`);
50
+ }
51
+ if (document.metadata.updatedAt) {
52
+ lines.push(`**Updated:** ${document.metadata.updatedAt.toISOString()}`);
53
+ }
54
+ }
55
+ return lines.join("\n");
56
+ }
57
+ /**
58
+ * Converts content to markdown string.
59
+ */
60
+ function contentToMarkdown(content) {
61
+ switch (content.type) {
62
+ case "markdown":
63
+ return content.value;
64
+ case "html":
65
+ return content.value;
66
+ case "mdx":
67
+ return content.value;
68
+ case "structured":
69
+ return nodesToMarkdown(content.nodes);
70
+ }
71
+ }
72
+ //# sourceMappingURL=generatorMarkdown.core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatorMarkdown.core.js","sourceRoot":"","sources":["../../src/generator/generatorMarkdown.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAA+B,EAC/B,UAAoC,EAAE;IAEtC,MAAM,EAAE,kBAAkB,GAAG,IAAI,EAAE,WAAW,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IACnE,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,kBAAkB,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,UAAU,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;QAEvC,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,gBAAgB,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACtB,KAAK,CAAC,IAAI,CAAC,aAAa,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/C,CAAC;QAED,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,GAA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AC,KAAK,EAAE,CAAC;YAC5B,KAAK,CAAC,IAAI,CAAC,cAAc,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;QACtD,CAAC;QAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,gBAAgB,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,OAA6B;IACtD,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,UAAU;YACb,OAAO,OAAO,CAAC,KAAK,CAAC;QACvB,KAAK,MAAM;YACT,OAAO,OAAO,CAAC,KAAK,CAAC;QACvB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC,KAAK,CAAC;QACvB,KAAK,YAAY;YACf,OAAO,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Converts structured AST nodes to markdown strings.
3
+ */
4
+ import type { DocumentationNode } from "../docsTypes/index.js";
5
+ /**
6
+ * Converts a list of documentation nodes to markdown.
7
+ */
8
+ export declare function nodesToMarkdown(nodes: readonly DocumentationNode[]): string;
9
+ //# sourceMappingURL=generatorMarkdownNodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatorMarkdownNodes.d.ts","sourceRoot":"","sources":["../../src/generator/generatorMarkdownNodes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,MAAM,CAmE3E"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Converts structured AST nodes to markdown strings.
3
+ */
4
+ /**
5
+ * Converts a list of documentation nodes to markdown.
6
+ */
7
+ export function nodesToMarkdown(nodes) {
8
+ const lines = [];
9
+ for (const node of nodes) {
10
+ switch (node.type) {
11
+ case "heading":
12
+ lines.push(`${"#".repeat(node.level)} ${node.value}`);
13
+ lines.push("");
14
+ break;
15
+ case "paragraph":
16
+ lines.push(node.value);
17
+ lines.push("");
18
+ break;
19
+ case "code":
20
+ lines.push("```" + (node.language ?? ""));
21
+ lines.push(node.value);
22
+ lines.push("```");
23
+ lines.push("");
24
+ break;
25
+ case "list":
26
+ for (let i = 0; i < node.items.length; i++) {
27
+ const prefix = node.ordered ? `${i + 1}. ` : "- ";
28
+ lines.push(`${prefix}${node.items[i]}`);
29
+ }
30
+ lines.push("");
31
+ break;
32
+ case "link":
33
+ lines.push(`[${node.value}](${node.href})`);
34
+ lines.push("");
35
+ break;
36
+ case "table": {
37
+ lines.push("| " + node.headers.join(" | ") + " |");
38
+ lines.push("| " + node.headers.map(() => "---").join(" | ") + " |");
39
+ for (const row of node.rows) {
40
+ lines.push("| " + row.join(" | ") + " |");
41
+ }
42
+ lines.push("");
43
+ break;
44
+ }
45
+ case "quote":
46
+ lines.push(`> ${node.value}`);
47
+ lines.push("");
48
+ break;
49
+ case "callout": {
50
+ const labels = {
51
+ note: "NOTE",
52
+ warning: "WARNING",
53
+ tip: "TIP",
54
+ danger: "DANGER",
55
+ };
56
+ lines.push(`> **${labels[node.kind] ?? node.kind.toUpperCase()}:** ${node.value}`);
57
+ lines.push("");
58
+ break;
59
+ }
60
+ }
61
+ }
62
+ return lines.join("\n");
63
+ }
64
+ //# sourceMappingURL=generatorMarkdownNodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatorMarkdownNodes.js","sourceRoot":"","sources":["../../src/generator/generatorMarkdownNodes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,MAAM,UAAU,e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AAE,CAAC,CAAC;gBACf,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @zudojs/docs/generator
3
+ *
4
+ * Output generators — markdown and JSON for documentation.
5
+ */
6
+ export { generateMarkdown } from "./generatorMarkdown.core.js";
7
+ export { nodesToMarkdown } from "./generatorMarkdownNodes.js";
8
+ export { generateJSON, generateIndex } from "./generatorJson.core.js";
9
+ export type { MarkdownGeneratorOptions } from "./generator.types.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generator/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEtE,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @zudojs/docs/generator
3
+ *
4
+ * Output generators — markdown and JSON for documentation.
5
+ */
6
+ export { generateMarkdown } from "./generatorMarkdown.core.js";
7
+ export { nodesToMarkdown } from "./generatorMarkdownNodes.js";
8
+ export { generateJSON, generateIndex } from "./generatorJson.core.js";
9
+ //# sourceMappingURL=index.js.map