hdoc-tools 0.41.2 → 0.41.3
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/hdoc-build.js +3 -1
- package/hdoc-serve.js +8 -1
- package/package.json +1 -1
package/hdoc-build.js
CHANGED
@@ -526,13 +526,15 @@
|
|
526
526
|
const tmpInput = tmp.fileSync({ postfix: ".mmd" });
|
527
527
|
const tmpOutput = tmp.fileSync({ postfix: ".svg" });
|
528
528
|
|
529
|
+
/*
|
529
530
|
if (!str.startsWith('---')) {
|
530
531
|
str = '---\n' + fs.readFileSync(mermaid_theme_path, {encoding: 'utf-8'}) + `\n---\n${str}`;
|
531
532
|
}
|
533
|
+
*/
|
532
534
|
|
533
535
|
fs.writeFileSync(tmpInput.name, str);
|
534
536
|
let cmd = `${__dirname}/node_modules/.bin/mmdc`;
|
535
|
-
|
537
|
+
|
536
538
|
if (process.platform === "win32") {
|
537
539
|
cmd = `"${cmd}"`;
|
538
540
|
}
|
package/hdoc-serve.js
CHANGED
@@ -137,13 +137,20 @@
|
|
137
137
|
const tmpInput = tmp.fileSync({ postfix: ".mmd" });
|
138
138
|
const tmpOutput = tmp.fileSync({ postfix: ".svg" });
|
139
139
|
|
140
|
+
/*
|
140
141
|
if (!str.startsWith('---')) {
|
141
142
|
str = '---\n' + fs.readFileSync(mermaid_theme_path, {encoding: 'utf-8'}) + `\n---\n${str}`;
|
142
143
|
}
|
144
|
+
*/
|
143
145
|
|
144
146
|
fs.writeFileSync(tmpInput.name, str);
|
145
147
|
|
146
|
-
|
148
|
+
let cmd = `${__dirname}/node_modules/.bin/mmdc`;
|
149
|
+
|
150
|
+
if (process.platform === "win32") {
|
151
|
+
cmd = `"${cmd}"`;
|
152
|
+
}
|
153
|
+
cmd = `${cmd} -i "${tmpInput.name}" -o "${tmpOutput.name}" --quiet --backgroundColor transparent`;
|
147
154
|
console.log(`Generating Inline Mermaid SVG found in: ${file_path}`);
|
148
155
|
execSync(cmd);
|
149
156
|
|