hdoc-tools 0.17.32 → 0.17.33
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-db.js +4 -4
- package/hdoc-build-pdf.js +7 -7
- package/hdoc-build.js +32 -32
- package/hdoc-bump.js +18 -18
- package/hdoc-create.js +6 -6
- package/hdoc-init.js +3 -3
- package/hdoc-module.js +1 -1
- package/hdoc-validate.js +6 -6
- package/hdoc-ver.js +5 -5
- package/package.json +1 -1
- package/ui/js/doc.hornbill.js +0 -1
package/hdoc-build-db.js
CHANGED
@@ -69,7 +69,7 @@
|
|
69
69
|
const fts5 = key === 'hdoc_index' ? true : false;
|
70
70
|
const table_created_error = this.create_table(response.db, key, db_schema[key], virtual, fts5);
|
71
71
|
if (table_created_error !== null) {
|
72
|
-
console.
|
72
|
+
console.error(table_created_error);
|
73
73
|
}
|
74
74
|
}
|
75
75
|
}
|
@@ -140,7 +140,7 @@
|
|
140
140
|
index_response = hdoc_index.insert_record(db, 'hdoc_index', db_schema.hdoc_index, index_vals);
|
141
141
|
}
|
142
142
|
if (!index_response.success) {
|
143
|
-
console.
|
143
|
+
console.error(`Index record creation failed - ${doc_id}/${file.index_html.fm_props.title}: ${index_response.error}`);
|
144
144
|
} else {
|
145
145
|
// Now add metadata
|
146
146
|
const meta_vals = [
|
@@ -153,7 +153,7 @@
|
|
153
153
|
];
|
154
154
|
const meta_response = await hdoc_index.insert_record(db, 'hdoc_meta', db_schema.hdoc_meta, meta_vals);
|
155
155
|
if (!meta_response.success) {
|
156
|
-
console.
|
156
|
+
console.error(`Index metadata record creation failed - ${doc_id}/${index_response.row_id}/${file.index_html.fm_props.title}: ${meta_response.error}`);
|
157
157
|
} else {
|
158
158
|
if (verbose) {
|
159
159
|
console.log(`Inserted index record ${index_response.row_id}: ${doc_id} - ${file.index_html.fm_props.title}`);
|
@@ -172,7 +172,7 @@
|
|
172
172
|
];
|
173
173
|
const cont_response = await hdoc_index.insert_record(db, 'hdoc_contributors', db_schema.hdoc_contributors, contrib_vals);
|
174
174
|
if (!cont_response.success) {
|
175
|
-
console.
|
175
|
+
console.error(`Index document contributor record creation failed - ${doc_id}/${index_response.row_id}/${file.index_html.fm_props.title}: ${cont_response.error}`);
|
176
176
|
continue;
|
177
177
|
}
|
178
178
|
if (verbose) {
|
package/hdoc-build-pdf.js
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
try {
|
18
18
|
footer_content = fs.readFileSync(path.join(template_path, 'template-footer.html'), 'utf8');
|
19
19
|
} catch (err) {
|
20
|
-
console.
|
20
|
+
console.error(`Error loading template: ${err}`);
|
21
21
|
}
|
22
22
|
return footer_content;
|
23
23
|
};
|
@@ -27,7 +27,7 @@
|
|
27
27
|
try {
|
28
28
|
header_content = fs.readFileSync(path.join(template_path, 'template-header.html'), 'utf8');
|
29
29
|
} catch (err) {
|
30
|
-
console.
|
30
|
+
console.error(`Error loading template: ${err}`);
|
31
31
|
}
|
32
32
|
return header_content;
|
33
33
|
};
|
@@ -73,7 +73,7 @@
|
|
73
73
|
image_b64 = `data:${mime_type};base64,${image_b64}`;
|
74
74
|
html_source = html_source.replace(imgs[i], image_b64);
|
75
75
|
} catch (err) {
|
76
|
-
console.
|
76
|
+
console.error('Error reading image from HTML source [', image_path, '] -', err);
|
77
77
|
return null;
|
78
78
|
}
|
79
79
|
} else {
|
@@ -90,7 +90,7 @@
|
|
90
90
|
throw `Unexpected Status ${file_response.status}`;
|
91
91
|
}
|
92
92
|
} catch (err) {
|
93
|
-
console.
|
93
|
+
console.error(`Error downloading external source [${imgs[i]}] - ${err}`);
|
94
94
|
}
|
95
95
|
}
|
96
96
|
}
|
@@ -112,7 +112,7 @@
|
|
112
112
|
hb_logo = hb_logo_file_buffer.toString("base64");
|
113
113
|
hb_logo = `data:image/svg+xml;base64,${hb_logo}`;
|
114
114
|
} catch (err) {
|
115
|
-
console.
|
115
|
+
console.error('Error reading logo from template:', err);
|
116
116
|
return pdf_size;
|
117
117
|
}
|
118
118
|
}
|
@@ -139,7 +139,7 @@
|
|
139
139
|
content: css_templates[i]
|
140
140
|
});
|
141
141
|
} catch (e) {
|
142
|
-
console.
|
142
|
+
console.error(`Error applying template for [${target_file}]: ${e}`);
|
143
143
|
}
|
144
144
|
}
|
145
145
|
|
@@ -165,7 +165,7 @@
|
|
165
165
|
|
166
166
|
pdf_size = pdf_gen.byteLength;
|
167
167
|
} catch (err) {
|
168
|
-
console.
|
168
|
+
console.error(`Error generating PDF ${target_file} - ${err}`);
|
169
169
|
}
|
170
170
|
await page.close();
|
171
171
|
return pdf_size;
|
package/hdoc-build.js
CHANGED
@@ -184,7 +184,7 @@
|
|
184
184
|
doc_title = html_heading[0].children[0].data;
|
185
185
|
} else {
|
186
186
|
// No header tag, no frontmatter title, output a warning
|
187
|
-
console.
|
187
|
+
console.info(
|
188
188
|
`[WARNING] No frontmatter title property, or ${h_tags_to_search.join(
|
189
189
|
", "
|
190
190
|
)} tags detected in ${file_path.path}`
|
@@ -262,7 +262,7 @@
|
|
262
262
|
file_path.name !== "article_ext.md"
|
263
263
|
) {
|
264
264
|
// No header tag, no frontmatter title, output a warning
|
265
|
-
console.
|
265
|
+
console.info(
|
266
266
|
`[WARNING] No frontmatter title property, or ${h_tags_to_search.join(
|
267
267
|
", "
|
268
268
|
)} tags detected in ${file_path.path}`
|
@@ -327,7 +327,7 @@
|
|
327
327
|
);
|
328
328
|
|
329
329
|
if (!contributors.success) {
|
330
|
-
console.
|
330
|
+
console.error(
|
331
331
|
`Error retrieving contributors from Github: ${contributors.error}`
|
332
332
|
);
|
333
333
|
} else {
|
@@ -473,7 +473,7 @@
|
|
473
473
|
try {
|
474
474
|
fs.writeFileSync(file_path.path, html_txt);
|
475
475
|
} catch (err) {
|
476
|
-
console.
|
476
|
+
console.error("Error writing:", target_file, "\n", err);
|
477
477
|
}
|
478
478
|
}
|
479
479
|
};
|
@@ -612,7 +612,7 @@
|
|
612
612
|
file_path.name !== "article_ext.md"
|
613
613
|
) {
|
614
614
|
// No header tag, no frontmatter title, output a warning
|
615
|
-
console.
|
615
|
+
console.info(
|
616
616
|
`[WARNING] No frontmatter title property, or h1, h2 or h3 header tags detected in ${file_path.path}`
|
617
617
|
);
|
618
618
|
}
|
@@ -674,7 +674,7 @@
|
|
674
674
|
);
|
675
675
|
|
676
676
|
if (!contributors.success) {
|
677
|
-
console.
|
677
|
+
console.error(
|
678
678
|
`Error retrieving contributors from Github: ${contributors.error}`
|
679
679
|
);
|
680
680
|
} else {
|
@@ -706,7 +706,7 @@
|
|
706
706
|
JSON.stringify(contributors, null, 2)
|
707
707
|
);
|
708
708
|
} catch (err) {
|
709
|
-
console.
|
709
|
+
console.error("Error writing:", target_file, "\n", err);
|
710
710
|
}
|
711
711
|
}
|
712
712
|
fm_headers.push({
|
@@ -816,7 +816,7 @@
|
|
816
816
|
try {
|
817
817
|
fs.writeFileSync(target_file, html_txt);
|
818
818
|
} catch (err) {
|
819
|
-
console.
|
819
|
+
console.error("Error writing:", target_file, "\n", err);
|
820
820
|
}
|
821
821
|
|
822
822
|
if (
|
@@ -859,7 +859,7 @@
|
|
859
859
|
try {
|
860
860
|
json_tidy = JSON.stringify(JSON.parse(json_tidy), null, 2);
|
861
861
|
} catch (e) {
|
862
|
-
console.
|
862
|
+
console.info(
|
863
863
|
`[WARNING] Could not tidy JSON in file [${file}]: ${e}`
|
864
864
|
);
|
865
865
|
}
|
@@ -886,7 +886,7 @@
|
|
886
886
|
lineSeparator: "\n",
|
887
887
|
});
|
888
888
|
} catch (e) {
|
889
|
-
console.
|
889
|
+
console.info(`[WARNING] Could not tidy XML in file [${file}]: ${e}`);
|
890
890
|
}
|
891
891
|
markdown = markdown.replace(
|
892
892
|
xml_to_tidy[i],
|
@@ -980,7 +980,7 @@
|
|
980
980
|
}
|
981
981
|
} else {
|
982
982
|
if (verbose) {
|
983
|
-
console.
|
983
|
+
console.info(
|
984
984
|
`[WARNING] Path is not present in navigation items: ${logical_path}`
|
985
985
|
);
|
986
986
|
}
|
@@ -1098,8 +1098,8 @@
|
|
1098
1098
|
try {
|
1099
1099
|
hdocbook_project = require(hdocbook_project_config_path);
|
1100
1100
|
} catch (e) {
|
1101
|
-
console.
|
1102
|
-
console.
|
1101
|
+
console.error("File not found: hdocbook-project.json\n");
|
1102
|
+
console.error(
|
1103
1103
|
"hdoc build/validate needs to be run in the root of a HDoc Book.\n"
|
1104
1104
|
);
|
1105
1105
|
process.exit(1);
|
@@ -1139,14 +1139,14 @@
|
|
1139
1139
|
if (build_version.match(regex_version)) {
|
1140
1140
|
hdocbook_config.version = build_version;
|
1141
1141
|
} else {
|
1142
|
-
console.
|
1142
|
+
console.info(
|
1143
1143
|
`\n[WARNING] Argument build version [${build_version}] does not match expected pattern, defaulting to version specified in book [${hdocbook_config.version}]\n`
|
1144
1144
|
);
|
1145
1145
|
}
|
1146
1146
|
}
|
1147
1147
|
|
1148
1148
|
if (!hdocbook_config.version.match(regex_version)) {
|
1149
|
-
console.
|
1149
|
+
console.error(
|
1150
1150
|
`ERROR: Version number does not match required format - ${hdocbook_config.version}\n`
|
1151
1151
|
);
|
1152
1152
|
process.exit(1);
|
@@ -1164,7 +1164,7 @@
|
|
1164
1164
|
console.log(`Loading product families...`);
|
1165
1165
|
const prods = await hdoc.load_product_families();
|
1166
1166
|
if (!prods.success) {
|
1167
|
-
console.
|
1167
|
+
console.error(`${prods.errors}\n`);
|
1168
1168
|
process.exit(1);
|
1169
1169
|
} else {
|
1170
1170
|
prod_families = prods.prod_families;
|
@@ -1182,7 +1182,7 @@
|
|
1182
1182
|
try {
|
1183
1183
|
css_templates.push(fs.readFileSync(css_files[i], "utf8"));
|
1184
1184
|
} catch (e) {
|
1185
|
-
console.
|
1185
|
+
console.error(`Error reading file[${css_files[i]}]: ${e}`);
|
1186
1186
|
}
|
1187
1187
|
}
|
1188
1188
|
}
|
@@ -1194,8 +1194,8 @@
|
|
1194
1194
|
console.log("\r\n-----------------------");
|
1195
1195
|
console.log(" Validation Output ");
|
1196
1196
|
console.log("-----------------------");
|
1197
|
-
console.
|
1198
|
-
console.
|
1197
|
+
console.error(`${errors_filename.length} files do not meet filename requirements:`);
|
1198
|
+
console.error(` - ${errors_filename.join("\n - ")}`);
|
1199
1199
|
console.log()
|
1200
1200
|
process.exit(1);
|
1201
1201
|
}
|
@@ -1235,7 +1235,7 @@
|
|
1235
1235
|
built_file_hashes[i].path + ":" + built_file_hashes[i].hash + "|";
|
1236
1236
|
}
|
1237
1237
|
if (concat_hash === "|") {
|
1238
|
-
console.
|
1238
|
+
console.error("No hash of content has been returned.");
|
1239
1239
|
process.exit(1);
|
1240
1240
|
}
|
1241
1241
|
|
@@ -1246,7 +1246,7 @@
|
|
1246
1246
|
fs.writeFileSync(checksum_path, hash);
|
1247
1247
|
console.log("Hash file creation success:", checksum_path);
|
1248
1248
|
} catch (e) {
|
1249
|
-
console.
|
1249
|
+
console.error("\nError creating", checksum_path, ":", e);
|
1250
1250
|
process.exit(1);
|
1251
1251
|
}
|
1252
1252
|
|
@@ -1264,7 +1264,7 @@
|
|
1264
1264
|
"utf8"
|
1265
1265
|
);
|
1266
1266
|
} catch (err) {
|
1267
|
-
console.
|
1267
|
+
console.error(`Error reading document header template: ${err}`);
|
1268
1268
|
process.exit(1);
|
1269
1269
|
}
|
1270
1270
|
|
@@ -1273,7 +1273,7 @@
|
|
1273
1273
|
try {
|
1274
1274
|
pdf_template = fs.readFileSync(pdf_template_file_path, "utf8");
|
1275
1275
|
} catch (err) {
|
1276
|
-
console.
|
1276
|
+
console.error(`Error reading PDF template: ${err}`);
|
1277
1277
|
process.exit(1);
|
1278
1278
|
}
|
1279
1279
|
}
|
@@ -1286,7 +1286,7 @@
|
|
1286
1286
|
console.log(
|
1287
1287
|
`\n${bc_build.errors.length} errors found when processing navigation:\n`
|
1288
1288
|
);
|
1289
|
-
console.
|
1289
|
+
console.error(` - ${bc_build.errors.join("\n\n - ")}`);
|
1290
1290
|
console.log("\n");
|
1291
1291
|
process.exit(1);
|
1292
1292
|
}
|
@@ -1338,10 +1338,10 @@
|
|
1338
1338
|
// Output to console
|
1339
1339
|
console.log(`\n MD files found: ${conversion_attempted}`);
|
1340
1340
|
console.log(`Successfully converted to HTML: ${conversion_success}`);
|
1341
|
-
console.
|
1341
|
+
console.error(` Failed to convert: ${conversion_failed}\n`);
|
1342
1342
|
console.log(` Includes Found: ${includes_found}`);
|
1343
1343
|
console.log(` Includes Success: ${includes_success}`);
|
1344
|
-
console.
|
1344
|
+
console.error(` Includes Failed: ${includes_failed}\n`);
|
1345
1345
|
console.log(
|
1346
1346
|
` Static HTML Files Found: ${static_html_files.length}\n`
|
1347
1347
|
);
|
@@ -1378,7 +1378,7 @@
|
|
1378
1378
|
await Promise.all(
|
1379
1379
|
filePromiseArray.map(async (file) => {
|
1380
1380
|
fs.unlink(file, (err) => {
|
1381
|
-
if (err) console.
|
1381
|
+
if (err) console.error(`Error deleting ${file}: ${e}`);
|
1382
1382
|
});
|
1383
1383
|
})
|
1384
1384
|
);
|
@@ -1397,7 +1397,7 @@
|
|
1397
1397
|
);
|
1398
1398
|
console.log("\nhdocbook.json update success:", work_hdocbook_path);
|
1399
1399
|
} catch (e) {
|
1400
|
-
console.
|
1400
|
+
console.error("\nError creating", work_hdocbook_path, ":", e);
|
1401
1401
|
process.exit(1);
|
1402
1402
|
}
|
1403
1403
|
|
@@ -1406,7 +1406,7 @@
|
|
1406
1406
|
console.log(`Building the Index`);
|
1407
1407
|
let db = hdoc_build_db.create_db(work_path, doc_id);
|
1408
1408
|
if (db.error && db.error !== null) {
|
1409
|
-
console.
|
1409
|
+
console.error(db.error);
|
1410
1410
|
process.exit(1);
|
1411
1411
|
}
|
1412
1412
|
// Populate primary index tables
|
@@ -1418,7 +1418,7 @@
|
|
1418
1418
|
verbose
|
1419
1419
|
);
|
1420
1420
|
if (!index.success) {
|
1421
|
-
console.
|
1421
|
+
console.error(index.error);
|
1422
1422
|
process.exit(1);
|
1423
1423
|
}
|
1424
1424
|
|
@@ -1435,7 +1435,7 @@
|
|
1435
1435
|
);
|
1436
1436
|
if (!redirects_index.success) {
|
1437
1437
|
for (let i = 0; i < index.errors.length; i++) {
|
1438
|
-
console.
|
1438
|
+
console.error(index.errors[i]);
|
1439
1439
|
}
|
1440
1440
|
process.exit(1);
|
1441
1441
|
}
|
@@ -1461,7 +1461,7 @@
|
|
1461
1461
|
console.log(" Build Started:", build_start_dt);
|
1462
1462
|
console.log(`Build Completed: ${new Date().toLocaleString()}\n`);
|
1463
1463
|
} catch (e) {
|
1464
|
-
console.
|
1464
|
+
console.error("\nError creating ZIP: " + e);
|
1465
1465
|
}
|
1466
1466
|
} else {
|
1467
1467
|
console.log("\nValidation Complete\n");
|
package/hdoc-bump.js
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
exports.run = function (source_path, bump_type) {
|
8
8
|
if (bump_type !== 'patch' && bump_type !== 'minor' && bump_type !== 'major') {
|
9
|
-
console.
|
9
|
+
console.error(`Unsupported bump type: ${bump_type}`);
|
10
10
|
process.exit(1);
|
11
11
|
}
|
12
12
|
console.log(`Bumping ${bump_type} book version...\n`);
|
@@ -17,9 +17,9 @@
|
|
17
17
|
try {
|
18
18
|
hdocbook_project = require(hdocbook_project_config_path);
|
19
19
|
} catch (e) {
|
20
|
-
console.
|
21
|
-
console.
|
22
|
-
console.
|
20
|
+
console.error('File not found: hdocbook-project.json:');
|
21
|
+
console.error(e, '\n');
|
22
|
+
console.error('hdoc bump needs to be run in the root of a HDoc Book.\n');
|
23
23
|
process.exit(1);
|
24
24
|
}
|
25
25
|
const doc_id = hdocbook_project.docId;
|
@@ -31,28 +31,28 @@
|
|
31
31
|
try {
|
32
32
|
hdocbook_config = require(hdocbook_path);
|
33
33
|
} catch (e) {
|
34
|
-
console.
|
35
|
-
console.
|
36
|
-
console.
|
34
|
+
console.error('File not found: hdocbook.json');
|
35
|
+
console.error(e, '\n');
|
36
|
+
console.error('hdoc bump needs to be run in the root of a HDoc Book.\n');
|
37
37
|
process.exit(1);
|
38
38
|
}
|
39
39
|
const initial_version = hdocbook_config.version;
|
40
40
|
let hdocbook_version = hdocbook_config.version.split('.');
|
41
41
|
if (hdocbook_version.length !== 3) {
|
42
|
-
console.
|
42
|
+
console.error(`Book version does not appear to be in a semantic versioning format: ${initial_version}`);
|
43
43
|
process.exit(1);
|
44
44
|
}
|
45
45
|
|
46
46
|
if (isNaN(hdocbook_version[0])) {
|
47
|
-
console.
|
47
|
+
console.error(`Existing major version is not a number: ${hdocbook_version[0]}`);
|
48
48
|
process.exit(1);
|
49
49
|
}
|
50
50
|
if (isNaN(hdocbook_version[1])) {
|
51
|
-
console.
|
51
|
+
console.error(`Existing minor version is not a number: ${hdocbook_version[1]}`);
|
52
52
|
process.exit(1);
|
53
53
|
}
|
54
54
|
if (isNaN(hdocbook_version[2])) {
|
55
|
-
console.
|
55
|
+
console.error(`Existing patch version is not a number: ${hdocbook_version[2]}`);
|
56
56
|
process.exit(1);
|
57
57
|
}
|
58
58
|
|
@@ -63,8 +63,8 @@
|
|
63
63
|
hdocbook_version[1] = 0;
|
64
64
|
hdocbook_version[2] = 0;
|
65
65
|
} catch (e) {
|
66
|
-
console.
|
67
|
-
console.
|
66
|
+
console.error('Failed to update major version:');
|
67
|
+
console.error(e);
|
68
68
|
process.exit(1);
|
69
69
|
}
|
70
70
|
break;
|
@@ -74,8 +74,8 @@
|
|
74
74
|
hdocbook_version[1] = parseInt(hdocbook_version[1], 10) + 1;
|
75
75
|
hdocbook_version[2] = 0;
|
76
76
|
} catch (e) {
|
77
|
-
console.
|
78
|
-
console.
|
77
|
+
console.error('Failed to update minor version:');
|
78
|
+
console.error(e);
|
79
79
|
process.exit(1);
|
80
80
|
}
|
81
81
|
break;
|
@@ -86,8 +86,8 @@
|
|
86
86
|
hdocbook_version[1] = parseInt(hdocbook_version[1], 10);
|
87
87
|
hdocbook_version[2] = parseInt(hdocbook_version[2], 10) + 1;
|
88
88
|
} catch (e) {
|
89
|
-
console.
|
90
|
-
console.
|
89
|
+
console.error('Failed to update patch version:');
|
90
|
+
console.error(e);
|
91
91
|
process.exit(1);
|
92
92
|
}
|
93
93
|
break;
|
@@ -98,7 +98,7 @@
|
|
98
98
|
try {
|
99
99
|
fs.writeFileSync(hdocbook_path, JSON.stringify(hdocbook_config, null, 2));
|
100
100
|
} catch (e) {
|
101
|
-
console.
|
101
|
+
console.error('Error writing bumped version to book config:', e);
|
102
102
|
process.exit(1);
|
103
103
|
}
|
104
104
|
|
package/hdoc-create.js
CHANGED
@@ -22,8 +22,8 @@
|
|
22
22
|
try {
|
23
23
|
hdocbook_project = require(hdocbook_project_config_path);
|
24
24
|
} catch (e) {
|
25
|
-
console.
|
26
|
-
console.
|
25
|
+
console.error(`File not found: ${hdocbook_project_config_path}\n`);
|
26
|
+
console.error('hdoc create needs to be run in the root of a HDoc Book.\n');
|
27
27
|
process.exit(1);
|
28
28
|
}
|
29
29
|
doc_id = hdocbook_project.docId;
|
@@ -35,8 +35,8 @@
|
|
35
35
|
try {
|
36
36
|
hdocbook = require(hdocbook_path);
|
37
37
|
} catch (e) {
|
38
|
-
console.
|
39
|
-
console.
|
38
|
+
console.error(`File not found: ${hdocbook_path}\n`);
|
39
|
+
console.error('hdoc create needs to be run in the root of a HDoc Book.\n');
|
40
40
|
process.exit(1);
|
41
41
|
}
|
42
42
|
|
@@ -73,7 +73,7 @@
|
|
73
73
|
console.log('Folder created:', folder);
|
74
74
|
folder_count++;
|
75
75
|
} catch {
|
76
|
-
console.
|
76
|
+
console.error('\nError creating folder', folder, ':', e);
|
77
77
|
return;
|
78
78
|
}
|
79
79
|
}
|
@@ -87,7 +87,7 @@
|
|
87
87
|
processed_links[doc_info.link] = true;
|
88
88
|
file_count++;
|
89
89
|
} catch (e) {
|
90
|
-
console.
|
90
|
+
console.error('\nError creating file', doc_info.path, ':', e);
|
91
91
|
}
|
92
92
|
}
|
93
93
|
}
|
package/hdoc-init.js
CHANGED
@@ -75,7 +75,7 @@
|
|
75
75
|
const hdocBookProjectFile = require(hdocBookProjectFilePath);
|
76
76
|
hdocBookProjectFile.docId = docProps.id;
|
77
77
|
fs.writeFile(hdocBookProjectFilePath, JSON.stringify(hdocBookProjectFile, null, 2), function writeJSON(err) {
|
78
|
-
if (err) return console.
|
78
|
+
if (err) return console.error('Error updating:', hdocBookProjectFilePath, '\r\n', err);
|
79
79
|
console.log('Updated:', hdocBookProjectFilePath);
|
80
80
|
});
|
81
81
|
|
@@ -92,7 +92,7 @@
|
|
92
92
|
"link": docProps.id + '/index'
|
93
93
|
}];
|
94
94
|
fs.writeFile(hdocBookFilePath, JSON.stringify(hdocbookFile, null, 2), function writeJSON(err) {
|
95
|
-
if (err) return console.
|
95
|
+
if (err) return console.error('Error updating:', hdocBookFilePath, '\r\n', err);
|
96
96
|
console.log('Updated:', hdocBookFilePath);
|
97
97
|
});
|
98
98
|
|
@@ -105,7 +105,7 @@
|
|
105
105
|
hdocbookFile.version = docProps.version;
|
106
106
|
hdocbookFile.author = docProps.author;
|
107
107
|
fs.writeFile(packageFilePath, JSON.stringify(packageFile, null, 2), function writeJSON(err) {
|
108
|
-
if (err) return console.
|
108
|
+
if (err) return console.error('Error updating:', packageFilePath, '\r\n', err);
|
109
109
|
console.log('Updated:', packageFilePath);
|
110
110
|
});
|
111
111
|
|
package/hdoc-module.js
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
},
|
26
26
|
onRetry: (retryCount, error, requestConfig) => {
|
27
27
|
retried = true;
|
28
|
-
console.
|
28
|
+
console.info(`\n[WARNING] API call failed - ${error.message}\nEndpoint: ${requestConfig.url}\nRetrying: ${retryCount}`);
|
29
29
|
},
|
30
30
|
});
|
31
31
|
|
package/hdoc-validate.js
CHANGED
@@ -601,9 +601,9 @@
|
|
601
601
|
console.log(' Validation Output ');
|
602
602
|
console.log('-----------------------');
|
603
603
|
for (let i = 0; i < meta_errors.length; i++) {
|
604
|
-
console.
|
604
|
+
console.error(`- ${meta_errors[i]}`);
|
605
605
|
}
|
606
|
-
console.
|
606
|
+
console.error(`\r\n${meta_errors.length} Validation Errors Found`);
|
607
607
|
return false;
|
608
608
|
}
|
609
609
|
|
@@ -694,18 +694,18 @@
|
|
694
694
|
let error_count = 0;
|
695
695
|
for (const key in errors) {
|
696
696
|
if (errors.hasOwnProperty(key) && errors[key].length > 0) {
|
697
|
-
console.
|
697
|
+
console.error(`\r\n${errors[key].length} error(s) in ${key}`);
|
698
698
|
for (let i = 0; i < errors[key].length; i++) {
|
699
|
-
console.
|
699
|
+
console.error(` - ${errors[key][i]}`);
|
700
700
|
error_count++
|
701
701
|
}
|
702
702
|
}
|
703
703
|
}
|
704
704
|
if (error_count > 0) {
|
705
|
-
console.
|
705
|
+
console.error(`\r\n${error_count} Validation Errors Found`);
|
706
706
|
if (verbose) {
|
707
707
|
console.log(`\n`);
|
708
|
-
console.
|
708
|
+
console.error(JSON.stringify(exclude_spellcheck_output, null, 2));
|
709
709
|
}
|
710
710
|
return false;
|
711
711
|
}
|
package/hdoc-ver.js
CHANGED
@@ -13,9 +13,9 @@
|
|
13
13
|
try {
|
14
14
|
hdocbook_project = require(hdocbook_project_config_path);
|
15
15
|
} catch (e) {
|
16
|
-
console.
|
16
|
+
console.error('File not found: hdocbook-project.json:');
|
17
17
|
console.log(e, '\n');
|
18
|
-
console.
|
18
|
+
console.error('hdoc ver needs to be run in the root of a HDoc Book.\n');
|
19
19
|
process.exit(1);
|
20
20
|
}
|
21
21
|
const doc_id = hdocbook_project.docId;
|
@@ -27,15 +27,15 @@
|
|
27
27
|
try {
|
28
28
|
hdocbook_config = require(hdocbook_path);
|
29
29
|
} catch (e) {
|
30
|
-
console.
|
30
|
+
console.error('File not found: hdocbook.json');
|
31
31
|
console.log(e, '\n');
|
32
|
-
console.
|
32
|
+
console.error('hdoc ver needs to be run in the root of a HDoc Book.\n');
|
33
33
|
process.exit(1);
|
34
34
|
}
|
35
35
|
if (hdocbook_config.version && hdocbook_config.version !== '') {
|
36
36
|
console.log(`Book version: ${hdocbook_config.version}\n`);
|
37
37
|
} else {
|
38
|
-
console.
|
38
|
+
console.error(`Error - this book has no version defined.\n`);
|
39
39
|
process.exit(1);
|
40
40
|
}
|
41
41
|
};
|
package/package.json
CHANGED
package/ui/js/doc.hornbill.js
CHANGED
@@ -611,7 +611,6 @@ async function intialiseApp() {
|
|
611
611
|
}).then(function () {
|
612
612
|
// Get hdocbook.json
|
613
613
|
fetchJsonFile("_books/" + view.docId + "/hdocbook.json").then(function (data) {
|
614
|
-
//console.log(view.docApp.library.books[0].nav_inline)
|
615
614
|
view.docApp.book = data;
|
616
615
|
view.bookId = data.docId;
|
617
616
|
view.docApp.title = data.title || "";
|