check_links - better handling of api tool links

This commit is contained in:
mDuo13
2016-03-07 19:12:05 -08:00
parent bafd714dac
commit 3170211d51
2 changed files with 11 additions and 3 deletions

View File

@@ -81,6 +81,9 @@ def checkLinks(offline=False):
elif '#' in endpoint: 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)) print("Testing local link %s from %s"%(endpoint, fullPath))
num_links_checked += 1 num_links_checked += 1
filename,anchor = endpoint.split("#",1) filename,anchor = endpoint.split("#",1)
@@ -92,10 +95,10 @@ def checkLinks(offline=False):
print("Broken local link in %s to %s"%(fullPath, endpoint)) print("Broken local link in %s to %s"%(fullPath, endpoint))
broken_links.append( (fullPath, endpoint) ) broken_links.append( (fullPath, endpoint) )
elif "-api-tool.html" in fullTargetPath: elif filename in config["ignore_anchors_in"]:
#These pages are populated dynamically, so BeatifulSoup wouldn't #Some pages are populated dynamically, so BeatifulSoup wouldn't
# be able to find anchors in them anyway # 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)) (fullPath, endpoint))
continue continue

View File

@@ -201,6 +201,11 @@ pages:
# Link Checker Config ------------------------------------------------------- # # 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 #Sometimes, a link is not really problematic, but the link checker detects it
# as such and the easiest solution is to ignore it. # as such and the easiest solution is to ignore it.
known_broken_links: known_broken_links: