diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-02-07 13:05:16 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-02-07 13:05:16 -0300 |
commit | b766e9c79b898c3f0c03d13b9e2648d5c72ceee0 (patch) | |
tree | 86a61fd4d3d65ac885b424f5c1a2c30870d05df6 /doc/tools | |
parent | b03a6053fc54146f4c270278279975cebc683e33 (diff) |
Display better inheritance info in doc
Diffstat (limited to 'doc/tools')
-rw-r--r-- | doc/tools/makerst.py | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 36dd42df30..5cd99a797f 100644 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -301,6 +301,7 @@ def make_heading(title, underline): return title + '\n' + underline*len(title) + "\n\n" + def make_rst_class(node): name = node.attrib['name'] @@ -312,10 +313,43 @@ def make_rst_class(node): if 'inherits' in node.attrib: inh = node.attrib['inherits'].strip() - f.write('**Inherits:** ' + make_type(inh) + "\n\n") +# whle inh in classes[cn] + f.write('**Inherits:** ') + first=True + while(inh in classes): + if (not first): + f.write(" **<** ") + else: + first=False + + f.write(make_type(inh)) + inode = classes[inh] + if ('inherits' in inode.attrib): + inh=inode.attrib['inherits'].strip() + else: + inh=None + + + f.write("\n\n") + + inherited=[] + for cn in classes: + c=classes[cn] + if 'inherits' in c.attrib: + if (c.attrib['inherits'].strip()==name): + inherited.append(c.attrib['name']) + + if (len(inherited)): + f.write('**Inherited By:** ') + for i in range(len(inherited)): + if (i>0): + f.write(", ") + f.write(make_type(inherited[i])) + f.write("\n\n") if 'category' in node.attrib: f.write('**Category:** ' + node.attrib['category'].strip() + "\n\n") + f.write(make_heading('Brief Description', '-')) briefd = node.find('brief_description') if briefd != None: f.write(rstize_text(briefd.text.strip(),name) + "\n\n") |