From 76e57bb0da5733042fb2be0c783161dfb40654da Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 26 Oct 2022 08:09:47 +1100 Subject: Add check for validity of 'seealso' links in documentation. Fix 'seelaso' links. Fix some minor formatting issues. --- scripts/CheckMentioned.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'scripts/CheckMentioned.py') diff --git a/scripts/CheckMentioned.py b/scripts/CheckMentioned.py index 3e87be79c..72b6b49f4 100644 --- a/scripts/CheckMentioned.py +++ b/scripts/CheckMentioned.py @@ -161,7 +161,7 @@ def checkDocumentation(): #~ if api not in headers: #~ print("No header for ", api) - # Examine definitions + # Examine definitions #SCI_SETLAYOUTCACHE(int cacheMode) defPattern = re.compile(r'([A-Z][A-Za-z0-9_() *#\"=<>/&;,\n-]+?)') for api, sig in re.findall(defPattern, docs): @@ -201,7 +201,7 @@ def checkDocumentation(): with open(outName, "wt") as docFile: docFile.write(docs) - # Examine constant definitions + # Examine constant definitions #SC_CARETSTICKY_WHITESPACE (2) constPattern = re.compile(r'(\w+) *\((\w+)\)') for name, val in re.findall(constPattern, docs): @@ -212,6 +212,13 @@ def checkDocumentation(): except KeyError: print("***", val, "<-", name) + # Examine 'seealso' definitions + #SCI_CREATEDOCUMENT + seealsoPattern = re.compile(r'"seealso" href="#(\w+)">(\w+)[<(]') + for ref, text in re.findall(seealsoPattern, docs): + if ref != text: + print(f"seealso {text} -> {ref}") + for name in sccToValue.keys(): if name not in ["SCI_OPTIONAL_START", "SCI_LEXER_START"] and name not in docs: print(f"Unknown {name}") -- cgit v1.2.3