@zudojs/docs 1.0.6 → 1.1.0

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 (92) hide show
  1. package/README.md +4 -1
  2. package/dist/docsTypes/documentationContent.d.ts +0 -1
  3. package/dist/docsTypes/documentationContent.js +0 -1
  4. package/dist/docsTypes/documentationDocument.d.ts +0 -1
  5. package/dist/docsTypes/documentationDocument.js +0 -1
  6. package/dist/docsTypes/documentationMetadata.d.ts +5 -2
  7. package/dist/docsTypes/documentationMetadata.js +0 -1
  8. package/dist/docsTypes/documentationNavigation.d.ts +9 -3
  9. package/dist/docsTypes/documentationNavigation.js +0 -1
  10. package/dist/docsTypes/documentationProvider.d.ts +5 -2
  11. package/dist/docsTypes/documentationProvider.js +0 -1
  12. package/dist/docsTypes/index.d.ts +0 -1
  13. package/dist/docsTypes/index.js +0 -1
  14. package/dist/document/documentBuilder.convenience.d.ts +15 -0
  15. package/dist/document/documentBuilder.convenience.js +28 -0
  16. package/dist/document/documentBuilder.core.d.ts +18 -13
  17. package/dist/document/documentBuilder.core.js +16 -50
  18. package/dist/document/documentBuilder.normalize.d.ts +5 -1
  19. package/dist/document/documentBuilder.normalize.js +12 -1
  20. package/dist/document/documentBuilder.validate.d.ts +16 -0
  21. package/dist/document/documentBuilder.validate.js +36 -0
  22. package/dist/document/index.d.ts +2 -2
  23. package/dist/document/index.js +2 -2
  24. package/dist/errors/index.d.ts +0 -1
  25. package/dist/errors/index.js +0 -1
  26. package/dist/examples/examples.core.d.ts +0 -1
  27. package/dist/examples/examples.core.js +0 -1
  28. package/dist/examples/index.d.ts +0 -1
  29. package/dist/examples/index.js +0 -1
  30. package/dist/frontmatter/frontmatter.core.d.ts +0 -1
  31. package/dist/frontmatter/frontmatter.core.js +0 -1
  32. package/dist/frontmatter/frontmatter.parser.d.ts +0 -1
  33. package/dist/frontmatter/frontmatter.parser.js +0 -1
  34. package/dist/frontmatter/frontmatter.serializer.d.ts +0 -1
  35. package/dist/frontmatter/frontmatter.serializer.js +0 -1
  36. package/dist/frontmatter/frontmatter.types.d.ts +0 -1
  37. package/dist/frontmatter/frontmatter.types.js +0 -1
  38. package/dist/frontmatter/frontmatter.values.d.ts +0 -1
  39. package/dist/frontmatter/frontmatter.values.js +0 -1
  40. package/dist/frontmatter/index.d.ts +0 -1
  41. package/dist/frontmatter/index.js +0 -1
  42. package/dist/generator/generator.types.d.ts +0 -1
  43. package/dist/generator/generator.types.js +0 -1
  44. package/dist/generator/generatorJson.core.d.ts +0 -1
  45. package/dist/generator/generatorJson.core.js +0 -1
  46. package/dist/generator/generatorMarkdown.core.d.ts +0 -1
  47. package/dist/generator/generatorMarkdown.core.js +0 -1
  48. package/dist/generator/generatorMarkdownNodes.d.ts +0 -1
  49. package/dist/generator/generatorMarkdownNodes.js +0 -1
  50. package/dist/generator/index.d.ts +0 -1
  51. package/dist/generator/index.js +0 -1
  52. package/dist/index.d.ts +0 -1
  53. package/dist/index.js +0 -1
  54. package/dist/navigation/index.d.ts +3 -2
  55. package/dist/navigation/index.js +2 -2
  56. package/dist/navigation/navigation.adjacent.d.ts +32 -0
  57. package/dist/navigation/navigation.adjacent.js +60 -0
  58. package/dist/navigation/navigation.core.d.ts +0 -13
  59. package/dist/navigation/navigation.core.js +0 -51
  60. package/dist/registry/index.d.ts +0 -1
  61. package/dist/registry/index.js +0 -1
  62. package/dist/registry/registry.core.d.ts +0 -1
  63. package/dist/registry/registry.core.js +0 -1
  64. package/dist/utils/index.d.ts +0 -1
  65. package/dist/utils/index.js +0 -1
  66. package/dist/utils/utils.freeze.d.ts +0 -1
  67. package/dist/utils/utils.freeze.js +0 -1
  68. package/dist/utils/utils.helper.d.ts +0 -1
  69. package/dist/utils/utils.helper.js +0 -1
  70. package/dist/utils/utils.href.d.ts +0 -1
  71. package/dist/utils/utils.href.js +0 -1
  72. package/dist/utils/utils.markdownText.d.ts +0 -1
  73. package/dist/utils/utils.markdownText.js +0 -1
  74. package/dist/validator/index.d.ts +0 -1
  75. package/dist/validator/index.js +0 -1
  76. package/dist/validator/validator.types.d.ts +0 -1
  77. package/dist/validator/validator.types.js +0 -1
  78. package/dist/validator/validatorAll/index.d.ts +0 -1
  79. package/dist/validator/validatorAll/index.js +0 -1
  80. package/dist/validator/validatorAll/validatorAll.core.d.ts +11 -1
  81. package/dist/validator/validatorAll/validatorAll.core.js +6 -2
  82. package/dist/validator/validatorAll/validatorNavigation.core.d.ts +0 -1
  83. package/dist/validator/validatorAll/validatorNavigation.core.js +0 -1
  84. package/dist/validator/validatorDocument.core.d.ts +0 -1
  85. package/dist/validator/validatorDocument.core.js +0 -1
  86. package/dist/validator/validatorDuplicates.core.d.ts +0 -1
  87. package/dist/validator/validatorDuplicates.core.js +0 -1
  88. package/dist/validator/validatorLinks.core.d.ts +16 -6
  89. package/dist/validator/validatorLinks.core.js +18 -37
  90. package/dist/validator/validatorLinks.extract.d.ts +30 -0
  91. package/dist/validator/validatorLinks.extract.js +118 -0
  92. package/package.json +2 -2
