hdoc-tools 0.41.11 → 0.42.0
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/README.md +4 -0
- package/hdoc-build.js +3 -1
- package/hdoc-help.js +2 -0
- package/hdoc-validate.js +5 -4
- package/hdoc.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -49,6 +49,8 @@ Use the --set-version argument to set the version number of the built book.
|
|
49
49
|
|
50
50
|
Use the --no-color argument to remove any color control characters from the output.
|
51
51
|
|
52
|
+
Use the '--no-links' argument to skip link output to CLI during validation.
|
53
|
+
|
52
54
|
### validate
|
53
55
|
|
54
56
|
Performs a minimum local build of the book, then validates the links and static content are present and correct.
|
@@ -59,6 +61,8 @@ Use the --set-version argument to set the version number of the built book.
|
|
59
61
|
|
60
62
|
Use the --no-color argument to remove any color control characters from the output.
|
61
63
|
|
64
|
+
Use the '--no-links' argument to skip link output to CLI during validation.
|
65
|
+
|
62
66
|
### serve
|
63
67
|
|
64
68
|
Starts a local web server on port 3000, serving the book content.
|
package/hdoc-build.js
CHANGED
@@ -1149,6 +1149,7 @@
|
|
1149
1149
|
validate,
|
1150
1150
|
gen_exclude,
|
1151
1151
|
build_version = "",
|
1152
|
+
output_links = true,
|
1152
1153
|
) => {
|
1153
1154
|
if (github_api_token !== "") {
|
1154
1155
|
git_token = github_api_token;
|
@@ -1487,7 +1488,8 @@
|
|
1487
1488
|
draft_links,
|
1488
1489
|
github_repo_details && github_repo_details.data && github_repo_details.data.private ? github_repo_details.data.private : false,
|
1489
1490
|
browser,
|
1490
|
-
source_path
|
1491
|
+
source_path,
|
1492
|
+
output_links,
|
1491
1493
|
);
|
1492
1494
|
|
1493
1495
|
// Close the Chromium browser instance
|
package/hdoc-help.js
CHANGED
@@ -12,6 +12,7 @@ Commands
|
|
12
12
|
Performs a local build of the book, and outputs as a ZIP file.
|
13
13
|
- Use the '--set-version 1.2.3' argument to set the version number of the built book.
|
14
14
|
- Use the '--no-color' argument to remove any color control characters from the output.
|
15
|
+
- Use the '--no-links' argument to skip link output to CLI during validation.
|
15
16
|
|
16
17
|
- createDocs
|
17
18
|
Creates folder structure and markdown documents as defined in the HDocBook navigation item links
|
@@ -33,6 +34,7 @@ Commands
|
|
33
34
|
Validates the book content.
|
34
35
|
- Use the '--set-version 1.2.3' argument to set the version number of the built book.
|
35
36
|
- Use the '--no-color' argument to remove any color control characters from the output.
|
37
|
+
- Use the '--no-links' argument to skip link output to CLI during validation.
|
36
38
|
|
37
39
|
- bump
|
38
40
|
Updates the semantic version number of the current book. If no options are specified, then the default of patch is applied:
|
package/hdoc-validate.js
CHANGED
@@ -467,14 +467,14 @@ const e = require("express");
|
|
467
467
|
return returnPaths;
|
468
468
|
}
|
469
469
|
|
470
|
-
const checkLinks = async (source_path, htmlFile, links, hdocbook_config, hdocbook_project, browser, global_links_checked) => {
|
470
|
+
const checkLinks = async (source_path, htmlFile, links, hdocbook_config, hdocbook_project, browser, global_links_checked, output_links) => {
|
471
471
|
const markdown_paths = getMDPathFromHtmlPath(htmlFile);
|
472
472
|
const markdown_content = fs.readFileSync(markdown_paths.markdownPath, 'utf8');
|
473
473
|
|
474
474
|
|
475
475
|
for (let i = 0; i < links.length; i++) {
|
476
476
|
// Validate that link is a valid URL first
|
477
|
-
console.log(` - ${links[i]}`);
|
477
|
+
if (output_links) console.log(` - ${links[i]}`);
|
478
478
|
if (exclude_links[links[i]]) continue;
|
479
479
|
if (global_links_checked.includes(links[i])) continue;
|
480
480
|
global_links_checked.push(links[i]);
|
@@ -907,6 +907,7 @@ const e = require("express");
|
|
907
907
|
is_private,
|
908
908
|
browser,
|
909
909
|
source_root_path,
|
910
|
+
output_links = true,
|
910
911
|
) => {
|
911
912
|
console.log("Performing Validation and Building SEO Link List...");
|
912
913
|
redirects = gen_redirects;
|
@@ -1085,8 +1086,8 @@ const e = require("express");
|
|
1085
1086
|
if (links.href.length === 0) {
|
1086
1087
|
messages[file.relativePath].push("No links found in file");
|
1087
1088
|
} else {
|
1088
|
-
console.log(`\r\nChecking Links in ${file.relativePath}`);
|
1089
|
-
await checkLinks(source_path, file, links.href, hdocbook_config, hdocbook_project, validateBrowser, global_links_checked);
|
1089
|
+
console.log(`\r\nChecking ${links.href.length} Links in ${file.relativePath}`);
|
1090
|
+
await checkLinks(source_path, file, links.href, hdocbook_config, hdocbook_project, validateBrowser, global_links_checked, output_links);
|
1090
1091
|
}
|
1091
1092
|
if (links.img.length === 0) {
|
1092
1093
|
messages[file.relativePath].push("No images found in file");
|
package/hdoc.js
CHANGED
@@ -104,6 +104,7 @@
|
|
104
104
|
let verbose = false;
|
105
105
|
let gen_exclude = false;
|
106
106
|
let bump_type = "patch"; // To generate spellcheck exclusions for all files
|
107
|
+
let output_links = true;
|
107
108
|
|
108
109
|
// Get options from command args
|
109
110
|
for (let x = 0; x < process.argv.length; x++) {
|
@@ -148,6 +149,8 @@
|
|
148
149
|
gen_exclude = true;
|
149
150
|
} else if (process.argv[x].toLowerCase() === "--no-color") {
|
150
151
|
console_color = false;
|
152
|
+
} else if (process.argv[x].toLowerCase() === "--no-links") {
|
153
|
+
output_links = false;
|
151
154
|
}
|
152
155
|
}
|
153
156
|
source_path = trueCasePathSync(source_path);
|
@@ -182,6 +185,7 @@
|
|
182
185
|
false,
|
183
186
|
gen_exclude,
|
184
187
|
build_version,
|
188
|
+
output_links,
|
185
189
|
);
|
186
190
|
} else if (command.toLowerCase() === "createdocs") {
|
187
191
|
const creator = require(path.join(__dirname, "hdoc-create.js"));
|
@@ -195,6 +199,7 @@
|
|
195
199
|
true,
|
196
200
|
gen_exclude,
|
197
201
|
build_version,
|
202
|
+
output_links,
|
198
203
|
);
|
199
204
|
} else if (command.toLowerCase() === "stats") {
|
200
205
|
const stats = require(path.join(__dirname, "hdoc-stats.js"));
|