Skip to content

Commit

Permalink
replaced the accidently deleted Groups Cited section of parser
Browse files Browse the repository at this point in the history
  • Loading branch information
RussBerg committed Jun 21, 2023
1 parent 8f2c763 commit 1b0ef77
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dev_tools/docs/nxdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,27 @@ def _parse_nxdl_file(self, nxdl_file: Path):
self._print(f": {doc}", end="")
self._print("\n")

# print group references
self._print("**Groups cited**:")
node_list = root.xpath("//nx:group", namespaces=ns)
groups = []
for node in node_list:
g = node.get("type")
if g.startswith("NX") and g not in groups:
groups.append(g)
if len(groups) == 0:
self._print(" none\n")
else:
out = [(f":ref:`{g}`") for g in groups]
txt = ", ".join(sorted(out))
self._print(f" {txt}\n")
out = [
("%s (base class); used in %s" % (g, self._listing_category))
for g in groups
]
txt = ", ".join(out)
self._print(f".. index:: {txt}\n")

# print full tree
self._print("**Structure**:\n")
for subnode in root.xpath("nx:attribute", namespaces=ns):
Expand Down

0 comments on commit 1b0ef77

Please sign in to comment.