remark-docx 0.0.5 → 0.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 +33 -4
- package/lib/index.js +445 -192
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +445 -192
- package/lib/index.mjs.map +1 -0
- package/lib/latex.d.ts +2 -0
- package/lib/transformer.d.ts +4 -4
- package/lib/utils.d.ts +2 -0
- package/package.json +30 -23
package/README.md
CHANGED
|
@@ -2,14 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
  
|
|
4
4
|
|
|
5
|
-
[remark](https://github.com/remarkjs/remark) plugin to compile markdown to docx.
|
|
5
|
+
[remark](https://github.com/remarkjs/remark) plugin to compile markdown to docx (Microsoft Word, Office Open XML).
|
|
6
6
|
|
|
7
7
|
### 🚧 WIP 🚧
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
This project is aiming to support all nodes in [mdast](https://github.com/syntax-tree/mdast) syntax tree, but currently transformation and stylings may not be well.
|
|
10
10
|
|
|
11
11
|
If you have some feature requests or improvements, please create a [issue](https://github.com/inokawa/remark-docx/issues) or [PR](https://github.com/inokawa/remark-docx/pulls).
|
|
12
12
|
|
|
13
|
+
- [x] paragraph
|
|
14
|
+
- [x] heading
|
|
15
|
+
- [x] thematicBreak
|
|
16
|
+
- [ ] blockquote
|
|
17
|
+
- [x] list
|
|
18
|
+
- [x] listItem
|
|
19
|
+
- [x] table
|
|
20
|
+
- [x] tableRow
|
|
21
|
+
- [x] tableCell
|
|
22
|
+
- [ ] html
|
|
23
|
+
- [ ] code
|
|
24
|
+
- [ ] yaml
|
|
25
|
+
- [ ] toml
|
|
26
|
+
- [ ] definition
|
|
27
|
+
- [ ] footnoteDefinition
|
|
28
|
+
- [x] text
|
|
29
|
+
- [x] emphasis
|
|
30
|
+
- [x] strong
|
|
31
|
+
- [x] delete
|
|
32
|
+
- [ ] inlineCode
|
|
33
|
+
- [x] break
|
|
34
|
+
- [x] link
|
|
35
|
+
- [x] image
|
|
36
|
+
- [ ] linkReference
|
|
37
|
+
- [ ] imageReference
|
|
38
|
+
- [ ] footnote
|
|
39
|
+
- [ ] footnoteReference
|
|
40
|
+
- [x] Latex support with math and inlineMath ([remark-math](https://www.npmjs.com/package/remark-math) is required)
|
|
41
|
+
|
|
13
42
|
## Demo
|
|
14
43
|
|
|
15
44
|
https://inokawa.github.io/remark-docx/
|
|
@@ -64,7 +93,7 @@ const text = "# hello world";
|
|
|
64
93
|
|
|
65
94
|
| Key | Default | Type | Description |
|
|
66
95
|
| -------------- | --------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
67
|
-
| output | "buffer" | `"buffer"` `"blob"`
|
|
96
|
+
| output | "buffer" | `"buffer"` `"blob"` | Set output type of `VFile.result`. `buffer` is `Promise<Buffer>`. `blob` is `Promise<Blob>`. |
|
|
68
97
|
| imageResolver | undefined | ImageResolver? | **You must set** if your markdown includes images. See example for [browser](https://github.com/inokawa/remark-docx/blob/main/stories/playground.stories.tsx) and [Node.js](https://github.com/inokawa/remark-docx/blob/main/src/index.spec.ts). |
|
|
69
98
|
| title | undefined | string? | |
|
|
70
99
|
| subject | undefined | string? | |
|
|
@@ -72,6 +101,6 @@ const text = "# hello world";
|
|
|
72
101
|
| keywords | undefined | string? | |
|
|
73
102
|
| description | undefined | string? | |
|
|
74
103
|
| lastModifiedBy | undefined | string? | |
|
|
75
|
-
| revision | undefined |
|
|
104
|
+
| revision | undefined | number? | |
|
|
76
105
|
| styles | undefined | IStylesOptions? | |
|
|
77
106
|
| background | undefined | IDocumentBackgroundOptions? | |
|