hdoc-tools 0.41.3 → 0.41.4

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 CHANGED
@@ -18,33 +18,41 @@
18
18
 
19
19
  const h_tags_to_search = ["h1", "h2", "h3"];
20
20
  const image_extensions = ["png", "svg", "jpg"];
21
- const doc_header_template_path = path.join(
21
+
22
+ const templates_path = path.join(
22
23
  __dirname,
23
- "templates",
24
+ "templates"
25
+ );
26
+ const doc_header_template_path = path.join(
27
+ templates_path,
24
28
  "doc-header.html",
25
29
  );
26
30
  const non_git_doc_header_template_path = path.join(
27
- __dirname,
28
- "templates",
31
+ templates_path,
29
32
  "doc-header-non-git.html",
30
33
  );
31
34
  const pdf_header_template_path = path.join(
32
- __dirname,
33
- "templates",
35
+ templates_path,
34
36
  "pdf-header.html",
35
37
  );
36
38
  const non_git_pdf_header_template_path = path.join(
37
- __dirname,
38
- "templates",
39
+ templates_path,
39
40
  "pdf-header-non-git.html",
40
41
  );
41
42
 
42
43
  const mermaid_theme_path = path.resolve(
43
- __dirname,
44
- "templates",
44
+ templates_path,
45
45
  "mermaid-theme.yaml",
46
46
  );
47
47
 
48
+ let mermaid_puppeteer_config_path = path.resolve(
49
+ templates_path,
50
+ "mermaid-puppeteer-config.json",
51
+ );
52
+ if (process.platform === "win32") {
53
+ mermaid_puppeteer_config_path = `"${mermaid_puppeteer_config_path}"`
54
+ }
55
+
48
56
  const pdf_template_path = path.join(__dirname, "templates", "pdf");
49
57
  const ui_css_path = path.join(__dirname, "ui", "css");
50
58
  const pdf_template_file_path = path.join(pdf_template_path, "template.html");
@@ -526,19 +534,17 @@
526
534
  const tmpInput = tmp.fileSync({ postfix: ".mmd" });
527
535
  const tmpOutput = tmp.fileSync({ postfix: ".svg" });
528
536
 
529
- /*
530
537
  if (!str.startsWith('---')) {
531
538
  str = '---\n' + fs.readFileSync(mermaid_theme_path, {encoding: 'utf-8'}) + `\n---\n${str}`;
532
539
  }
533
- */
534
540
 
535
541
  fs.writeFileSync(tmpInput.name, str);
536
542
  let cmd = `${__dirname}/node_modules/.bin/mmdc`;
537
543
 
538
544
  if (process.platform === "win32") {
539
- cmd = `"${cmd}"`;
545
+ cmd = `"${cmd}.cmd"`;
540
546
  }
541
- cmd = `${cmd} -i "${tmpInput.name}" -o "${tmpOutput.name}" --quiet --backgroundColor transparent`;
547
+ cmd = `${cmd} -i "${tmpInput.name}" -o "${tmpOutput.name}" --backgroundColor transparent --puppeteerConfigFile ${mermaid_puppeteer_config_path}`;
542
548
  console.log(`Generating Inline Mermaid SVG found in: ${file_path.relativePath}`);
543
549
  execSync(cmd);
544
550
 
package/hdoc-serve.js CHANGED
@@ -137,11 +137,9 @@
137
137
  const tmpInput = tmp.fileSync({ postfix: ".mmd" });
138
138
  const tmpOutput = tmp.fileSync({ postfix: ".svg" });
139
139
 
140
- /*
141
140
  if (!str.startsWith('---')) {
142
141
  str = '---\n' + fs.readFileSync(mermaid_theme_path, {encoding: 'utf-8'}) + `\n---\n${str}`;
143
142
  }
144
- */
145
143
 
146
144
  fs.writeFileSync(tmpInput.name, str);
147
145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.41.3",
3
+ "version": "0.41.4",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {
@@ -0,0 +1,6 @@
1
+ {
2
+ "args": [
3
+ "--no-sandbox",
4
+ "--disable-gpu"
5
+ ]
6
+ }