hdoc-tools 0.11.2 → 0.11.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-db.js +9 -7
- package/hdoc-build.js +3 -2
- package/hdoc.js +1 -1
- package/package.json +1 -1
package/hdoc-build-db.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
(function () {
|
2
2
|
'use strict';
|
3
3
|
|
4
|
-
const
|
5
|
-
|
6
|
-
|
4
|
+
const path = require('path'),
|
5
|
+
hdoc_index = require(path.join(__dirname, 'hdoc-db.js')),
|
6
|
+
database = require('better-sqlite3');
|
7
7
|
|
8
8
|
const db_schema = {
|
9
9
|
hdoc_index: [
|
@@ -15,7 +15,8 @@
|
|
15
15
|
'doc_content',
|
16
16
|
'doc_preview UNINDEXED',
|
17
17
|
'doc_family_id',
|
18
|
-
'doc_md5_hash UNINDEXED'
|
18
|
+
'doc_md5_hash UNINDEXED',
|
19
|
+
'lastmod'
|
19
20
|
],
|
20
21
|
hdoc_meta: [
|
21
22
|
'resource_url',
|
@@ -95,7 +96,8 @@
|
|
95
96
|
file.index_html.text,
|
96
97
|
file.index_html.preview,
|
97
98
|
book_config.productFamily,
|
98
|
-
file.md5
|
99
|
+
file.md5,
|
100
|
+
file.lastmod
|
99
101
|
];
|
100
102
|
const index_response = hdoc_index.insert_record(db, 'hdoc_index', db_schema.hdoc_index, index_vals);
|
101
103
|
if (!index_response.success) {
|
@@ -118,7 +120,7 @@
|
|
118
120
|
console.log(`Inserted index record ${index_response.row_id}: ${doc_id} - ${file.index_html.fm_props.title}`);
|
119
121
|
console.log(`Inserted index metadata record for index ID: ${meta_response.row_id}`);
|
120
122
|
}
|
121
|
-
|
123
|
+
|
122
124
|
// Now add contributor records
|
123
125
|
for (let j = 0; j < file.contributors.length; j++) {
|
124
126
|
const contrib_vals = [
|
@@ -136,7 +138,7 @@
|
|
136
138
|
}
|
137
139
|
if (verbose) {
|
138
140
|
console.log(`Inserted document contributor recordL ${cont_response.row_id}`);
|
139
|
-
}
|
141
|
+
}
|
140
142
|
}
|
141
143
|
response.index_success_count++;
|
142
144
|
}
|
package/hdoc-build.js
CHANGED
@@ -467,14 +467,14 @@
|
|
467
467
|
}
|
468
468
|
|
469
469
|
const index_details = hdoc_index.transform_html_for_index(html_txt);
|
470
|
-
|
471
470
|
index_records.push({
|
472
471
|
relative_path: relative_path,
|
473
472
|
index_html: index_details,
|
474
473
|
metadata: metadata,
|
475
474
|
contributors: contribs,
|
476
475
|
pdf_size: pdf_size,
|
477
|
-
md5: file_path.hash
|
476
|
+
md5: file_path.hash,
|
477
|
+
lastmod: file_path.stat.mtime.toISOString()
|
478
478
|
});
|
479
479
|
|
480
480
|
// Add MD file to delete queue
|
@@ -563,6 +563,7 @@
|
|
563
563
|
hash: true,
|
564
564
|
extensions: ['md', 'html', 'htm'],
|
565
565
|
normalize: true,
|
566
|
+
stat: true
|
566
567
|
};
|
567
568
|
|
568
569
|
const md5DreeOptions = {
|
package/hdoc.js
CHANGED