@illusions-lab/mdi 2.0.11 → 2.0.13
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 +19 -14
- package/dist/{chunk-FA5R33XH.js → chunk-BF7UFCZO.js} +10 -16
- package/dist/index.cjs +8 -26
- package/dist/index.d.cts +28 -18
- package/dist/index.d.ts +28 -18
- package/dist/index.js +1 -1
- package/dist/node.js +1 -1
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -62,11 +62,12 @@ unsupported version.
|
|
|
62
62
|
|
|
63
63
|
## Rendering
|
|
64
64
|
|
|
65
|
-
Rendering starts from the same Rust IR. Canonical MDI, plain text, HTML,
|
|
66
|
-
|
|
67
|
-
through this package. PDF uses Rust HTML
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
Rendering starts from the same Rust IR. Canonical MDI, plain text, HTML, EPUB,
|
|
66
|
+
and DOCX—including profile-configured EPUB and DOCX—execute in Rust and are
|
|
67
|
+
exposed through this package. PDF uses Rust-prepared HTML, print CSS, page
|
|
68
|
+
geometry, and header/footer data as input to a host such as
|
|
69
|
+
`@illusions-lab/mdi-to-pdf`. The host launches Chromium, but it never parses
|
|
70
|
+
MDI or decides publication settings.
|
|
70
71
|
|
|
71
72
|
Browser WebAssembly cannot start Chromium. Browser code sends Rust-rendered
|
|
72
73
|
HTML to a server or desktop host when it needs PDF output.
|
|
@@ -94,25 +95,28 @@ Rust-authoritative parser rather than accepting mutable JavaScript IR. This
|
|
|
94
95
|
keeps the source spans and error codes predictable and prevents JavaScript from
|
|
95
96
|
becoming a second syntax implementation.
|
|
96
97
|
|
|
97
|
-
Configuration ownership is deliberately
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
Configuration ownership is deliberately clear: Rust validates publication
|
|
99
|
+
profiles and applies EPUB/DOCX metadata, typography, page geometry, and
|
|
100
|
+
numbering. For PDF, Rust also prepares the print HTML and resolved page data;
|
|
101
|
+
the host owns only Chromium/Electron process control, printer integration, and
|
|
102
|
+
application UI preferences. This keeps layout behavior consistent without
|
|
103
|
+
putting application concerns into the parser.
|
|
102
104
|
|
|
103
105
|
### Configured EPUB and DOCX
|
|
104
106
|
|
|
105
107
|
For publication output, pass an export profile to the overloads (or use the
|
|
106
|
-
explicit `WithProfile` functions).
|
|
107
|
-
|
|
108
|
-
metadata, chapter splitting, vertical writing, font
|
|
109
|
-
margins, and page numbers. EPUB also accepts in-memory
|
|
108
|
+
explicit `WithProfile` functions). The Promise-shaped API is retained for
|
|
109
|
+
compatibility, while profile validation and archive generation both run in
|
|
110
|
+
Rust. It supports metadata, chapter splitting, vertical writing, font
|
|
111
|
+
selection, paper size, margins, and page numbers. EPUB also accepts in-memory
|
|
112
|
+
PNG or JPEG cover art.
|
|
110
113
|
|
|
111
114
|
```ts
|
|
112
115
|
import { renderDocxWithProfile, renderEpubWithProfile } from "@illusions-lab/mdi";
|
|
113
116
|
|
|
114
117
|
const epub = await renderEpubWithProfile(source, {
|
|
115
118
|
profile: {
|
|
119
|
+
layout: { system: "japanese-publisher" },
|
|
116
120
|
metadata: { title: "Book", author: "Author" },
|
|
117
121
|
typesetting: { writingMode: "vertical", fontFamily: "Noto Serif JP" },
|
|
118
122
|
epub: { chapterSplitLevel: "h1" },
|
|
@@ -121,6 +125,7 @@ const epub = await renderEpubWithProfile(source, {
|
|
|
121
125
|
});
|
|
122
126
|
|
|
123
127
|
const docx = await renderDocxWithProfile(source, {
|
|
128
|
+
layout: { system: "word" },
|
|
124
129
|
pagination: { pageSize: "A5", margins: { top: 12, bottom: 12, left: 14, right: 14 } },
|
|
125
130
|
});
|
|
126
131
|
```
|
|
@@ -3,7 +3,9 @@ import {
|
|
|
3
3
|
parseMdiSyntaxJson,
|
|
4
4
|
renderHtml as renderHtmlFromRust,
|
|
5
5
|
renderEpub as renderEpubFromRust,
|
|
6
|
+
renderEpubWithProfile as renderEpubWithProfileFromRust,
|
|
6
7
|
renderDocx as renderDocxFromRust,
|
|
8
|
+
renderDocxWithProfile as renderDocxWithProfileFromRust,
|
|
7
9
|
renderText as renderTextFromRust,
|
|
8
10
|
renderTextFormat as renderTextFormatFromRust,
|
|
9
11
|
serializeMdi as serializeMdiFromRust
|
|
@@ -61,30 +63,22 @@ function renderDocxWithDiagnostics(source, profile) {
|
|
|
61
63
|
async function renderEpubWithProfile(source, options = {}) {
|
|
62
64
|
assertSource(source);
|
|
63
65
|
assertEpubOptions(options);
|
|
64
|
-
const { mdiToEpub } = await import("@illusions-lab/mdi-to-epub");
|
|
65
66
|
const normalized = normalizeEpubOptions(options);
|
|
66
67
|
requireLayoutSystem(normalized.profile);
|
|
67
|
-
|
|
68
|
+
const cover = normalized.cover;
|
|
69
|
+
return renderEpubWithProfileFromRust(
|
|
70
|
+
source,
|
|
71
|
+
JSON.stringify(normalized.profile),
|
|
72
|
+
cover?.data ?? new Uint8Array(),
|
|
73
|
+
cover?.mediaType
|
|
74
|
+
);
|
|
68
75
|
}
|
|
69
76
|
async function renderDocxWithProfile(source, profile = {}) {
|
|
70
77
|
assertSource(source);
|
|
71
78
|
assertPlainObject(profile, "profile");
|
|
72
|
-
prepareNodeDocxImport();
|
|
73
|
-
const { mdiToDocx } = await import("@illusions-lab/mdi-to-docx");
|
|
74
79
|
const normalized = normalizeDocxProfile(profile);
|
|
75
80
|
requireLayoutSystem(normalized);
|
|
76
|
-
return
|
|
77
|
-
}
|
|
78
|
-
function prepareNodeDocxImport() {
|
|
79
|
-
const nodeProcess = globalThis.process;
|
|
80
|
-
if (nodeProcess?.release?.name === "node" && !nodeProcess.execArgv?.some((argument) => argument.startsWith("--localstorage-file="))) {
|
|
81
|
-
const descriptor = Object.getOwnPropertyDescriptor(globalThis, "localStorage");
|
|
82
|
-
if (descriptor?.configurable && descriptor.get)
|
|
83
|
-
Object.defineProperty(globalThis, "localStorage", {
|
|
84
|
-
value: void 0,
|
|
85
|
-
configurable: true
|
|
86
|
-
});
|
|
87
|
-
}
|
|
81
|
+
return renderDocxWithProfileFromRust(source, JSON.stringify(normalized));
|
|
88
82
|
}
|
|
89
83
|
function toPublicationMdast(document) {
|
|
90
84
|
const children = document.children.map(toPublicationMdastNode);
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/index.ts
|
|
@@ -103,30 +93,22 @@ function renderDocxWithDiagnostics(source, profile) {
|
|
|
103
93
|
async function renderEpubWithProfile(source, options = {}) {
|
|
104
94
|
assertSource(source);
|
|
105
95
|
assertEpubOptions(options);
|
|
106
|
-
const { mdiToEpub } = await import("@illusions-lab/mdi-to-epub");
|
|
107
96
|
const normalized = normalizeEpubOptions(options);
|
|
108
97
|
(0, import_mdi_export_profile.requireLayoutSystem)(normalized.profile);
|
|
109
|
-
|
|
98
|
+
const cover = normalized.cover;
|
|
99
|
+
return (0, import_mdi_core.renderEpubWithProfile)(
|
|
100
|
+
source,
|
|
101
|
+
JSON.stringify(normalized.profile),
|
|
102
|
+
cover?.data ?? new Uint8Array(),
|
|
103
|
+
cover?.mediaType
|
|
104
|
+
);
|
|
110
105
|
}
|
|
111
106
|
async function renderDocxWithProfile(source, profile = {}) {
|
|
112
107
|
assertSource(source);
|
|
113
108
|
assertPlainObject(profile, "profile");
|
|
114
|
-
prepareNodeDocxImport();
|
|
115
|
-
const { mdiToDocx } = await import("@illusions-lab/mdi-to-docx");
|
|
116
109
|
const normalized = normalizeDocxProfile(profile);
|
|
117
110
|
(0, import_mdi_export_profile.requireLayoutSystem)(normalized);
|
|
118
|
-
return
|
|
119
|
-
}
|
|
120
|
-
function prepareNodeDocxImport() {
|
|
121
|
-
const nodeProcess = globalThis.process;
|
|
122
|
-
if (nodeProcess?.release?.name === "node" && !nodeProcess.execArgv?.some((argument) => argument.startsWith("--localstorage-file="))) {
|
|
123
|
-
const descriptor = Object.getOwnPropertyDescriptor(globalThis, "localStorage");
|
|
124
|
-
if (descriptor?.configurable && descriptor.get)
|
|
125
|
-
Object.defineProperty(globalThis, "localStorage", {
|
|
126
|
-
value: void 0,
|
|
127
|
-
configurable: true
|
|
128
|
-
});
|
|
129
|
-
}
|
|
111
|
+
return (0, import_mdi_core.renderDocxWithProfile)(source, JSON.stringify(normalized));
|
|
130
112
|
}
|
|
131
113
|
function toPublicationMdast(document) {
|
|
132
114
|
const children = document.children.map(toPublicationMdastNode);
|
package/dist/index.d.cts
CHANGED
|
@@ -45,9 +45,9 @@ type MdiDocxExportProfile = ExportProfile & {
|
|
|
45
45
|
date?: string;
|
|
46
46
|
verticalWriting?: boolean;
|
|
47
47
|
fontFamily?: string;
|
|
48
|
-
/**
|
|
48
|
+
/** Body type size in typographic points. */
|
|
49
49
|
fontSize?: number;
|
|
50
|
-
/**
|
|
50
|
+
/** Baseline multiplier, for example 1.5 for one-and-a-half spacing. */
|
|
51
51
|
lineSpacing?: number;
|
|
52
52
|
textIndent?: number;
|
|
53
53
|
pageSize?: NonNullable<ExportProfile["pagination"]>["pageSize"];
|
|
@@ -113,6 +113,21 @@ interface MdiDocument {
|
|
|
113
113
|
frontmatter?: MdiFrontmatter;
|
|
114
114
|
children: MdiNode[];
|
|
115
115
|
}
|
|
116
|
+
/** Resolved front matter attached to mdast compatibility roots. */
|
|
117
|
+
interface MdiPublicationFrontmatter {
|
|
118
|
+
mdi: string;
|
|
119
|
+
title?: string;
|
|
120
|
+
author?: string;
|
|
121
|
+
lang: string;
|
|
122
|
+
date?: string;
|
|
123
|
+
writingMode: "horizontal" | "vertical";
|
|
124
|
+
pageProgression: "ltr" | "rtl";
|
|
125
|
+
}
|
|
126
|
+
interface MdiPublicationRoot extends Root {
|
|
127
|
+
data?: Root["data"] & {
|
|
128
|
+
frontmatter?: MdiPublicationFrontmatter;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
116
131
|
/** A source-backed heading available to host navigation and chapter UIs. */
|
|
117
132
|
interface MdiHeading {
|
|
118
133
|
depth: 1 | 2 | 3 | 4 | 5 | 6;
|
|
@@ -177,7 +192,7 @@ declare function prepareRender(source: string): MdiSyntaxParseResult;
|
|
|
177
192
|
declare function renderEpub(source: string): Uint8Array;
|
|
178
193
|
/**
|
|
179
194
|
* Build a profile-configured EPUB 3 archive. This overload is asynchronous
|
|
180
|
-
*
|
|
195
|
+
* for backward compatibility; validation and archive generation run in Rust.
|
|
181
196
|
*/
|
|
182
197
|
declare function renderEpub(source: string, options: MdiEpubExportOptions): Promise<Uint8Array>;
|
|
183
198
|
/** Build a baseline Rust EPUB while retaining diagnostics for an export UI. */
|
|
@@ -187,34 +202,29 @@ declare function renderEpubWithDiagnostics(source: string, options: MdiEpubExpor
|
|
|
187
202
|
declare function renderDocx(source: string): Uint8Array;
|
|
188
203
|
/**
|
|
189
204
|
* Build a profile-configured DOCX archive. This overload is asynchronous
|
|
190
|
-
*
|
|
205
|
+
* for backward compatibility; validation and OOXML generation run in Rust.
|
|
191
206
|
*/
|
|
192
207
|
declare function renderDocx(source: string, profile: MdiDocxExportProfile): Promise<Uint8Array>;
|
|
193
208
|
/** Build a baseline Rust DOCX while retaining diagnostics for an export UI. */
|
|
194
209
|
declare function renderDocxWithDiagnostics(source: string): MdiRenderResult<Uint8Array>;
|
|
195
210
|
declare function renderDocxWithDiagnostics(source: string, profile: MdiDocxExportProfile): Promise<MdiRenderResult<Uint8Array>>;
|
|
196
211
|
/**
|
|
197
|
-
* Build a configured EPUB
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* writing.
|
|
212
|
+
* Build a configured EPUB in Rust. Unlike the one-argument
|
|
213
|
+
* {@link renderEpub}, this returns a Promise for API compatibility and
|
|
214
|
+
* supports cover art, metadata, chapters and vertical writing.
|
|
201
215
|
*/
|
|
202
216
|
declare function renderEpubWithProfile(source: string, options?: MdiEpubExportOptions): Promise<Uint8Array>;
|
|
203
217
|
/**
|
|
204
|
-
* Build a configured DOCX using the shared print profile.
|
|
218
|
+
* Build a configured DOCX in Rust using the shared print profile. The profile
|
|
205
219
|
* supports metadata, writing mode, paper size, margins and page numbers.
|
|
206
220
|
*/
|
|
207
221
|
declare function renderDocxWithProfile(source: string, profile?: MdiDocxExportProfile): Promise<Uint8Array>;
|
|
208
222
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*/
|
|
213
|
-
/**
|
|
214
|
-
* Convert a Rust-owned MDI document IR into mdast for publication adapters.
|
|
215
|
-
* This performs no parsing and preserves the adapter node conventions.
|
|
223
|
+
* Convert a Rust-owned MDI document IR into mdast for unified compatibility
|
|
224
|
+
* workflows. This performs no parsing and preserves the established mdast
|
|
225
|
+
* node conventions.
|
|
216
226
|
*/
|
|
217
|
-
declare function toPublicationMdast(document: MdiDocument):
|
|
227
|
+
declare function toPublicationMdast(document: MdiDocument): MdiPublicationRoot;
|
|
218
228
|
/** Parse and normalize complete `.mdi` source with Rust's serializer. */
|
|
219
229
|
declare function serializeMdi(source: string): string;
|
|
220
230
|
/** Render complete `.mdi` source to deterministic plain text in Rust. */
|
|
@@ -229,4 +239,4 @@ declare function renderTextFormatWithDiagnostics(source: string, format: MdiText
|
|
|
229
239
|
/** @deprecated Use {@link parse}; it now parses the complete document. */
|
|
230
240
|
declare const parseMdiSyntax: typeof parse;
|
|
231
241
|
|
|
232
|
-
export { MDI_IR_VERSION, MDI_SPEC_VERSION, type MdiDiagnostic, type MdiDocument, type MdiDocxExportProfile, type MdiEpubExportOptions, type MdiFrontmatter, type MdiHeading, type MdiHtmlRenderOptions, type MdiNode, type MdiParserCapabilities, type MdiRenderResult, type MdiRubyReading, type MdiSourceSpan, type MdiSyntaxDocument, type MdiSyntaxParseResult, type MdiTextFormat, parse, parseMdiSyntax, prepareRender, renderDocx, renderDocxWithDiagnostics, renderDocxWithProfile, renderEpub, renderEpubWithDiagnostics, renderEpubWithProfile, renderHtml, renderHtmlWithDiagnostics, renderText, renderTextFormat, renderTextFormatWithDiagnostics, renderTextWithDiagnostics, serializeMdi, toPublicationMdast };
|
|
242
|
+
export { MDI_IR_VERSION, MDI_SPEC_VERSION, type MdiDiagnostic, type MdiDocument, type MdiDocxExportProfile, type MdiEpubExportOptions, type MdiFrontmatter, type MdiHeading, type MdiHtmlRenderOptions, type MdiNode, type MdiParserCapabilities, type MdiPublicationFrontmatter, type MdiPublicationRoot, type MdiRenderResult, type MdiRubyReading, type MdiSourceSpan, type MdiSyntaxDocument, type MdiSyntaxParseResult, type MdiTextFormat, parse, parseMdiSyntax, prepareRender, renderDocx, renderDocxWithDiagnostics, renderDocxWithProfile, renderEpub, renderEpubWithDiagnostics, renderEpubWithProfile, renderHtml, renderHtmlWithDiagnostics, renderText, renderTextFormat, renderTextFormatWithDiagnostics, renderTextWithDiagnostics, serializeMdi, toPublicationMdast };
|
package/dist/index.d.ts
CHANGED
|
@@ -45,9 +45,9 @@ type MdiDocxExportProfile = ExportProfile & {
|
|
|
45
45
|
date?: string;
|
|
46
46
|
verticalWriting?: boolean;
|
|
47
47
|
fontFamily?: string;
|
|
48
|
-
/**
|
|
48
|
+
/** Body type size in typographic points. */
|
|
49
49
|
fontSize?: number;
|
|
50
|
-
/**
|
|
50
|
+
/** Baseline multiplier, for example 1.5 for one-and-a-half spacing. */
|
|
51
51
|
lineSpacing?: number;
|
|
52
52
|
textIndent?: number;
|
|
53
53
|
pageSize?: NonNullable<ExportProfile["pagination"]>["pageSize"];
|
|
@@ -113,6 +113,21 @@ interface MdiDocument {
|
|
|
113
113
|
frontmatter?: MdiFrontmatter;
|
|
114
114
|
children: MdiNode[];
|
|
115
115
|
}
|
|
116
|
+
/** Resolved front matter attached to mdast compatibility roots. */
|
|
117
|
+
interface MdiPublicationFrontmatter {
|
|
118
|
+
mdi: string;
|
|
119
|
+
title?: string;
|
|
120
|
+
author?: string;
|
|
121
|
+
lang: string;
|
|
122
|
+
date?: string;
|
|
123
|
+
writingMode: "horizontal" | "vertical";
|
|
124
|
+
pageProgression: "ltr" | "rtl";
|
|
125
|
+
}
|
|
126
|
+
interface MdiPublicationRoot extends Root {
|
|
127
|
+
data?: Root["data"] & {
|
|
128
|
+
frontmatter?: MdiPublicationFrontmatter;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
116
131
|
/** A source-backed heading available to host navigation and chapter UIs. */
|
|
117
132
|
interface MdiHeading {
|
|
118
133
|
depth: 1 | 2 | 3 | 4 | 5 | 6;
|
|
@@ -177,7 +192,7 @@ declare function prepareRender(source: string): MdiSyntaxParseResult;
|
|
|
177
192
|
declare function renderEpub(source: string): Uint8Array;
|
|
178
193
|
/**
|
|
179
194
|
* Build a profile-configured EPUB 3 archive. This overload is asynchronous
|
|
180
|
-
*
|
|
195
|
+
* for backward compatibility; validation and archive generation run in Rust.
|
|
181
196
|
*/
|
|
182
197
|
declare function renderEpub(source: string, options: MdiEpubExportOptions): Promise<Uint8Array>;
|
|
183
198
|
/** Build a baseline Rust EPUB while retaining diagnostics for an export UI. */
|
|
@@ -187,34 +202,29 @@ declare function renderEpubWithDiagnostics(source: string, options: MdiEpubExpor
|
|
|
187
202
|
declare function renderDocx(source: string): Uint8Array;
|
|
188
203
|
/**
|
|
189
204
|
* Build a profile-configured DOCX archive. This overload is asynchronous
|
|
190
|
-
*
|
|
205
|
+
* for backward compatibility; validation and OOXML generation run in Rust.
|
|
191
206
|
*/
|
|
192
207
|
declare function renderDocx(source: string, profile: MdiDocxExportProfile): Promise<Uint8Array>;
|
|
193
208
|
/** Build a baseline Rust DOCX while retaining diagnostics for an export UI. */
|
|
194
209
|
declare function renderDocxWithDiagnostics(source: string): MdiRenderResult<Uint8Array>;
|
|
195
210
|
declare function renderDocxWithDiagnostics(source: string, profile: MdiDocxExportProfile): Promise<MdiRenderResult<Uint8Array>>;
|
|
196
211
|
/**
|
|
197
|
-
* Build a configured EPUB
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* writing.
|
|
212
|
+
* Build a configured EPUB in Rust. Unlike the one-argument
|
|
213
|
+
* {@link renderEpub}, this returns a Promise for API compatibility and
|
|
214
|
+
* supports cover art, metadata, chapters and vertical writing.
|
|
201
215
|
*/
|
|
202
216
|
declare function renderEpubWithProfile(source: string, options?: MdiEpubExportOptions): Promise<Uint8Array>;
|
|
203
217
|
/**
|
|
204
|
-
* Build a configured DOCX using the shared print profile.
|
|
218
|
+
* Build a configured DOCX in Rust using the shared print profile. The profile
|
|
205
219
|
* supports metadata, writing mode, paper size, margins and page numbers.
|
|
206
220
|
*/
|
|
207
221
|
declare function renderDocxWithProfile(source: string, profile?: MdiDocxExportProfile): Promise<Uint8Array>;
|
|
208
222
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*/
|
|
213
|
-
/**
|
|
214
|
-
* Convert a Rust-owned MDI document IR into mdast for publication adapters.
|
|
215
|
-
* This performs no parsing and preserves the adapter node conventions.
|
|
223
|
+
* Convert a Rust-owned MDI document IR into mdast for unified compatibility
|
|
224
|
+
* workflows. This performs no parsing and preserves the established mdast
|
|
225
|
+
* node conventions.
|
|
216
226
|
*/
|
|
217
|
-
declare function toPublicationMdast(document: MdiDocument):
|
|
227
|
+
declare function toPublicationMdast(document: MdiDocument): MdiPublicationRoot;
|
|
218
228
|
/** Parse and normalize complete `.mdi` source with Rust's serializer. */
|
|
219
229
|
declare function serializeMdi(source: string): string;
|
|
220
230
|
/** Render complete `.mdi` source to deterministic plain text in Rust. */
|
|
@@ -229,4 +239,4 @@ declare function renderTextFormatWithDiagnostics(source: string, format: MdiText
|
|
|
229
239
|
/** @deprecated Use {@link parse}; it now parses the complete document. */
|
|
230
240
|
declare const parseMdiSyntax: typeof parse;
|
|
231
241
|
|
|
232
|
-
export { MDI_IR_VERSION, MDI_SPEC_VERSION, type MdiDiagnostic, type MdiDocument, type MdiDocxExportProfile, type MdiEpubExportOptions, type MdiFrontmatter, type MdiHeading, type MdiHtmlRenderOptions, type MdiNode, type MdiParserCapabilities, type MdiRenderResult, type MdiRubyReading, type MdiSourceSpan, type MdiSyntaxDocument, type MdiSyntaxParseResult, type MdiTextFormat, parse, parseMdiSyntax, prepareRender, renderDocx, renderDocxWithDiagnostics, renderDocxWithProfile, renderEpub, renderEpubWithDiagnostics, renderEpubWithProfile, renderHtml, renderHtmlWithDiagnostics, renderText, renderTextFormat, renderTextFormatWithDiagnostics, renderTextWithDiagnostics, serializeMdi, toPublicationMdast };
|
|
242
|
+
export { MDI_IR_VERSION, MDI_SPEC_VERSION, type MdiDiagnostic, type MdiDocument, type MdiDocxExportProfile, type MdiEpubExportOptions, type MdiFrontmatter, type MdiHeading, type MdiHtmlRenderOptions, type MdiNode, type MdiParserCapabilities, type MdiPublicationFrontmatter, type MdiPublicationRoot, type MdiRenderResult, type MdiRubyReading, type MdiSourceSpan, type MdiSyntaxDocument, type MdiSyntaxParseResult, type MdiTextFormat, parse, parseMdiSyntax, prepareRender, renderDocx, renderDocxWithDiagnostics, renderDocxWithProfile, renderEpub, renderEpubWithDiagnostics, renderEpubWithProfile, renderHtml, renderHtmlWithDiagnostics, renderText, renderTextFormat, renderTextFormatWithDiagnostics, renderTextWithDiagnostics, serializeMdi, toPublicationMdast };
|
package/dist/index.js
CHANGED
package/dist/node.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@illusions-lab/mdi",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "Thin JavaScript binding for the Rust-authoritative MDI parser",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,10 +32,9 @@
|
|
|
32
32
|
"typecheck": "tsc --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@illusions-lab/mdi-core": "^2.0.
|
|
36
|
-
"@illusions-lab/mdi-export-profile": "^2.0.
|
|
37
|
-
"@illusions-lab/mdi-to-
|
|
38
|
-
"@illusions-lab/mdi-to-epub": "^2.0.18",
|
|
35
|
+
"@illusions-lab/mdi-core": "^2.0.13",
|
|
36
|
+
"@illusions-lab/mdi-export-profile": "^2.0.18",
|
|
37
|
+
"@illusions-lab/mdi-to-epub": "^2.0.28",
|
|
39
38
|
"@types/mdast": "^4.0.0",
|
|
40
39
|
"yaml": "^2.0.0"
|
|
41
40
|
},
|