hdoc-tools 0.33.2 → 0.33.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-serve.js +0 -1
- package/hdoc-validate.js +7 -3
- package/package.json +1 -1
- package/ui/js/doc.hornbill.js +4 -3
package/hdoc-serve.js
CHANGED
package/hdoc-validate.js
CHANGED
@@ -449,7 +449,7 @@ const e = require("express");
|
|
449
449
|
return returnPaths;
|
450
450
|
}
|
451
451
|
|
452
|
-
const checkLinks = async (source_path, htmlFile, links, hdocbook_config) => {
|
452
|
+
const checkLinks = async (source_path, htmlFile, links, hdocbook_config, hdocbook_project) => {
|
453
453
|
const markdown_paths = getMDPathFromHtmlPath(htmlFile);
|
454
454
|
const markdown_content = fs.readFileSync(markdown_paths.markdownPath, 'utf8');
|
455
455
|
|
@@ -577,7 +577,11 @@ const e = require("express");
|
|
577
577
|
} else {
|
578
578
|
error_message = processErrorMessage(`Issue with external link [${links[i]}]: ${e}`, markdown_paths.relativePath, markdown_content, links[i]);
|
579
579
|
}
|
580
|
-
|
580
|
+
if (hdocbook_project.validation.external_link_warnings)
|
581
|
+
warnings[htmlFile.relativePath].push(error_message);
|
582
|
+
else
|
583
|
+
errors[htmlFile.relativePath].push(error_message);
|
584
|
+
|
581
585
|
}
|
582
586
|
}
|
583
587
|
}
|
@@ -998,7 +1002,7 @@ const e = require("express");
|
|
998
1002
|
if (links.href.length === 0) {
|
999
1003
|
messages[file.relativePath].push("No links found in file");
|
1000
1004
|
} else {
|
1001
|
-
await checkLinks(source_path, file, links.href, hdocbook_config);
|
1005
|
+
await checkLinks(source_path, file, links.href, hdocbook_config, hdocbook_project);
|
1002
1006
|
}
|
1003
1007
|
if (links.img.length === 0) {
|
1004
1008
|
messages[file.relativePath].push("No images found in file");
|
package/package.json
CHANGED
package/ui/js/doc.hornbill.js
CHANGED
@@ -258,6 +258,8 @@ function loadContentUrl(
|
|
258
258
|
fromPopState,
|
259
259
|
fromBook = true,
|
260
260
|
) {
|
261
|
+
|
262
|
+
|
261
263
|
//-- clear table of contents
|
262
264
|
view.docApp.tableOfContents = [];
|
263
265
|
let clean_linkRef = linkRef;
|
@@ -686,17 +688,16 @@ async function intialiseApp() {
|
|
686
688
|
`${window.location.origin}/`,
|
687
689
|
"",
|
688
690
|
);
|
689
|
-
|
691
|
+
const newInitialLoadContentHref = findFirstClickableBookLink(
|
690
692
|
initialLoadContentHref,
|
691
693
|
);
|
692
|
-
|
694
|
+
if (newInitialLoadContentHref !== undefined) initialLoadContentHref = newInitialLoadContentHref;
|
693
695
|
if (initialLoadContentHref) {
|
694
696
|
//-- find the link we are going to show and make sure parent/s are set to .expand=true
|
695
697
|
loadContentUrl(initialLoadContentHref, true, false);
|
696
698
|
} else {
|
697
699
|
hslDocLog.log("initial first view link to load is not present");
|
698
700
|
}
|
699
|
-
|
700
701
|
$(".hb-hidden").removeClass("hb-hidden");
|
701
702
|
}, 200);
|
702
703
|
})
|