diff --git a/source/scripts/_python/linkcheck/link-whitelist.txt b/source/scripts/_python/linkcheck/link-whitelist.txt index a33863a4..75162fce 100644 --- a/source/scripts/_python/linkcheck/link-whitelist.txt +++ b/source/scripts/_python/linkcheck/link-whitelist.txt @@ -5,15 +5,8 @@ https://software.intel.com/en-us/articles/intel-virtualization-technology-for-di https://software.intel.com/en-us/articles/intel-virtualization-technology-for-directed-io-vt-d-enhancing-intel-platforms-for-efficient-virtualization-of-io-devices https://www.intel.com/content/www/us/en/virtualization/virtualization-technology/intel-virtualization-technology.html https://www.intel.com/content/www/us/en/virtualization/virtualization-technology/intel-virtualization-technology.html -https://github.com/clearlinux/common#build-rpms-for-a-package https://www.intel.com/content/www/us/en/privacy/intel-privacy-notice.html http://ark.intel.com -https://clearlinux.org/documentation/clear-linux/concepts/bundles-about#related-concepts https://software.intel.com/en-us/articles/OpenVINO-ModelOptimizer -https://github.com/kata-containers/documentation/blob/master/Upgrading.md#maintenance-warning -https://github.com/clearcontainers/runtime#configuration -https://github.com/kata-containers/runtime#configuration -https://kubernetes.io/docs/user-journeys/users/application-developer/foundational/#section-3 -https://kubernetes.io/docs/user-journeys/users/application-developer/foundational/#section-2 https://www.intel.com/content/www/us/en/privacy/intel-privacy-notice.html http://www.intel.com/content/www/us/en/nuc/nuc-kit-nuc6i5syh.html \ No newline at end of file diff --git a/source/scripts/_python/linkcheck/parse-link-check.py b/source/scripts/_python/linkcheck/parse-link-check.py index cc943731..e703a0b0 100644 --- a/source/scripts/_python/linkcheck/parse-link-check.py +++ b/source/scripts/_python/linkcheck/parse-link-check.py @@ -5,11 +5,15 @@ # parse-link-check.py # # Arguments: -# 1. path to input file +# 1. working directory: path to directory containing output +# of sphinx-build linkcheck (output.txt). Output of this +# script (broken_links.html) will also be saved in this +# location. # # External file dependencies: # 1. output.txt - the output of sphinx-build -# 2. link-whitelist.txt - broken links that should be ignored +# 2. link-whitelist.txt - broken links that should be ignored. +# This file should be in the same location as this script. # # Output: # 1. broken_links.html - provides count of broken and whitelist @@ -17,6 +21,14 @@ # appear in the same directory as output.txt # 2. Error code 255 if unexpected broken links are found # +# Purpose: +# This script supplements the built-in link checking of +# sphinx-build. In practice, sphinx-build link checking +# will produce a variety of false negatives. This script, +# using the white list, will skip known false negatives and +# anchors, providing an HTML digest of suspected actual +# broken links if there are any. +# #*********************************************************** @@ -52,8 +64,10 @@ with open (fileNamePath) as f: numBrokenLinks = 0 numWhiteListMatches = 0 +numAnchors = 0 newLines = [""] whiteListLines = [] +anchorLines = [] for line in lines: if "[broken]" in line: @@ -63,12 +77,19 @@ for line in lines: if link in whitelist: whiteListLines.append("" + strings[0] + "\n
[whitelist] " + link + "
\n") numWhiteListMatches += 1 - else: + elif "Anchor '" in line: + anchorLines.append("" + strings[0] + "\n
[anchor] " + link + "
\n") + numAnchors += 1 + else: newLines.append("" + strings[0] + "\n
[broken] " + link + "
\n") numBrokenLinks += 1 newLines.insert(0,"

" + str(numBrokenLinks + numWhiteListMatches) + " broken links found in Sphinx link check

\n") newLines.insert(1,"

" + str(numBrokenLinks) + " unmatched broken links

\n") +newLines.append("

" + str(numAnchors) + " links did not find anchors

\n") +for line in anchorLines: + newLines.append(line) + newLines.append("

" + str(numWhiteListMatches) + " links matched whitelist

\n") for line in whiteListLines: newLines.append(line)