diff --git a/tool/check_links.py b/tool/check_links.py index 750f2306ea..7c7cafa562 100755 --- a/tool/check_links.py +++ b/tool/check_links.py @@ -81,6 +81,9 @@ def checkLinks(offline=False): elif '#' in endpoint: + if fname in config["ignore_anchors_in"]: + print("Ignoring anchor %s in dynamic page %s"%(endpoint,fname)) + continue print("Testing local link %s from %s"%(endpoint, fullPath)) num_links_checked += 1 filename,anchor = endpoint.split("#",1) @@ -92,10 +95,10 @@ def checkLinks(offline=False): print("Broken local link in %s to %s"%(fullPath, endpoint)) broken_links.append( (fullPath, endpoint) ) - elif "-api-tool.html" in fullTargetPath: - #These pages are populated dynamically, so BeatifulSoup wouldn't + elif filename in config["ignore_anchors_in"]: + #Some pages are populated dynamically, so BeatifulSoup wouldn't # be able to find anchors in them anyway - print("Skipping anchor link in %s to API tool %s" % + print("Skipping anchor link in %s to dynamic page %s" % (fullPath, endpoint)) continue diff --git a/tool/devportal-config.yml b/tool/devportal-config.yml index bdc890acff..656284eb40 100644 --- a/tool/devportal-config.yml +++ b/tool/devportal-config.yml @@ -201,6 +201,11 @@ pages: # Link Checker Config ------------------------------------------------------- # +ignore_anchors_in: + - data-api-v2-tool.html + - ripple-api-tool.html + - tool-jsonrpc.html + #Sometimes, a link is not really problematic, but the link checker detects it # as such and the easiest solution is to ignore it. known_broken_links: