@illusions-lab/mdi-to-docx 2.0.18 → 2.0.20
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 +29 -6
- package/package.json +45 -45
package/README.md
CHANGED
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
# @illusions-lab/mdi-to-docx
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This package remains available for applications that need its existing
|
|
6
|
-
profile-aware mdast integration surface.
|
|
3
|
+
Creates a DOCX file from an MDI-flavoured mdast tree. It is a profile-aware
|
|
4
|
+
compatibility adapter for unified applications and does not parse MDI source.
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
## Install
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
```sh
|
|
9
|
+
npm install @illusions-lab/mdi-to-docx
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { writeFile } from "node:fs/promises";
|
|
16
|
+
import { mdiToDocx } from "@illusions-lab/mdi-to-docx";
|
|
17
|
+
|
|
18
|
+
const document = await mdiToDocx(mdastTree, {
|
|
19
|
+
typesetting: { writingMode: "vertical", fontFamily: "Noto Serif JP" },
|
|
20
|
+
});
|
|
21
|
+
await writeFile("book.docx", document);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
For complete `.mdi` source, use `renderDocx(source)` from
|
|
25
|
+
[`@illusions-lab/mdi`](https://www.npmjs.com/package/@illusions-lab/mdi).
|
|
26
|
+
The MDI CLI uses that Rust route directly.
|
|
27
|
+
|
|
28
|
+
## Documentation
|
|
29
|
+
|
|
30
|
+
- [Output model](https://mdi.illusions.app/ecosystem/outputs/)
|
|
31
|
+
- [Export-profile guide](https://mdi.illusions.app/guides/export-profiles/)
|
|
32
|
+
- [API reference](https://mdi.illusions.app/api/to-docx/)
|
|
33
|
+
- [JavaScript documentation](https://mdi.illusions.app/bindings/javascript/)
|
package/package.json
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
2
|
+
"name": "@illusions-lab/mdi-to-docx",
|
|
3
|
+
"version": "2.0.20",
|
|
4
|
+
"description": "Render MDI (.mdi) documents to DOCX",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/illusions-lab/MDI.git",
|
|
9
|
+
"directory": "nodejs/packages/to-docx"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://mdi.illusions.app/bindings/javascript/",
|
|
12
|
+
"bugs": "https://github.com/illusions-lab/MDI/issues",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
27
|
+
"test": "vitest run --passWithNoTests",
|
|
28
|
+
"typecheck": "tsc --noEmit"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@illusions-lab/mdi-export-profile": "workspace:*",
|
|
32
|
+
"mdast-util-mdi": "workspace:*",
|
|
33
|
+
"docx": "^9.0.0",
|
|
34
|
+
"@types/mdast": "^4.0.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@illusions-lab/mdi-remark": "workspace:*",
|
|
38
|
+
"remark-parse": "^11.0.0",
|
|
39
|
+
"unified": "^11.0.0",
|
|
40
|
+
"jszip": "^3.10.0",
|
|
41
|
+
"tsup": "^8.3.0",
|
|
42
|
+
"typescript": "^5.6.0",
|
|
43
|
+
"vitest": "^2.1.0",
|
|
44
|
+
"@types/node": "^20.0.0"
|
|
45
|
+
}
|
|
46
|
+
}
|