From ba64ea22830dd8e627428d7a0002c4ff70cd408d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 12 Sep 2018 17:12:23 +0200 Subject: [PATCH 1/2] Doc: Use same headers and order in-editor and online --- doc/tools/makerst.py | 95 +++++++++++++++++++++++++----------------- editor/editor_help.cpp | 56 ++++++++++++++----------- 2 files changed, 89 insertions(+), 62 deletions(-) diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 93ad823d424..056e5ca57f0 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -435,6 +435,8 @@ def make_rst_class(node): f.write(".. _class_" + name + ":\n\n") f.write(make_heading(name, '=')) + # Inheritance tree + # Ascendents if 'inherits' in node.attrib: inh = node.attrib['inherits'].strip() f.write('**Inherits:** ') @@ -451,35 +453,40 @@ def make_rst_class(node): inh = inode.attrib['inherits'].strip() else: inh = None + f.write("\n") - f.write("\n\n") - + # Descendents 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") + f.write("\n") + + # Category if 'category' in node.attrib: f.write('**Category:** ' + node.attrib['category'].strip() + "\n\n") + # Brief description f.write(make_heading('Brief Description', '-')) briefd = node.find('brief_description') if briefd != None: f.write(rstize_text(briefd.text.strip(), name) + "\n\n") - methods = node.find('methods') + # Properties overview + # TODO: Implement + # Methods overview + methods = node.find('methods') if methods != None and len(list(methods)) > 0: - f.write(make_heading('Member Functions', '-')) + f.write(make_heading('Methods', '-')) ml = [] for m in list(methods): make_method(f, node.attrib['name'], m, False, name, False, ml) @@ -512,6 +519,10 @@ def make_rst_class(node): f.write(sep) f.write('\n') + # Theme properties + # TODO: Implement + + # Signals events = node.find('signals') if events != None and len(list(events)) > 0: f.write(make_heading('Signals', '-')) @@ -527,24 +538,7 @@ def make_rst_class(node): f.write('\n') - members = node.find('members') - if members != None and len(list(members)) > 0: - f.write(make_heading('Member Variables', '-')) - - for c in list(members): - # Leading two spaces necessary to prevent breaking the