You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
makerst: Add support for [member] and [signal]
Part of #11137. [enum] is still missing, and none are implemented in the engine itself yet.
This commit is contained in:
@@ -212,7 +212,7 @@ def rstize_text(text, cclass):
|
|||||||
cmd = tag_text[:space_pos]
|
cmd = tag_text[:space_pos]
|
||||||
param = tag_text[space_pos + 1:]
|
param = tag_text[space_pos + 1:]
|
||||||
tag_text = param
|
tag_text = param
|
||||||
elif cmd.find('method') == 0:
|
elif cmd.find('method') == 0 or cmd.find('member') == 0 or cmd.find('signal') == 0:
|
||||||
cmd = tag_text[:space_pos]
|
cmd = tag_text[:space_pos]
|
||||||
param = tag_text[space_pos + 1:]
|
param = tag_text[space_pos + 1:]
|
||||||
|
|
||||||
@@ -450,6 +450,7 @@ def make_rst_class(node):
|
|||||||
if events != None and len(list(events)) > 0:
|
if events != None and len(list(events)) > 0:
|
||||||
f.write(make_heading('Signals', '-'))
|
f.write(make_heading('Signals', '-'))
|
||||||
for m in list(events):
|
for m in list(events):
|
||||||
|
f.write(".. _class_" + name + "_" + m.attrib['name'] + ":\n\n")
|
||||||
make_method(f, node.attrib['name'], m, True, name, True)
|
make_method(f, node.attrib['name'], m, True, name, True)
|
||||||
f.write('\n')
|
f.write('\n')
|
||||||
d = m.find('description')
|
d = m.find('description')
|
||||||
@@ -465,12 +466,14 @@ def make_rst_class(node):
|
|||||||
f.write(make_heading('Member Variables', '-'))
|
f.write(make_heading('Member Variables', '-'))
|
||||||
|
|
||||||
for c in list(members):
|
for c in list(members):
|
||||||
|
# Leading two spaces necessary to prevent breaking the <ul>
|
||||||
|
f.write(" .. _class_" + name + "_" + c.attrib['name'] + ":\n\n")
|
||||||
s = '- '
|
s = '- '
|
||||||
s += make_type(c.attrib['type']) + ' '
|
s += make_type(c.attrib['type']) + ' '
|
||||||
s += '**' + c.attrib['name'] + '**'
|
s += '**' + c.attrib['name'] + '**'
|
||||||
if c.text.strip() != '':
|
if c.text.strip() != '':
|
||||||
s += ' - ' + rstize_text(c.text.strip(), name)
|
s += ' - ' + rstize_text(c.text.strip(), name)
|
||||||
f.write(s + '\n')
|
f.write(s + '\n\n')
|
||||||
f.write('\n')
|
f.write('\n')
|
||||||
|
|
||||||
constants = node.find('constants')
|
constants = node.find('constants')
|
||||||
|
|||||||
Reference in New Issue
Block a user