hdoc-tools 0.9.8 → 0.9.10
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 -2
- package/hdoc-build.js +6 -2
- package/hdoc-init.js +2 -2
- package/hdoc-validate.js +1 -1
- package/package.json +1 -1
- package/templates/init/_hdocbook/hdocbook.json +1 -1
package/hdoc-build-db.js
CHANGED
@@ -14,7 +14,8 @@
|
|
14
14
|
'doc_title',
|
15
15
|
'doc_content',
|
16
16
|
'doc_preview UNINDEXED',
|
17
|
-
'doc_family_id'
|
17
|
+
'doc_family_id',
|
18
|
+
'doc_md5_hash UNINDEXED'
|
18
19
|
],
|
19
20
|
hdoc_meta: [
|
20
21
|
'resource_url',
|
@@ -89,7 +90,8 @@
|
|
89
90
|
index_records[i].index_html.fm_props.title,
|
90
91
|
index_records[i].index_html.text,
|
91
92
|
index_records[i].index_html.preview,
|
92
|
-
book_config.productFamily
|
93
|
+
book_config.productFamily,
|
94
|
+
index_records[i].md5
|
93
95
|
];
|
94
96
|
const index_response = await hdoc_index.insert_record(db, 'hdoc_index', db_schema.hdoc_index, index_vals);
|
95
97
|
if (!index_response.success) {
|
package/hdoc-build.js
CHANGED
@@ -247,7 +247,8 @@
|
|
247
247
|
index_html: hdoc_index.transform_html_for_index(html_txt),
|
248
248
|
metadata: metadata,
|
249
249
|
contributors: contribs,
|
250
|
-
pdf_size: pdf_size
|
250
|
+
pdf_size: pdf_size,
|
251
|
+
md5: file_path.hash
|
251
252
|
});
|
252
253
|
// Save HTML into HTML file
|
253
254
|
try {
|
@@ -260,6 +261,7 @@
|
|
260
261
|
|
261
262
|
const transform_markdown_and_save_html = async function (file_path) {
|
262
263
|
conversion_attempted++;
|
264
|
+
|
263
265
|
if (fs.existsSync(file_path.path)) {
|
264
266
|
// Load markdown file
|
265
267
|
let md_txt = hdoc.expand_variables(fs.readFileSync(file_path.path, 'utf8'));
|
@@ -466,7 +468,8 @@
|
|
466
468
|
index_html: index_details,
|
467
469
|
metadata: metadata,
|
468
470
|
contributors: contribs,
|
469
|
-
pdf_size: pdf_size
|
471
|
+
pdf_size: pdf_size,
|
472
|
+
md5: file_path.hash
|
470
473
|
});
|
471
474
|
|
472
475
|
// Add MD file to delete queue
|
@@ -551,6 +554,7 @@
|
|
551
554
|
};
|
552
555
|
|
553
556
|
const dreeOptions = {
|
557
|
+
hash: true,
|
554
558
|
extensions: ['md', 'html', 'htm'],
|
555
559
|
normalize: true,
|
556
560
|
};
|
package/hdoc-init.js
CHANGED
@@ -11,8 +11,8 @@
|
|
11
11
|
const promptProps = [{
|
12
12
|
name: 'id',
|
13
13
|
description: 'Document ID',
|
14
|
-
validator: /^[a-z][a-
|
15
|
-
warning: 'Document ID must only contain lower case letters and dashes',
|
14
|
+
validator: /^[a-z][a-z0-9-]+[a-z0-9]$/,
|
15
|
+
warning: 'Document ID must only contain lower case letters, decimal digits and dashes.',
|
16
16
|
required: true
|
17
17
|
},
|
18
18
|
{
|
package/hdoc-validate.js
CHANGED
package/package.json
CHANGED