remark-docx 0.3.8 → 0.3.9
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
CHANGED
|
@@ -26,8 +26,8 @@ Currently, some of the default styles may not be nice. If you have feature reque
|
|
|
26
26
|
- [x] inlineCode
|
|
27
27
|
- [x] break
|
|
28
28
|
- [x] link / linkReference
|
|
29
|
-
- [x] image / imageReference ([remark-docx/plugins/image](#image) is required)
|
|
30
29
|
- [x] footnote / footnoteReference / footnoteDefinition
|
|
30
|
+
- [x] image / imageReference ([remark-docx/plugins/image](#image) is required)
|
|
31
31
|
- [x] html ([remark-docx/plugins/html](#html) is required)
|
|
32
32
|
- [x] code ([remark-docx/plugins/code](#code) is required)
|
|
33
33
|
- [x] math / inlineMath ([remark-math](https://github.com/remarkjs/remark-math) and [remark-docx/plugins/math](#math) are required)
|
|
@@ -4,6 +4,23 @@ var docx = require('docx');
|
|
|
4
4
|
var shiki = require('shiki');
|
|
5
5
|
var unistUtilVisit = require('unist-util-visit');
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Format to 6 disit hex
|
|
9
|
+
*/
|
|
10
|
+
const formatHex = (str) => {
|
|
11
|
+
// #RGB
|
|
12
|
+
if (str.length === 4) {
|
|
13
|
+
const r = str[1];
|
|
14
|
+
const g = str[2];
|
|
15
|
+
const b = str[3];
|
|
16
|
+
return str[0] + r + r + g + g + b + b;
|
|
17
|
+
}
|
|
18
|
+
// #RRGGBBAA
|
|
19
|
+
if (str.length === 9) {
|
|
20
|
+
return str.slice(0, 7);
|
|
21
|
+
}
|
|
22
|
+
return str;
|
|
23
|
+
};
|
|
7
24
|
/**
|
|
8
25
|
* A plugin to render "code" nodes, with syntax highlighting powered by shiki.
|
|
9
26
|
*/
|
|
@@ -38,17 +55,30 @@ const shikiPlugin = ({ theme, }) => {
|
|
|
38
55
|
lang: lang,
|
|
39
56
|
theme,
|
|
40
57
|
});
|
|
58
|
+
let { bg, fg } = res;
|
|
59
|
+
if (fg) {
|
|
60
|
+
fg = formatHex(fg);
|
|
61
|
+
}
|
|
62
|
+
if (bg) {
|
|
63
|
+
bg = formatHex(bg);
|
|
64
|
+
}
|
|
41
65
|
return res.tokens.map((r) => {
|
|
42
66
|
return new docx.Paragraph({
|
|
43
67
|
shading: {
|
|
44
68
|
type: "clear",
|
|
45
69
|
color: "auto",
|
|
46
|
-
fill:
|
|
70
|
+
fill: bg,
|
|
47
71
|
},
|
|
48
72
|
children: r.map(({ content, bgColor, color, fontStyle }) => {
|
|
73
|
+
if (color) {
|
|
74
|
+
color = formatHex(color);
|
|
75
|
+
}
|
|
76
|
+
if (bgColor) {
|
|
77
|
+
bgColor = formatHex(bgColor);
|
|
78
|
+
}
|
|
49
79
|
return new docx.TextRun({
|
|
50
80
|
text: content,
|
|
51
|
-
color: color !== null && color !== void 0 ? color :
|
|
81
|
+
color: color !== null && color !== void 0 ? color : fg,
|
|
52
82
|
shading: bgColor
|
|
53
83
|
? {
|
|
54
84
|
type: "clear",
|
|
@@ -59,7 +89,7 @@ const shikiPlugin = ({ theme, }) => {
|
|
|
59
89
|
bold: fontStyle === 2,
|
|
60
90
|
italics: fontStyle === 1,
|
|
61
91
|
underline: fontStyle === 4
|
|
62
|
-
? { type: "single", color:
|
|
92
|
+
? { type: "single", color: fg }
|
|
63
93
|
: undefined,
|
|
64
94
|
strike: fontStyle === 8,
|
|
65
95
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/plugins/code/index.ts"],"sourcesContent":["import { Paragraph, TextRun } from \"docx\";\nimport type { RemarkDocxPlugin } from \"../../types\";\nimport {\n createHighlighter,\n type BundledLanguage,\n type BundledTheme,\n} from \"shiki\";\nimport { visit } from \"unist-util-visit\";\nimport type { FontStyle } from \"shiki/textmate\";\n\nexport interface ShikiPluginOptions {\n /**\n * https://shiki.style/themes\n */\n theme: BundledTheme;\n}\n\n/**\n * A plugin to render \"code\" nodes, with syntax highlighting powered by shiki.\n */\nexport const shikiPlugin = ({\n theme,\n}: ShikiPluginOptions): RemarkDocxPlugin => {\n let highlighter: Awaited<ReturnType<typeof createHighlighter>> | undefined;\n const langs = new Set<string>();\n\n return async ({ root }) => {\n const newLangs: string[] = [];\n\n visit(root, \"code\", ({ lang }) => {\n if (lang) {\n if (!langs.has(lang)) {\n langs.add(lang);\n newLangs.push(lang);\n }\n }\n });\n\n if (!highlighter) {\n highlighter = await createHighlighter({\n themes: [theme],\n langs: [...langs],\n });\n } else {\n await Promise.all(\n newLangs.map((l) => highlighter!.loadLanguage(l as BundledLanguage)),\n );\n }\n\n return {\n code: ({ value, lang }) => {\n if (!lang) {\n return null;\n }\n const res = highlighter!.codeToTokens(value, {\n lang: lang as BundledLanguage,\n theme,\n });\n\n return res.tokens.map((r) => {\n return new Paragraph({\n shading: {\n type: \"clear\",\n color: \"auto\",\n fill:
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/plugins/code/index.ts"],"sourcesContent":["import { Paragraph, TextRun } from \"docx\";\nimport type { RemarkDocxPlugin } from \"../../types\";\nimport {\n createHighlighter,\n type BundledLanguage,\n type BundledTheme,\n} from \"shiki\";\nimport { visit } from \"unist-util-visit\";\nimport type { FontStyle } from \"shiki/textmate\";\n\n/**\n * Format to 6 disit hex\n */\nconst formatHex = (str: string): string => {\n // #RGB\n if (str.length === 4) {\n const r = str[1]!;\n const g = str[2]!;\n const b = str[3]!;\n return str[0]! + r + r + g + g + b + b;\n }\n // #RRGGBBAA\n if (str.length === 9) {\n return str.slice(0, 7);\n }\n return str;\n};\n\nexport interface ShikiPluginOptions {\n /**\n * https://shiki.style/themes\n */\n theme: BundledTheme;\n}\n\n/**\n * A plugin to render \"code\" nodes, with syntax highlighting powered by shiki.\n */\nexport const shikiPlugin = ({\n theme,\n}: ShikiPluginOptions): RemarkDocxPlugin => {\n let highlighter: Awaited<ReturnType<typeof createHighlighter>> | undefined;\n const langs = new Set<string>();\n\n return async ({ root }) => {\n const newLangs: string[] = [];\n\n visit(root, \"code\", ({ lang }) => {\n if (lang) {\n if (!langs.has(lang)) {\n langs.add(lang);\n newLangs.push(lang);\n }\n }\n });\n\n if (!highlighter) {\n highlighter = await createHighlighter({\n themes: [theme],\n langs: [...langs],\n });\n } else {\n await Promise.all(\n newLangs.map((l) => highlighter!.loadLanguage(l as BundledLanguage)),\n );\n }\n\n return {\n code: ({ value, lang }) => {\n if (!lang) {\n return null;\n }\n const res = highlighter!.codeToTokens(value, {\n lang: lang as BundledLanguage,\n theme,\n });\n let { bg, fg } = res;\n if (fg) {\n fg = formatHex(fg);\n }\n if (bg) {\n bg = formatHex(bg);\n }\n\n return res.tokens.map((r) => {\n return new Paragraph({\n shading: {\n type: \"clear\",\n color: \"auto\",\n fill: bg,\n },\n children: r.map(({ content, bgColor, color, fontStyle }) => {\n if (color) {\n color = formatHex(color);\n }\n if (bgColor) {\n bgColor = formatHex(bgColor);\n }\n return new TextRun({\n text: content,\n color: color ?? fg,\n shading: bgColor\n ? {\n type: \"clear\",\n color: \"auto\",\n fill: bgColor,\n }\n : undefined,\n bold: fontStyle === (2 satisfies FontStyle.Bold),\n italics: fontStyle === (1 satisfies FontStyle.Italic),\n underline:\n fontStyle === (4 satisfies FontStyle.Underline)\n ? { type: \"single\", color: fg }\n : undefined,\n strike: fontStyle === (8 satisfies FontStyle.Strikethrough),\n });\n }),\n });\n });\n },\n };\n };\n};\n"],"names":["visit","createHighlighter","Paragraph","TextRun"],"mappings":";;;;;;AAUA;;AAEG;AACH,MAAM,SAAS,GAAG,CAAC,GAAW,KAAY;;AAExC,IAAA,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;AACpB,QAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAE;AACjB,QAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAE;AACjB,QAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAE;AACjB,QAAA,OAAO,GAAG,CAAC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AAS,KAAM;sCACX,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;AAC7B,sCAAE,SAAS;gCACf,MAAM,EAAE,SAAS,KAAM,CAAoC;AAC5D,6BAAA,CAAC;AACJ,wBAAA,CAAC,CAAC;AACH,qBAAA,CAAC;AACJ,gBAAA,CAAC,CAAC;YACJ,CAAC;SACF;AACH,IAAA,CAAC;AACH;;;;"}
|
|
@@ -2,6 +2,23 @@ import { Paragraph, TextRun } from 'docx';
|
|
|
2
2
|
import { createHighlighter } from 'shiki';
|
|
3
3
|
import { visit } from 'unist-util-visit';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Format to 6 disit hex
|
|
7
|
+
*/
|
|
8
|
+
const formatHex = (str) => {
|
|
9
|
+
// #RGB
|
|
10
|
+
if (str.length === 4) {
|
|
11
|
+
const r = str[1];
|
|
12
|
+
const g = str[2];
|
|
13
|
+
const b = str[3];
|
|
14
|
+
return str[0] + r + r + g + g + b + b;
|
|
15
|
+
}
|
|
16
|
+
// #RRGGBBAA
|
|
17
|
+
if (str.length === 9) {
|
|
18
|
+
return str.slice(0, 7);
|
|
19
|
+
}
|
|
20
|
+
return str;
|
|
21
|
+
};
|
|
5
22
|
/**
|
|
6
23
|
* A plugin to render "code" nodes, with syntax highlighting powered by shiki.
|
|
7
24
|
*/
|
|
@@ -36,17 +53,30 @@ const shikiPlugin = ({ theme, }) => {
|
|
|
36
53
|
lang: lang,
|
|
37
54
|
theme,
|
|
38
55
|
});
|
|
56
|
+
let { bg, fg } = res;
|
|
57
|
+
if (fg) {
|
|
58
|
+
fg = formatHex(fg);
|
|
59
|
+
}
|
|
60
|
+
if (bg) {
|
|
61
|
+
bg = formatHex(bg);
|
|
62
|
+
}
|
|
39
63
|
return res.tokens.map((r) => {
|
|
40
64
|
return new Paragraph({
|
|
41
65
|
shading: {
|
|
42
66
|
type: "clear",
|
|
43
67
|
color: "auto",
|
|
44
|
-
fill:
|
|
68
|
+
fill: bg,
|
|
45
69
|
},
|
|
46
70
|
children: r.map(({ content, bgColor, color, fontStyle }) => {
|
|
71
|
+
if (color) {
|
|
72
|
+
color = formatHex(color);
|
|
73
|
+
}
|
|
74
|
+
if (bgColor) {
|
|
75
|
+
bgColor = formatHex(bgColor);
|
|
76
|
+
}
|
|
47
77
|
return new TextRun({
|
|
48
78
|
text: content,
|
|
49
|
-
color: color !== null && color !== void 0 ? color :
|
|
79
|
+
color: color !== null && color !== void 0 ? color : fg,
|
|
50
80
|
shading: bgColor
|
|
51
81
|
? {
|
|
52
82
|
type: "clear",
|
|
@@ -57,7 +87,7 @@ const shikiPlugin = ({ theme, }) => {
|
|
|
57
87
|
bold: fontStyle === 2,
|
|
58
88
|
italics: fontStyle === 1,
|
|
59
89
|
underline: fontStyle === 4
|
|
60
|
-
? { type: "single", color:
|
|
90
|
+
? { type: "single", color: fg }
|
|
61
91
|
: undefined,
|
|
62
92
|
strike: fontStyle === 8,
|
|
63
93
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/plugins/code/index.ts"],"sourcesContent":["import { Paragraph, TextRun } from \"docx\";\nimport type { RemarkDocxPlugin } from \"../../types\";\nimport {\n createHighlighter,\n type BundledLanguage,\n type BundledTheme,\n} from \"shiki\";\nimport { visit } from \"unist-util-visit\";\nimport type { FontStyle } from \"shiki/textmate\";\n\nexport interface ShikiPluginOptions {\n /**\n * https://shiki.style/themes\n */\n theme: BundledTheme;\n}\n\n/**\n * A plugin to render \"code\" nodes, with syntax highlighting powered by shiki.\n */\nexport const shikiPlugin = ({\n theme,\n}: ShikiPluginOptions): RemarkDocxPlugin => {\n let highlighter: Awaited<ReturnType<typeof createHighlighter>> | undefined;\n const langs = new Set<string>();\n\n return async ({ root }) => {\n const newLangs: string[] = [];\n\n visit(root, \"code\", ({ lang }) => {\n if (lang) {\n if (!langs.has(lang)) {\n langs.add(lang);\n newLangs.push(lang);\n }\n }\n });\n\n if (!highlighter) {\n highlighter = await createHighlighter({\n themes: [theme],\n langs: [...langs],\n });\n } else {\n await Promise.all(\n newLangs.map((l) => highlighter!.loadLanguage(l as BundledLanguage)),\n );\n }\n\n return {\n code: ({ value, lang }) => {\n if (!lang) {\n return null;\n }\n const res = highlighter!.codeToTokens(value, {\n lang: lang as BundledLanguage,\n theme,\n });\n\n return res.tokens.map((r) => {\n return new Paragraph({\n shading: {\n type: \"clear\",\n color: \"auto\",\n fill:
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/plugins/code/index.ts"],"sourcesContent":["import { Paragraph, TextRun } from \"docx\";\nimport type { RemarkDocxPlugin } from \"../../types\";\nimport {\n createHighlighter,\n type BundledLanguage,\n type BundledTheme,\n} from \"shiki\";\nimport { visit } from \"unist-util-visit\";\nimport type { FontStyle } from \"shiki/textmate\";\n\n/**\n * Format to 6 disit hex\n */\nconst formatHex = (str: string): string => {\n // #RGB\n if (str.length === 4) {\n const r = str[1]!;\n const g = str[2]!;\n const b = str[3]!;\n return str[0]! + r + r + g + g + b + b;\n }\n // #RRGGBBAA\n if (str.length === 9) {\n return str.slice(0, 7);\n }\n return str;\n};\n\nexport interface ShikiPluginOptions {\n /**\n * https://shiki.style/themes\n */\n theme: BundledTheme;\n}\n\n/**\n * A plugin to render \"code\" nodes, with syntax highlighting powered by shiki.\n */\nexport const shikiPlugin = ({\n theme,\n}: ShikiPluginOptions): RemarkDocxPlugin => {\n let highlighter: Awaited<ReturnType<typeof createHighlighter>> | undefined;\n const langs = new Set<string>();\n\n return async ({ root }) => {\n const newLangs: string[] = [];\n\n visit(root, \"code\", ({ lang }) => {\n if (lang) {\n if (!langs.has(lang)) {\n langs.add(lang);\n newLangs.push(lang);\n }\n }\n });\n\n if (!highlighter) {\n highlighter = await createHighlighter({\n themes: [theme],\n langs: [...langs],\n });\n } else {\n await Promise.all(\n newLangs.map((l) => highlighter!.loadLanguage(l as BundledLanguage)),\n );\n }\n\n return {\n code: ({ value, lang }) => {\n if (!lang) {\n return null;\n }\n const res = highlighter!.codeToTokens(value, {\n lang: lang as BundledLanguage,\n theme,\n });\n let { bg, fg } = res;\n if (fg) {\n fg = formatHex(fg);\n }\n if (bg) {\n bg = formatHex(bg);\n }\n\n return res.tokens.map((r) => {\n return new Paragraph({\n shading: {\n type: \"clear\",\n color: \"auto\",\n fill: bg,\n },\n children: r.map(({ content, bgColor, color, fontStyle }) => {\n if (color) {\n color = formatHex(color);\n }\n if (bgColor) {\n bgColor = formatHex(bgColor);\n }\n return new TextRun({\n text: content,\n color: color ?? fg,\n shading: bgColor\n ? {\n type: \"clear\",\n color: \"auto\",\n fill: bgColor,\n }\n : undefined,\n bold: fontStyle === (2 satisfies FontStyle.Bold),\n italics: fontStyle === (1 satisfies FontStyle.Italic),\n underline:\n fontStyle === (4 satisfies FontStyle.Underline)\n ? { type: \"single\", color: fg }\n : undefined,\n strike: fontStyle === (8 satisfies FontStyle.Strikethrough),\n });\n }),\n });\n });\n },\n };\n };\n};\n"],"names":[],"mappings":";;;;AAUA;;AAEG;AACH,MAAM,SAAS,GAAG,CAAC,GAAW,KAAY;;AAExC,IAAA,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;AACpB,QAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAE;AACjB,QAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAE;AACjB,QAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAE;AACjB,QAAA,OAAO,GAAG,CAAC,CAAC,CAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;IACxC;;AAEA,IAAA,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;IACxB;AACA,IAAA,OAAO,GAAG;AACZ,CAAC;AASD;;AAEG;MACU,WAAW,GAAG,CAAC,EAC1B,KAAK,GACc,KAAsB;AACzC,IA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