hdoc-tools 0.41.10 → 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/ui/css/theme-default/styles/base.css +15 -17
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"));
|
package/package.json
CHANGED
@@ -234,51 +234,49 @@ p {
|
|
234
234
|
--h1-min: 2.0rem; --h1-max: 3.0rem; /* 32–48 */
|
235
235
|
--h2-min: 1.6rem; --h2-max: 2.25rem; /* 25.6–36 */
|
236
236
|
--h3-min: 1.35rem; --h3-max: 1.8rem; /* 21.6–28.8 */
|
237
|
-
--h4-min:
|
237
|
+
--h4-min: 1rem; --h4-max: 1.35rem; /* 18.4–23.2 */
|
238
238
|
--h5-min: 1.05rem; --h5-max: 1.2rem; /* 16.8–19.2 */
|
239
|
-
--h6-min: 0.95rem; --h6-max: 1.
|
239
|
+
--h6-min: 0.95rem; --h6-max: 1.1rem; /* 15.2–16.8 */
|
240
240
|
}
|
241
241
|
|
242
242
|
h3,h4 {
|
243
243
|
font-family: var(--hb-heading, inherit);
|
244
|
-
line-height: 1.15;
|
245
|
-
margin-top: 2.2em;
|
246
|
-
margin-bottom: 0.6em;
|
244
|
+
/*line-height: 1.15;
|
245
|
+
margin-top: 2.2em;
|
246
|
+
margin-bottom: 0.6em; */
|
247
247
|
letter-spacing: 0;
|
248
248
|
}
|
249
|
-
h1{
|
250
|
-
font-size: clamp(var(--h1-min), 2vw + 1rem, var(--h1-max));
|
251
|
-
font-weight: 750; /* strong but not shouty */
|
249
|
+
h1:not(.mb-2):not(.display-4){
|
252
250
|
line-height: 1.1;
|
253
251
|
margin-top: 0; /* article title at top */
|
254
252
|
}
|
255
253
|
h2:not(.title){
|
256
254
|
font-size: clamp(var(--h2-min), 1.5vw + 0.9rem, var(--h2-max));
|
257
|
-
font-weight:
|
255
|
+
font-weight: 650;
|
258
256
|
/*border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);*/
|
259
|
-
padding-bottom: 0.2em
|
257
|
+
/*padding-bottom: 0.2em;*/
|
260
258
|
}
|
261
259
|
h3{
|
262
260
|
font-size: clamp(var(--h3-min), 1.2vw + 0.7rem, var(--h3-max));
|
263
|
-
font-weight:
|
261
|
+
font-weight: 600;
|
264
262
|
}
|
265
263
|
h4{
|
266
|
-
font-size: clamp(var(--h4-min), 0.8vw + 0.
|
267
|
-
font-weight:
|
264
|
+
font-size: clamp(var(--h4-min), 0.8vw + 0.6rem, var(--h4-max));
|
265
|
+
font-weight: 550;
|
268
266
|
}
|
269
267
|
h5:not(.description){
|
270
268
|
font-size: clamp(var(--h5-min), 0.6vw + 0.6rem, var(--h5-max));
|
271
|
-
font-weight:
|
269
|
+
font-weight: 500;
|
272
270
|
color: color-mix(in srgb, currentColor 85%, #000 15%);
|
273
271
|
}
|
274
272
|
h6:not(.description){
|
275
|
-
font-size: clamp(var(--h6-min), 0.
|
273
|
+
font-size: clamp(var(--h6-min), 0.5vw + 0.55rem, var(--h6-max));
|
276
274
|
font-weight: 600;
|
277
|
-
text-transform: uppercase;
|
275
|
+
/*text-transform: uppercase; */ /* differentiate without shrinking */
|
278
276
|
letter-spacing: 0.06em;
|
279
277
|
color: color-mix(in srgb, currentColor 70%, #000 30%);
|
280
278
|
}
|
281
279
|
/* Better anchor linking with fixed headers/ToC */
|
282
|
-
|
280
|
+
/*:where(h1,h2,h3,h4,h5,h6){ scroll-margin-top: 96px; }*/
|
283
281
|
/* Tighten multi-line large headings */
|
284
282
|
h1, h2 { hyphens: auto; }
|