hdoc-tools 0.17.14 → 0.17.16

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
@@ -307,7 +307,7 @@
307
307
  let md_txt = hdoc.expand_variables(fs.readFileSync(file_path.path, 'utf8'));
308
308
 
309
309
  // Pull in external includes
310
- const includes_processed = await hdoc.process_includes(file_path.path, md_txt);
310
+ const includes_processed = await hdoc.process_includes(file_path.path, md_txt, global_source_path);
311
311
  md_txt = includes_processed.body.toString();
312
312
  includes_found += includes_processed.found;
313
313
  includes_success += includes_processed.success;
package/hdoc-module.js CHANGED
@@ -102,7 +102,7 @@
102
102
  };
103
103
 
104
104
 
105
- exports.process_includes = async function (file_path, body) {
105
+ exports.process_includes = async function (file_path, body, source_path) {
106
106
  let response = {
107
107
  body: '',
108
108
  found: 0,
@@ -171,7 +171,7 @@
171
171
  } else {
172
172
  // Local content to include
173
173
  try {
174
- file_content = fs.readFileSync(path.join(process.cwd(), link), 'utf8');
174
+ file_content = fs.readFileSync(path.join(source_path, link), 'utf8');
175
175
  } catch (e) {
176
176
  response.failed++;
177
177
  response.errors.push(`Error getting INCLUDE file [${link}] from [${file_path}]: ${e}`);
package/hdoc-serve.js CHANGED
@@ -14,10 +14,12 @@
14
14
  let docId;
15
15
  let hdocbook_config,
16
16
  hdocbook_project,
17
- inline_content = {};
17
+ inline_content = {},
18
+ global_source_path = '';
18
19
 
19
20
  exports.run = async function (ui_path, source_path) {
20
21
 
22
+ global_source_path = source_path;
21
23
  for (let x = 0; x < process.argv.length; x++) {
22
24
  // First two arguments are command, and script
23
25
  if (x == 0 || x == 1)
@@ -100,7 +102,7 @@
100
102
  let md_txt = hdoc.expand_variables(fs.readFileSync(file_path).toString(), docId);
101
103
 
102
104
  // Pull in external includes
103
- const includes_processed = await hdoc.process_includes(file_path, md_txt);
105
+ const includes_processed = await hdoc.process_includes(file_path, md_txt, global_source_path);
104
106
  md_txt = includes_processed.body;
105
107
  if (includes_processed.errors && includes_processed.errors.length > 0) {
106
108
  console.error(`Error(s) when processing includes in ${file_path}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.17.14",
3
+ "version": "0.17.16",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {
@@ -54,7 +54,7 @@
54
54
  "mime-types": "^2.1.35",
55
55
  "multer": "^1.4.5-lts.1",
56
56
  "prompt": "^1.3.0",
57
- "puppeteer": "^21.11.0",
57
+ "puppeteer": "^22.4.1",
58
58
  "retry": "^0.13.1",
59
59
  "stream": "0.0.2",
60
60
  "true-case-path": "^2.2.1",