package/README.md CHANGED
@@ -58,7 +58,10 @@ const index = generateIndex(registry.getAll()); // SERVER-only docs excluded
58
58
  - Markdown and JSON generation with escaping for untrusted content: structured text is HTML-escaped and links are limited to http, https, mailto, tel, ftp and ftps (others are written as plain text)
59
59
  - Fail-closed `visibility` filtering: only an unset or exactly `"CLIENT"` visibility reaches a client index
60
60
  - `stripMarkdown` and link validation run in linear time on untrusted input
61
- - Document, link and navigation validation with a single `valid` rule (errors only); `javascript:` and other non-allow-listed link schemes are `UNSAFE_LINK` errors
61
+ - Document, link and navigation validation with a single `valid` rule (errors only); `javascript:` and other non-allow-listed link schemes are `UNSAFE_LINK` errors in every link form — inline `[x](…)` (including targets with parentheses or a title), reference definitions `[x]: …`, raw `<a href="…">` and `<scheme:…>` autolinks
62
+ - `BROKEN_LINK` and `NAVIGATION_ORPHAN_DOCUMENT` are warnings by default; pass `{ brokenLinkSeverity: "error", orphanSeverity: "error" }` to `validateAll` (or `brokenLinkSeverity` to `validateLinks`) to fail on dead links or unreachable documents
63
+ - `createDocument({ …, strict: true })` rejects an unknown `category`, `status` or `visibility` at creation instead of leaving it to `validateDocument`; documents never carry explicit `undefined` keys
64
+ - `getAdjacent(id, nav, { scope: "tree" })` walks previous/next across section boundaries in reading order (the default stays within one level)
62
65
  - Documentation error classes re-exported from `@zudojs/errors`
63
66
 
64
67
  ## Use Cases
