hdoc-tools 0.17.24 → 0.17.26
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 +14 -4
- package/hdoc-create.js +8 -4
- package/hdoc-init.js +1 -0
- package/package.json +3 -3
package/hdoc-build.js
CHANGED
@@ -13,9 +13,7 @@
|
|
13
13
|
hdoc_build_db = require(path.join(__dirname, 'hdoc-build-db.js')),
|
14
14
|
hdoc_build_pdf = require(path.join(__dirname, 'hdoc-build-pdf.js')),
|
15
15
|
hdoc_index = require(path.join(__dirname, 'hdoc-db.js')),
|
16
|
-
|
17
|
-
zip
|
18
|
-
} = require('zip-a-folder'),
|
16
|
+
archiver = require('archiver'),
|
19
17
|
xmlFormat = require('xml-formatter');
|
20
18
|
|
21
19
|
const h_tags_to_search = ['h1', 'h2', 'h3'],
|
@@ -1049,7 +1047,19 @@
|
|
1049
1047
|
if (!validate) {
|
1050
1048
|
try {
|
1051
1049
|
const zip_path = path.join(work_path, doc_id + '.zip');
|
1052
|
-
|
1050
|
+
|
1051
|
+
var output = fs.createWriteStream(zip_path);
|
1052
|
+
var archive = archiver('zip');
|
1053
|
+
archive.on('error', function(err){
|
1054
|
+
throw err;
|
1055
|
+
});
|
1056
|
+
archive.pipe(output);
|
1057
|
+
|
1058
|
+
// append files from a sub-directory, putting its contents at the root of archive
|
1059
|
+
archive.directory(work_path_content, false);
|
1060
|
+
archive.finalize();
|
1061
|
+
|
1062
|
+
//await zip(work_path_content, zip_path);
|
1053
1063
|
console.log(`\nZIP Creation Success: ${zip_path}\n`);
|
1054
1064
|
console.log(' Build Started:', build_start_dt);
|
1055
1065
|
console.log(`Build Completed: ${new Date().toLocaleString()}\n`);
|
package/hdoc-create.js
CHANGED
@@ -44,10 +44,14 @@
|
|
44
44
|
let nav_paths = hdoc.build_breadcrumbs(hdocbook.navigation.items);
|
45
45
|
for (const key in nav_paths) {
|
46
46
|
if (nav_paths.hasOwnProperty(key)) {
|
47
|
-
for (
|
48
|
-
if (
|
49
|
-
|
50
|
-
|
47
|
+
for (const navkey in nav_paths[key]) {
|
48
|
+
if (nav_paths[key].hasOwnProperty(navkey)) {
|
49
|
+
for (let i = 0; i < nav_paths[key][navkey].length; i++) {
|
50
|
+
if (!processed_links[nav_paths[key][navkey][i].link]) {
|
51
|
+
nav_paths[key][navkey][i].path = path.join(source_path, nav_paths[key][navkey][i].link);
|
52
|
+
await add_doc(nav_paths[key][navkey][i]);
|
53
|
+
}
|
54
|
+
}
|
51
55
|
}
|
52
56
|
}
|
53
57
|
}
|
package/hdoc-init.js
CHANGED
@@ -86,6 +86,7 @@
|
|
86
86
|
hdocbookFile.title = docProps.title;
|
87
87
|
hdocbookFile.description = docProps.description;
|
88
88
|
hdocbookFile.version = docProps.version;
|
89
|
+
hdocbookFile.publicSource = `https://github.com/Hornbill-Docs/${docProps.id}`;
|
89
90
|
hdocbookFile.navigation.items[0].items = [{
|
90
91
|
"text": "Welcome",
|
91
92
|
"link": docProps.id + '/index'
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hdoc-tools",
|
3
|
-
"version": "0.17.
|
3
|
+
"version": "0.17.26",
|
4
4
|
"description": "Hornbill HDocBook Development Support Tool",
|
5
5
|
"main": "hdoc.js",
|
6
6
|
"bin": {
|
@@ -36,6 +36,7 @@
|
|
36
36
|
"license": "ISC",
|
37
37
|
"dependencies": {
|
38
38
|
"american-british-english-translator": "^0.2.1",
|
39
|
+
"archiver": "7.0.1",
|
39
40
|
"axios": "^1.3.2",
|
40
41
|
"axios-retry": "^3.5.0",
|
41
42
|
"better-sqlite3": "^9.4.0",
|
@@ -59,7 +60,6 @@
|
|
59
60
|
"stream": "0.0.2",
|
60
61
|
"true-case-path": "^2.2.1",
|
61
62
|
"words-count": "^2.0.2",
|
62
|
-
"xml-formatter": "^3.6.0"
|
63
|
-
"zip-a-folder": "^1.1.5"
|
63
|
+
"xml-formatter": "^3.6.0"
|
64
64
|
}
|
65
65
|
}
|