From 9604f3981f6fc67271a4e62f380caa8c60ea1ea2 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 8 Jan 2020 23:46:54 +0100 Subject: [PATCH] Teach autodoxy about namespaces --- docs/find-missing.py | 3 +++ docs/source/_ext/autodoxy.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/find-missing.py b/docs/find-missing.py index 6a79f21637..ee0ec2cf81 100755 --- a/docs/find-missing.py +++ b/docs/find-missing.py @@ -41,6 +41,7 @@ xml_files = [ 'build/xml/classsimgrid_1_1s4u_1_1NetZone.xml', 'build/xml/classsimgrid_1_1s4u_1_1Semaphore.xml', 'build/xml/classsimgrid_1_1s4u_1_1VirtualMachine.xml', + 'build/xml/namespacesimgrid_1_1s4u_1_1this__actor.xml', 'build/xml/actor_8h.xml', 'build/xml/barrier_8h.xml', 'build/xml/cond_8h.xml', @@ -162,6 +163,8 @@ for arg in xml_files: #print ("compoundname {}".format(compoundname)) elif elem.attrib["kind"] == "file": compoundname = "" + elif elem.attrib["kind"] == "namespace": + compoundname = elem.find("compoundname").text else: print("Element {} is of kind {}".format(elem.attrib["id"], elem.attrib["kind"])) diff --git a/docs/source/_ext/autodoxy.py b/docs/source/_ext/autodoxy.py index 93569db95b..f562a232ec 100644 --- a/docs/source/_ext/autodoxy.py +++ b/docs/source/_ext/autodoxy.py @@ -381,7 +381,8 @@ class DoxygenMethodDocumenter(DoxygenDocumenter): if '::' in self.fullname: (obj, meth) = self.fullname.rsplit('::', 1) - prefix = './/compoundname[text()="{:s}"]/../sectiondef[@kind="public-func" or @kind="public-static-func"]'.format(obj) + # 'public-func' and 'public-static-func' are for classes while 'func' alone is for namespaces + prefix = './/compoundname[text()="{:s}"]/../sectiondef[@kind="public-func" or @kind="public-static-func" or @kind="func"]'.format(obj) obj = "{:s}::".format(obj) else: meth = self.fullname @@ -406,10 +407,12 @@ class DoxygenMethodDocumenter(DoxygenDocumenter): self.object = candidates[0] return True logger.warning("[autodoxy] WARNING: Could not find method {}{}{}".format(obj, meth, self.argsstring)) + if not candidates: + logger.warning("[autodoxy] WARNING: (no candidate found)") for cand in candidates: logger.warning("[autodoxy] WARNING: Existing candidate: {}{}{}".format(obj, meth, cand.find('argsstring').text)) else: - logger.warning("[autodoxy] WARNING: could not find method {}{} in Doxygen files\nQuery: {}".format(obj, meth, xpath_query)) + logger.warning("[autodoxy] WARNING: Could not find method {}{} in Doxygen files\nQuery: {}".format(obj, meth, xpath_query)) return False self.object = match[0] return True -- 2.20.1