@@ -77,4 +77,3 @@ export interface StructuredContent {
77
77
  * A document can use any of these formats.
78
78
  */
79
79
  export type DocumentationContent = MarkdownContent | MDXContent | HTMLContent | StructuredContent;
80
- //# sourceMappingURL=documentationContent.d.ts.map
@@ -5,4 +5,3 @@
5
5
  * and structured AST nodes for multi-format rendering.
6
6
  */
7
7
  export {};
8
- //# sourceMappingURL=documentationContent.js.map
@@ -26,4 +26,3 @@ export interface DocumentationDocument {
26
26
  readonly deprecatedMessage?: string;
27
27
  readonly visibility?: "SERVER" | "CLIENT";
28
28
  }
29
- //# sourceMappingURL=documentationDocument.d.ts.map
@@ -5,4 +5,3 @@
5
5
  * Each document has a stable ID, structured content, and metadata.
6
6
  */
7
7
  export {};
8
- //# sourceMappingURL=documentationDocument.js.map
@@ -50,11 +50,14 @@ export interface DocumentationMetadata {
50
50
  readonly ticket?: string;
51
51
  readonly tags?: readonly string[];
52
52
  }
53
- /** A version entry for versioned documentation. */
53
+ /**
54
+ * A version entry for versioned documentation. A contract only: the
55
+ * package provides no version switcher; hosts list their versions with
56
+ * this shape and select a registry per version.
57
+ */
54
58
  export interface DocumentationVersion {
55
59
  readonly version: string;
56
60
  readonly label?: string;
57
61
  readonly deprecated?: boolean;
58
62
  readonly latest?: boolean;
59
63
  }
60
- //# sourceMappingURL=documentationMetadata.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Metadata and classification types for documentation.
3
3
  */
4
4
  export {};
5
- //# sourceMappingURL=documentationMetadata.js.map
@@ -15,7 +15,11 @@ export interface DocumentationBreadcrumb {
15
15
  readonly title: string;
16
16
  readonly documentId?: string;
17
17
  }
18
- /** Search document for indexing. */
18
+ /**
19
+ * Search document for indexing. A contract only: this package ships no
20
+ * search index; build `SearchDocument`s from a registry (for example with
21
+ * `stripMarkdown`) and feed them to the search engine of your choice.
22
+ */
19
23
  export interface SearchDocument {
20
24
  readonly id: string;
21
25
  readonly title: string;
@@ -23,7 +27,10 @@ export interface SearchDocument {
23
27
  readonly tags: readonly string[];
24
28
  readonly path: string;
25
29
  }
26
- /** Search result returned from a search query. */
30
+ /**
31
+ * Search result returned from a search query. A contract only; see
32
+ * `SearchDocument`.
33
+ */
27
34
  export interface SearchResult {
28
35
  readonly id: string;
29
36
  readonly title: string;
@@ -31,4 +38,3 @@ export interface SearchResult {
31
38
  readonly excerpt?: string;
32
39
  readonly score?: number;
33
40
  }
34
- //# sourceMappingURL=documentationNavigation.d.ts.map
@@ -5,4 +5,3 @@
5
5
  * structure can be controlled independently of content.
6
6
  */
7
7
  export {};
8
- //# sourceMappingURL=documentationNavigation.js.map
@@ -10,7 +10,11 @@ export interface DocumentationProvider {
10
10
  get(id: string): DocumentationDocument | undefined;
11
11
  getAll(): readonly DocumentationDocument[];
12
12
  }
13
- /** Loads content from a documentation source. */
13
+ /**
14
+ * Loads content from a documentation source. A contract only: no loader
15
+ * ships with the package; implement it over the file system, a fetch or
16
+ * a database and pass the result to `parseFrontmatter` / `createDocument`.
17
+ */
14
18
  export interface DocumentationSourceLoader {
15
19
  load(source: string): Promise<string>;
16
20
  }
@@ -18,4 +22,3 @@ export interface DocumentationSourceLoader {
18
22
  export interface DocumentationSanitizer {
19
23
  sanitize(content: string): string;
20
24
  }
21
- //# sourceMappingURL=documentationProvider.d.ts.map
@@ -5,4 +5,3 @@
5
5
  * Source loaders abstract how documentation is read.
6
6
  */
7
7
  export {};
8
- //# sourceMappingURL=documentationProvider.js.map
@@ -8,4 +8,3 @@ export type { DocumentationCategory, DocumentationStatus, APISymbolKind, SourceL
8
8
  export type { DocumentationDocument } from "./documentationDocument.js";
9
9
  export type { DocumentationNavigationItem, DocumentationBreadcrumb, SearchDocument, SearchResult, } from "./documentationNavigation.js";
10
10
  export type { DocumentationProvider, DocumentationSourceLoader, DocumentationSanitizer, } from "./documentationProvider.js";
11
- //# sourceMappingURL=index.d.ts.map
@@ -4,4 +4,3 @@
4
4
  * Core type definitions for the documentation model.
5
5
  */
6
6
  export {};
7
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Convenience builders for markdown and structured documents.
3
+ *
4
+ * @module document/documentBuilder.convenience
5
+ */
6
+ import type { DocumentationDocument, DocumentationNode } from "../docsTypes/index.js";
7
+ import { type DocumentBuilderExtras } from "./documentBuilder.core.js";
8
+ /**
9
+ * Creates a markdown document.
10
+ */
11
+ export declare function createMarkdownDocument(id: string, title: string, markdown: string, options?: DocumentBuilderExtras): DocumentationDocument;
12
+ /**
13
+ * Creates a structured document from AST nodes.
14
+ */
15
+ export declare function createStructuredDocument(id: string, title: string, nodes: readonly DocumentationNode[], options?: DocumentBuilderExtras): DocumentationDocument;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Convenience builders for markdown and structured documents.
3
+ *
4
+ * @module document/documentBuilder.convenience
5
+ */
6
+ import { createDocument, } from "./documentBuilder.core.js";
7
+ /**
8
+ * Creates a markdown document.
9
+ */
10
+ export function createMarkdownDocument(id, title, markdown, options) {
11
+ return createDocument({
12
+ ...options,
13
+ id,
14
+ title,
15
+ content: { type: "markdown", value: markdown },
16
+ });
17
+ }
18
+ /**
19
+ * Creates a structured document from AST nodes.
20
+ */
21
+ export function createStructuredDocument(id, title, nodes, options) {
22
+ return createDocument({
23
+ ...options,
24
+ id,
25
+ title,
26
+ content: { type: "structured", nodes },
27
+ });
28
+ }
@@ -4,7 +4,7 @@
4
4
  * Provides a chainable API that validates inputs and
5
5
  * produces immutable DocumentationDocument objects.
6
6
  */
7
- import type { DocumentationContent, DocumentationDocument, DocumentationCategory, DocumentationMetadata, DocumentationNode, DocumentationStatus } from "../docsTypes/index.js";
7
+ import type { DocumentationContent, DocumentationDocument, DocumentationCategory, DocumentationMetadata, DocumentationStatus } from "../docsTypes/index.js";
8
8
  /**
9
9
  * Options for creating a document via the builder.
10
10
  */
@@ -21,6 +21,14 @@ export interface DocumentBuilderOptions {
21
21
  readonly deprecated?: boolean;
22
22
  readonly deprecatedMessage?: string;
23
23
  readonly visibility?: "SERVER" | "CLIENT";
24
+ /**
25
+ * When true, the built document is also run through `validateDocument`
26
+ * and any error issue (unknown `category`, `status`, `visibility`,
27
+ * content type or structured node) throws a `DocumentValidationError`.
28
+ * Defaults to false: the builder checks only `id`, `title` and the
29
+ * presence of `content`, matching earlier releases.
30
+ */
31
+ readonly strict?: boolean;
24
32
  }
25
33
  /**
26
34
  * Options accepted by the convenience builders. The positional
@@ -32,10 +40,16 @@ export type DocumentBuilderExtras = Omit<Partial<DocumentBuilderOptions>, "id" |
32
40
  *
33
41
  * The returned document is a deep-frozen copy: later mutation of the
34
42
  * options object (or of nested `content`, `metadata`, `tags`) does not
35
- * affect it.
43
+ * affect it. Optional fields that were not supplied are absent from the
44
+ * document rather than present as `undefined`.
36
45
  *
37
- * @throws {DocumentValidationError} when `id`, `title` or `content` is missing
38
- * or the ID is not a valid dot-separated identifier.
46
+ * Only `id`, `title` and `content` are checked here; `category`, `status`
47
+ * and the other enums are checked by `validateDocument`, or at creation
48
+ * time when `strict: true` is passed.
49
+ *
50
+ * @throws {DocumentValidationError} when `id`, `title` or `content` is missing,
51
+ * the ID is not a valid dot-separated identifier, or (`strict: true`)
52
+ * `validateDocument` reports an error.
39
53
  *
40
54
  * @example
41
55
  * ```ts
@@ -49,12 +63,3 @@ export type DocumentBuilderExtras = Omit<Partial<DocumentBuilderOptions>, "id" |
49
63
  * ```
50
64
  */
51
65
  export declare function createDocument(options: DocumentBuilderOptions): DocumentationDocument;
52
- /**
53
- * Creates a markdown document.
54
- */
55
- export declare function createMarkdownDocument(id: string, title: string, markdown: string, options?: DocumentBuilderExtras): DocumentationDocument;
56
- /**
57
- * Creates a structured document from AST nodes.
58
- */
59
- export declare function createStructuredDocument(id: string, title: string, nodes: readonly DocumentationNode[], options?: DocumentBuilderExtras): DocumentationDocument;
60
- //# sourceMappingURL=documentBuilder.core.d.ts.map
@@ -4,19 +4,24 @@
4
4
  * Provides a chainable API that validates inputs and
5
5
  * produces immutable DocumentationDocument objects.
6
6
  */
7
- import { DocumentValidationError } from "@zudojs/errors";
8
7
  import { deepFreezeClone } from "../utils/utils.freeze.js";
9
- import { isValidDocumentId } from "../utils/utils.helper.js";
10
- import { toTagList } from "./documentBuilder.normalize.js";
8
+ import { toTagList, withoutUndefined } from "./documentBuilder.normalize.js";
9
+ import { assertValid, validateDocumentOptions } from "./documentBuilder.validate.js";
11
10
  /**
12
11
  * Creates a documentation document from structured options.
13
12
  *
14
13
  * The returned document is a deep-frozen copy: later mutation of the
15
14
  * options object (or of nested `content`, `metadata`, `tags`) does not
16
- * affect it.
15
+ * affect it. Optional fields that were not supplied are absent from the
16
+ * document rather than present as `undefined`.
17
17
  *
18
- * @throws {DocumentValidationError} when `id`, `title` or `content` is missing
19
- * or the ID is not a valid dot-separated identifier.
18
+ * Only `id`, `title` and `content` are checked here; `category`, `status`
19
+ * and the other enums are checked by `validateDocument`, or at creation
20
+ * time when `strict: true` is passed.
21
+ *
22
+ * @throws {DocumentValidationError} when `id`, `title` or `content` is missing,
23
+ * the ID is not a valid dot-separated identifier, or (`strict: true`)
24
+ * `validateDocument` reports an error.
20
25
  *
21
26
  * @example
22
27
  * ```ts
@@ -31,7 +36,7 @@ import { toTagList } from "./documentBuilder.normalize.js";
31
36
  */
32
37
  export function createDocument(options) {
33
38
  validateDocumentOptions(options);
34
- const document = {
39
+ const document = withoutUndefined({
35
40
  id: options.id,
36
41
  title: options.title,
37
42
  description: options.description,
@@ -44,48 +49,9 @@ export function createDocument(options) {
44
49
  deprecated: options.deprecated,
45
50
  deprecatedMessage: options.deprecatedMessage,
46
51
  visibility: options.visibility,
47
- };
48
- return deepFreezeClone(document);
49
- }
50
- /**
51
- * Validates document builder options.
52
- * Throws on invalid input.
53
- */
54
- function validateDocumentOptions(options) {
55
- if (typeof options.id !== "string" || options.id.trim().length === 0) {
56
- throw new DocumentValidationError("Document ID is required.");
57
- }
58
- if (!isValidDocumentId(options.id)) {
59
- throw new DocumentValidationError(`Document ID "${options.id}" is invalid. Use dot-separated segments of letters, digits, "_" and "-".`, options.id);
60
- }
61
- if (typeof options.title !== "string" ||
62
- options.title.trim().length === 0) {
63
- throw new DocumentValidationError("Document title is required.", options.id);
64
- }
65
- if (!options.content || typeof options.content !== "object") {
66
- throw new DocumentValidationError("Document content is required.", options.id);
67
- }
68
- }
69
- /**
70
- * Creates a markdown document.
71
- */
72
- export function createMarkdownDocument(id, title, markdown, options) {
73
- return createDocument({
74
- ...options,
75
- id,
76
- title,
77
- content: { type: "markdown", value: markdown },
78
- });
79
- }
80
- /**
81
- * Creates a structured document from AST nodes.
82
- */
83
- export function createStructuredDocument(id, title, nodes, options) {
84
- return createDocument({
85
- ...options,
86
- id,
87
- title,
88
- content: { type: "structured", nodes },
89
52
  });
53
+ if (options.strict) {
54
+ assertValid(document);
55
+ }
56
+ return deepFreezeClone(document);
90
57
  }
91
- //# sourceMappingURL=documentBuilder.core.js.map
@@ -9,4 +9,8 @@
9
9
  * one-character tags.
10
10
  */
11
11
  export declare function toTagList(tags: readonly string[] | string | undefined): string[] | undefined;
12
- //# sourceMappingURL=documentBuilder.normalize.d.ts.map
12
+ /**
13
+ * Shallow copy of `value` without the keys whose value is `undefined`, so
14
+ * an optional field that was not supplied is absent instead of present.
15
+ */
16
+ export declare function withoutUndefined<T extends object>(value: T): T;
@@ -15,4 +15,15 @@ export function toTagList(tags) {
15
15
  return tags === "" ? [] : [tags];
16
16
  return [...tags];
17
17
  }
18
- //# sourceMappingURL=documentBuilder.normalize.js.map
18
+ /**
19
+ * Shallow copy of `value` without the keys whose value is `undefined`, so
20
+ * an optional field that was not supplied is absent instead of present.
21
+ */
22
+ export function withoutUndefined(value) {
23
+ const copy = {};
24
+ for (const [key, item] of Object.entries(value)) {
25
+ if (item !== undefined)
26
+ copy[key] = item;
27
+ }
28
+ return copy;
29
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Input and strict-mode checks for `createDocument`.
3
+ *
4
+ * @module document/documentBuilder.validate
5
+ */
6
+ import type { DocumentationDocument } from "../docsTypes/index.js";
7
+ import type { DocumentBuilderOptions } from "./documentBuilder.core.js";
8
+ /**
9
+ * Validates document builder options.
10
+ * Throws on invalid input.
11
+ */
12
+ export declare function validateDocumentOptions(options: DocumentBuilderOptions): void;
13
+ /**
14
+ * Throws when `validateDocument` reports an error issue for `document`.
15
+ */
16
+ export declare function assertValid(document: DocumentationDocument): void;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Input and strict-mode checks for `createDocument`.
3
+ *
4
+ * @module document/documentBuilder.validate
5
+ */
6
+ import { DocumentValidationError } from "@zudojs/errors";
7
+ import { isValidDocumentId } from "../utils/utils.helper.js";
8
+ import { validateDocument } from "../validator/validatorDocument.core.js";
9
+ /**
10
+ * Validates document builder options.
11
+ * Throws on invalid input.
12
+ */
13
+ export function validateDocumentOptions(options) {
14
+ if (typeof options.id !== "string" || options.id.trim().length === 0) {
15
+ throw new DocumentValidationError("Document ID is required.");
16
+ }
17
+ if (!isValidDocumentId(options.id)) {
18
+ throw new DocumentValidationError(`Document ID "${options.id}" is invalid. Use dot-separated segments of letters, digits, "_" and "-".`, options.id);
19
+ }
20
+ if (typeof options.title !== "string" ||
21
+ options.title.trim().length === 0) {
22
+ throw new DocumentValidationError("Document title is required.", options.id);
23
+ }
24
+ if (!options.content || typeof options.content !== "object") {
25
+ throw new DocumentValidationError("Document content is required.", options.id);
26
+ }
27
+ }
28
+ /**
29
+ * Throws when `validateDocument` reports an error issue for `document`.
30
+ */
31
+ export function assertValid(document) {
32
+ const failure = validateDocument(document).issues.find((issue) => issue.severity === "error");
33
+ if (failure) {
34
+ throw new DocumentValidationError(failure.message, document.id);
35
+ }
36
+ }
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * Document model and builder for creating documentation pages.
5
5
  */
6
- export { createDocument, createMarkdownDocument, createStructuredDocument, } from "./documentBuilder.core.js";
6
+ export { createDocument } from "./documentBuilder.core.js";
7
+ export { createMarkdownDocument, createStructuredDocument, } from "./documentBuilder.convenience.js";
7
8
  export type { DocumentBuilderOptions, DocumentBuilderExtras, } from "./documentBuilder.core.js";
8
- //# sourceMappingURL=index.d.ts.map
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * Document model and builder for creating documentation pages.
5
5
  */
6
- export { createDocument, createMarkdownDocument, createStructuredDocument, } from "./documentBuilder.core.js";
7
- //# sourceMappingURL=index.js.map
6
+ export { createDocument } from "./documentBuilder.core.js";
7
+ export { createMarkdownDocument, createStructuredDocument, } from "./documentBuilder.convenience.js";
@@ -13,4 +13,3 @@ export type { DocumentationErrorOptions } from "@zudojs/errors";
13
13
  export declare function createDocumentationError(message: string, options?: DocumentationErrorOptions): DocumentationError;
14
14
  /** Determines whether an unknown value is a `DocumentationError`. */
15
15
  export declare function isDocumentationError(value: unknown): value is DocumentationError;
16
- //# sourceMappingURL=index.d.ts.map
@@ -15,4 +15,3 @@ export function createDocumentationError(message, options) {
15
15
  export function isDocumentationError(value) {
16
16
  return value instanceof DocumentationError;
17
17
  }
18
- //# sourceMappingURL=index.js.map
@@ -39,4 +39,3 @@ export declare function renderExampleMarkdown(example: DocumentationExample): st
39
39
  * Renders an example as a JSON-serializable object.
40
40
  */
41
41
  export declare function exampleToJSON(example: DocumentationExample): Record<string, unknown>;
42
- //# sourceMappingURL=examples.core.d.ts.map
@@ -62,4 +62,3 @@ export function exampleToJSON(example) {
62
62
  description: example.description,
63
63
  };
64
64
  }
65
- //# sourceMappingURL=examples.core.js.map
@@ -5,4 +5,3 @@
5
5
  */
6
6
  export { validateExample, renderExampleMarkdown, exampleToJSON, } from "./examples.core.js";
7
7
  export type { DocumentationExample, ExampleValidationResult, } from "./examples.core.js";
8
- //# sourceMappingURL=index.d.ts.map
@@ -4,4 +4,3 @@
4
4
  * Code example modeling, validation, and rendering for documentation.
5
5
  */
6
6
  export { validateExample, renderExampleMarkdown, exampleToJSON, } from "./examples.core.js";
7
- //# sourceMappingURL=index.js.map
@@ -4,4 +4,3 @@
4
4
  export { parseFrontmatter } from "./frontmatter.parser.js";
5
5
  export { serializeFrontmatter } from "./frontmatter.serializer.js";
6
6
  export type { ParsedFrontmatter, FrontmatterMetadata, FrontmatterScalar, FrontmatterValue, } from "./frontmatter.types.js";
7
- //# sourceMappingURL=frontmatter.core.d.ts.map
@@ -3,4 +3,3 @@
3
3
  */
4
4
  export { parseFrontmatter } from "./frontmatter.parser.js";
5
5
  export { serializeFrontmatter } from "./frontmatter.serializer.js";
6
- //# sourceMappingURL=frontmatter.core.js.map
@@ -26,4 +26,3 @@ import type { ParsedFrontmatter } from "./frontmatter.types.js";
26
26
  * empty metadata.
27
27
  */
28
28
  export declare function parseFrontmatter(raw: string): ParsedFrontmatter;
29
- //# sourceMappingURL=frontmatter.parser.d.ts.map
@@ -238,4 +238,3 @@ function unescapeDoubleQuoted(value) {
238
238
  }
239
239
  });
240
240
  }
241
- //# sourceMappingURL=frontmatter.parser.js.map
@@ -18,4 +18,3 @@ import type { FrontmatterMetadata } from "./frontmatter.types.js";
18
18
  export declare function serializeFrontmatter(metadata: FrontmatterMetadata | Readonly<Record<string, unknown>>, content: string): string;
19
19
  /** Formats a single scalar, quoting whenever the parser could misread it. */
20
20
  export declare function formatScalar(value: unknown): string;
21
- //# sourceMappingURL=frontmatter.serializer.d.ts.map
@@ -124,4 +124,3 @@ function isPlainObject(value) {
124
124
  const proto = Object.getPrototypeOf(value);
125
125
  return proto === Object.prototype || proto === null;
126
126
  }
127
- //# sourceMappingURL=frontmatter.serializer.js.map
@@ -32,4 +32,3 @@ export interface FrontmatterMetadata {
32
32
  readonly visibility?: string;
33
33
  readonly [key: string]: FrontmatterValue | undefined;
34
34
  }
35
- //# sourceMappingURL=frontmatter.types.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Type definitions for frontmatter parsing.
3
3
  */
4
4
  export {};
5
- //# sourceMappingURL=frontmatter.types.js.map
@@ -22,4 +22,3 @@ export declare function emptyCollection(value: string): readonly never[] | Reado
22
22
  * list; anything else is a single item. Items go through `parseItem`.
23
23
  */
24
24
  export declare function parseInlineList(value: string, parseItem: (item: string) => string): readonly string[];
25
- //# sourceMappingURL=frontmatter.values.d.ts.map
@@ -67,4 +67,3 @@ export function parseInlineList(value, parseItem) {
67
67
  .filter((item) => item !== "")
68
68
  .map(parseItem));
69
69
  }
70
- //# sourceMappingURL=frontmatter.values.js.map
@@ -5,4 +5,3 @@
5
5
  */
6
6
  export { parseFrontmatter, serializeFrontmatter } from "./frontmatter.core.js";
7
7
  export type { ParsedFrontmatter, FrontmatterMetadata, FrontmatterScalar, FrontmatterValue, } from "./frontmatter.core.js";
8
- //# sourceMappingURL=index.d.ts.map
@@ -4,4 +4,3 @@
4
4
  * YAML frontmatter parsing and serialization for markdown documentation.
5
5
  */
6
6
  export { parseFrontmatter, serializeFrontmatter } from "./frontmatter.core.js";
7
- //# sourceMappingURL=index.js.map
@@ -26,4 +26,3 @@ export interface IndexGeneratorOptions {
26
26
  */
27
27
  readonly visibility?: DocumentVisibilityFilter;
28
28
  }
29
- //# sourceMappingURL=generator.types.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Type definitions for documentation generators.
3
3
  */
4
4
  export {};
5
- //# sourceMappingURL=generator.types.js.map
@@ -15,4 +15,3 @@ export declare function generateJSON(document: DocumentationDocument): Record<st
15
15
  * `IndexGeneratorOptions.visibility`).
16
16
  */
17
17
  export declare function generateIndex(documents: readonly DocumentationDocument[], options?: IndexGeneratorOptions): Record<string, unknown>[];
18
- //# sourceMappingURL=generatorJson.core.d.ts.map
@@ -45,4 +45,3 @@ export function generateIndex(documents, options = {}) {
45
45
  deprecatedMessage: doc.deprecatedMessage,
46
46
  }));
47
47
  }
48
- //# sourceMappingURL=generatorJson.core.js.map
@@ -11,4 +11,3 @@ import type { MarkdownGeneratorOptions } from "./generator.types.js";
11
11
  * and tags cannot inject metadata keys or terminate the block.
12
12
  */
13
13
  export declare function generateMarkdown(document: DocumentationDocument, options?: MarkdownGeneratorOptions): string;
14
- //# sourceMappingURL=generatorMarkdown.core.d.ts.map
@@ -93,4 +93,3 @@ function contentToMarkdown(content, sanitizer) {
93
93
  function escapeInline(value) {
94
94
  return escapeHtmlText(value.replace(/\r?\n/g, " "));
95
95
  }
96
- //# sourceMappingURL=generatorMarkdown.core.js.map
@@ -29,4 +29,3 @@ export declare function fenceFor(value: string): string;
29
29
  export declare function sanitizeLanguage(language: string | undefined): string;
30
30
  /** Escapes `|` and newlines so a value stays inside its table cell. */
31
31
  export declare function tableCell(value: string): string;
32
- //# sourceMappingURL=generatorMarkdownNodes.d.ts.map
@@ -144,4 +144,3 @@ function escapeLinkHref(href) {
144
144
  const clean = href.replace(/[\r\n]/g, "").replace(/&/g, "&amp;");
145
145
  return /[\s()]/.test(clean) ? `<${clean.replace(/[<>]/g, "")}>` : clean;
146
146
  }
147
- //# sourceMappingURL=generatorMarkdownNodes.js.map
@@ -7,4 +7,3 @@ export { generateMarkdown } from "./generatorMarkdown.core.js";
7
7
  export { nodesToMarkdown, clampHeadingLevel, fenceFor, sanitizeLanguage, tableCell, } from "./generatorMarkdownNodes.js";
8
8
  export { generateJSON, generateIndex } from "./generatorJson.core.js";
9
9
  export type { MarkdownGeneratorOptions, IndexGeneratorOptions, } from "./generator.types.js";
10
- //# sourceMappingURL=index.d.ts.map
@@ -6,4 +6,3 @@
6
6
  export { generateMarkdown } from "./generatorMarkdown.core.js";
7
7
  export { nodesToMarkdown, clampHeadingLevel, fenceFor, sanitizeLanguage, tableCell, } from "./generatorMarkdownNodes.js";
8
8
  export { generateJSON, generateIndex } from "./generatorJson.core.js";
9
- //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -17,4 +17,3 @@ export * from "./examples/index.js";
17
17
  export * from "./generator/index.js";
18
18
  export * from "./utils/index.js";
19
19
  export * from "./errors/index.js";
20
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -27,4 +27,3 @@ export * from "./generator/index.js";
27
27
  export * from "./utils/index.js";
28
28
  // Errors (re-exported from @zudojs/errors)
29
29
  export * from "./errors/index.js";
30
- //# sourceMappingURL=index.js.map
@@ -3,5 +3,6 @@
3
3
  *
4
4
  * Navigation tree utilities — breadcrumbs, flattening, sibling resolution.
5
5
  */
6
- export { getBreadcrumbs, flattenNavigation, findNavigationItem, getSiblings, getAdjacent, } from "./navigation.core.js";
7
- //# sourceMappingURL=index.d.ts.map
6
+ export { getBreadcrumbs, flattenNavigation, findNavigationItem, } from "./navigation.core.js";
7
+ export { getSiblings, getAdjacent } from "./navigation.adjacent.js";
8
+ export type { GetAdjacentOptions } from "./navigation.adjacent.js";