markdown-codec 5.0.3 → 6.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.
- package/README.md +36 -35
- package/dist/ast/ast.d.cts +1 -1
- package/dist/ast/ast.d.ts +1 -1
- package/dist/{ast-8XCbjRQT.d.cts → ast-CNfTgS0N.d.cts} +35 -35
- package/dist/{ast-8XCbjRQT.d.ts → ast-CNfTgS0N.d.ts} +35 -35
- package/dist/block/block.d.cts +3 -3
- package/dist/block/block.d.ts +3 -3
- package/dist/block/definitions.d.cts +1 -1
- package/dist/block/definitions.d.ts +1 -1
- package/dist/block/node.d.cts +4 -4
- package/dist/block/node.d.ts +4 -4
- package/dist/block/table.d.cts +1 -1
- package/dist/block/table.d.ts +1 -1
- package/dist/codec.cjs +1 -1
- package/dist/codec.d.cts +10 -10
- package/dist/codec.d.ts +10 -10
- package/dist/codec.js +2 -2
- package/dist/defaults/defaults.d.cts +1 -1
- package/dist/defaults/defaults.d.ts +1 -1
- package/dist/diagnostics/diagnostics.d.cts +1 -1
- package/dist/diagnostics/diagnostics.d.ts +1 -1
- package/dist/{diagnostics-CkcSYZf1.d.cts → diagnostics-CH-xa2-s.d.cts} +5 -5
- package/dist/{diagnostics-CkcSYZf1.d.ts → diagnostics-CH-xa2-s.d.ts} +5 -5
- package/dist/emit/emit.cjs +1 -1
- package/dist/emit/emit.js +1 -1
- package/dist/emit/inline.cjs +2 -2
- package/dist/emit/inline.d.cts +3 -3
- package/dist/emit/inline.d.ts +3 -3
- package/dist/emit/inline.js +2 -2
- package/dist/emit/table.d.cts +1 -1
- package/dist/emit/table.d.ts +1 -1
- package/dist/html/render.d.cts +1 -1
- package/dist/html/render.d.ts +1 -1
- package/dist/image/image.cjs +4 -4
- package/dist/image/image.d.cts +1 -1
- package/dist/image/image.d.ts +1 -1
- package/dist/image/image.js +4 -4
- package/dist/{image-C4KYmz_L.d.cts → image-B5L0HpAJ.d.cts} +1 -1
- package/dist/{image-DescdRgq.d.cts → image-BtmTG4_a.d.cts} +1 -1
- package/dist/{image-DescdRgq.d.ts → image-BtmTG4_a.d.ts} +1 -1
- package/dist/{image-Cm3hT5PS.d.ts → image-C390OIB3.d.ts} +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/inline/delimiter.d.cts +2 -2
- package/dist/inline/delimiter.d.ts +2 -2
- package/dist/inline/inline.d.cts +1 -1
- package/dist/inline/inline.d.ts +1 -1
- package/dist/inline/node.d.cts +2 -2
- package/dist/inline/node.d.ts +2 -2
- package/dist/{inline-CoS1JzxI.d.cts → inline-CnO86zMw.d.cts} +1 -1
- package/dist/{inline-OGXVE6hB.d.ts → inline-DItZ-VVw.d.ts} +1 -1
- package/dist/lower/front-matter.d.cts +1 -1
- package/dist/lower/front-matter.d.ts +1 -1
- package/dist/lower/image.d.cts +1 -1
- package/dist/lower/image.d.ts +1 -1
- package/dist/lower/inline.d.cts +3 -3
- package/dist/lower/inline.d.ts +3 -3
- package/dist/lower/table.d.cts +1 -1
- package/dist/lower/table.d.ts +1 -1
- package/dist/options/options.d.cts +10 -10
- package/dist/options/options.d.ts +10 -10
- package/dist/read.cjs +1 -1
- package/dist/read.d.cts +3 -3
- package/dist/read.d.ts +3 -3
- package/dist/read.js +2 -2
- package/dist/scan/entity-table.cjs +2125 -2125
- package/dist/scan/entity-table.js +2125 -2125
- package/dist/shared/list-id.d.cts +3 -3
- package/dist/shared/list-id.d.ts +3 -3
- package/dist/write.cjs +2 -2
- package/dist/write.d.cts +2 -2
- package/dist/write.d.ts +2 -2
- package/dist/write.js +3 -3
- package/package.json +3 -12
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
//#region src/shared/list-id.d.ts
|
|
2
2
|
interface ListNumIdInfo {
|
|
3
|
-
readonly type:
|
|
3
|
+
readonly type: "bullet" | "ordered";
|
|
4
4
|
readonly start?: number;
|
|
5
5
|
readonly task: boolean;
|
|
6
6
|
readonly loose: boolean;
|
|
7
7
|
}
|
|
8
8
|
interface ListNumIdMintOptions {
|
|
9
|
-
readonly type:
|
|
9
|
+
readonly type: "bullet" | "ordered";
|
|
10
10
|
readonly start?: number;
|
|
11
11
|
readonly task: boolean;
|
|
12
12
|
readonly loose: boolean;
|
|
@@ -17,7 +17,7 @@ interface NumIdMintState {
|
|
|
17
17
|
declare function createNumIdMintState(): NumIdMintState;
|
|
18
18
|
declare function mintListNumId(state: NumIdMintState, options: ListNumIdMintOptions): string;
|
|
19
19
|
declare function parseListNumId(numId: string): ListNumIdInfo | undefined;
|
|
20
|
-
declare function mintedListType(numId: string):
|
|
20
|
+
declare function mintedListType(numId: string): "bullet" | "ordered" | undefined;
|
|
21
21
|
declare function mintListItemId(state: NumIdMintState): string;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { ListNumIdInfo, ListNumIdMintOptions, NumIdMintState, createNumIdMintState, mintListItemId, mintListNumId, mintedListType, parseListNumId };
|
package/dist/shared/list-id.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
//#region src/shared/list-id.d.ts
|
|
2
2
|
interface ListNumIdInfo {
|
|
3
|
-
readonly type:
|
|
3
|
+
readonly type: "bullet" | "ordered";
|
|
4
4
|
readonly start?: number;
|
|
5
5
|
readonly task: boolean;
|
|
6
6
|
readonly loose: boolean;
|
|
7
7
|
}
|
|
8
8
|
interface ListNumIdMintOptions {
|
|
9
|
-
readonly type:
|
|
9
|
+
readonly type: "bullet" | "ordered";
|
|
10
10
|
readonly start?: number;
|
|
11
11
|
readonly task: boolean;
|
|
12
12
|
readonly loose: boolean;
|
|
@@ -17,7 +17,7 @@ interface NumIdMintState {
|
|
|
17
17
|
declare function createNumIdMintState(): NumIdMintState;
|
|
18
18
|
declare function mintListNumId(state: NumIdMintState, options: ListNumIdMintOptions): string;
|
|
19
19
|
declare function parseListNumId(numId: string): ListNumIdInfo | undefined;
|
|
20
|
-
declare function mintedListType(numId: string):
|
|
20
|
+
declare function mintedListType(numId: string): "bullet" | "ordered" | undefined;
|
|
21
21
|
declare function mintListItemId(state: NumIdMintState): string;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { ListNumIdInfo, ListNumIdMintOptions, NumIdMintState, createNumIdMintState, mintListItemId, mintListNumId, mintedListType, parseListNumId };
|
package/dist/write.cjs
CHANGED
|
@@ -34,7 +34,7 @@ function reportDroppedPackageTables(documentPackage, definitionsRendered, sink)
|
|
|
34
34
|
sink({
|
|
35
35
|
code: require_diagnostics_diagnostics.MarkdownDiagnosticCodes.PACKAGE_TABLE_DROPPED,
|
|
36
36
|
severity: "info",
|
|
37
|
-
message: `the package's own "${name}" table has no markdown representation;
|
|
37
|
+
message: `the package's own "${name}" table has no markdown representation; flattenTree's envelope carries forward only metadata and symbolTable, so "${name}" is dropped rather than rendered`
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -46,7 +46,7 @@ function writeMarkdown(documentPackage, options = {}) {
|
|
|
46
46
|
reportDroppedPackageTables(documentPackage, definitionsBlock !== void 0, sink);
|
|
47
47
|
let flattened;
|
|
48
48
|
try {
|
|
49
|
-
flattened = (0, document_schema_js.
|
|
49
|
+
flattened = (0, document_schema_js.flattenTree)(documentPackage);
|
|
50
50
|
} catch (error) {
|
|
51
51
|
throw new require_diagnostics_diagnostics.MarkdownPackageFlattenError(error);
|
|
52
52
|
}
|
package/dist/write.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WriteMarkdownOptions } from "./options/options.cjs";
|
|
2
|
-
import { ContentDocument,
|
|
2
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
3
3
|
//#region src/write.d.ts
|
|
4
|
-
declare function writeMarkdown(documentPackage:
|
|
4
|
+
declare function writeMarkdown(documentPackage: DocumentTree, options?: WriteMarkdownOptions): string;
|
|
5
5
|
declare function writeMarkdownContent(document: ContentDocument, options?: WriteMarkdownOptions): string;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { writeMarkdown, writeMarkdownContent };
|
package/dist/write.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WriteMarkdownOptions } from "./options/options.js";
|
|
2
|
-
import { ContentDocument,
|
|
2
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
3
3
|
//#region src/write.d.ts
|
|
4
|
-
declare function writeMarkdown(documentPackage:
|
|
4
|
+
declare function writeMarkdown(documentPackage: DocumentTree, options?: WriteMarkdownOptions): string;
|
|
5
5
|
declare function writeMarkdownContent(document: ContentDocument, options?: WriteMarkdownOptions): string;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { writeMarkdown, writeMarkdownContent };
|
package/dist/write.js
CHANGED
|
@@ -2,7 +2,7 @@ import { MarkdownDiagnosticCodes, MarkdownPackageFlattenError, MarkdownUnsupport
|
|
|
2
2
|
import { emitFrontMatter } from "./emit/front-matter.js";
|
|
3
3
|
import { escapeLinkDestination, renderLinkTitle } from "./emit/inline.js";
|
|
4
4
|
import { emitMarkdown } from "./emit/emit.js";
|
|
5
|
-
import {
|
|
5
|
+
import { flattenTree } from "document-schema.js";
|
|
6
6
|
//#region src/write.ts
|
|
7
7
|
function renderLinkDefinition(label, entry) {
|
|
8
8
|
const destination = entry.destination;
|
|
@@ -33,7 +33,7 @@ function reportDroppedPackageTables(documentPackage, definitionsRendered, sink)
|
|
|
33
33
|
sink({
|
|
34
34
|
code: MarkdownDiagnosticCodes.PACKAGE_TABLE_DROPPED,
|
|
35
35
|
severity: "info",
|
|
36
|
-
message: `the package's own "${name}" table has no markdown representation;
|
|
36
|
+
message: `the package's own "${name}" table has no markdown representation; flattenTree's envelope carries forward only metadata and symbolTable, so "${name}" is dropped rather than rendered`
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -45,7 +45,7 @@ function writeMarkdown(documentPackage, options = {}) {
|
|
|
45
45
|
reportDroppedPackageTables(documentPackage, definitionsBlock !== void 0, sink);
|
|
46
46
|
let flattened;
|
|
47
47
|
try {
|
|
48
|
-
flattened =
|
|
48
|
+
flattened = flattenTree(documentPackage);
|
|
49
49
|
} catch (error) {
|
|
50
50
|
throw new MarkdownPackageFlattenError(error);
|
|
51
51
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdown-codec",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Hand-written CommonMark+GFM <->
|
|
3
|
+
"version": "6.1.0",
|
|
4
|
+
"description": "Hand-written CommonMark+GFM <-> DocumentTree codec, built on document-schema.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -81,30 +81,21 @@
|
|
|
81
81
|
"license": "MIT",
|
|
82
82
|
"packageManager": "pnpm@11.6.0",
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"document-schema.js": "^
|
|
84
|
+
"document-schema.js": "^5.1.0",
|
|
85
85
|
"zod": "^4.4.3"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
89
89
|
"@cloudflare/vitest-pool-workers": "^0.21.2",
|
|
90
|
-
"@commitlint/cli": "^21.2.1",
|
|
91
|
-
"@commitlint/config-conventional": "^21.2.0",
|
|
92
|
-
"@eslint/js": "^10.0.1",
|
|
93
|
-
"@exadev/eslint-config": "^2.1.0",
|
|
94
|
-
"@semantic-release/changelog": "^7.0.0",
|
|
95
|
-
"@semantic-release/git": "^11.0.1",
|
|
96
90
|
"@types/node": "^26.1.1",
|
|
97
91
|
"@vitest/coverage-v8": "^4.1.10",
|
|
98
92
|
"eslint": "^10.8.0",
|
|
99
|
-
"globals": "^17.8.0",
|
|
100
93
|
"husky": "^9.1.7",
|
|
101
|
-
"lint-staged": "^17.2.0",
|
|
102
94
|
"publint": "^0.3.21",
|
|
103
95
|
"semantic-release": "^25.0.8",
|
|
104
96
|
"tsdown": "^0.22.13",
|
|
105
97
|
"turbo": "^2.10.8",
|
|
106
98
|
"typescript": "^6.0.3",
|
|
107
|
-
"typescript-eslint": "^8.65.0",
|
|
108
99
|
"vitest": "^4.1.10"
|
|
109
100
|
}
|
|
110
101
|
}
|