1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

doc: Fix parsing typed arrays in makerst.py

`Type[]` typed arrays will link to `Type`, as it's likely the most
interesting information for the user.

And sync classref with current source.
This commit is contained in:
Rémi Verschelde
2020-04-24 17:43:10 +02:00
parent 58cbec8db3
commit d567c15aed
17 changed files with 51 additions and 75 deletions

View File

@@ -973,11 +973,14 @@ def format_table(f, data, remove_empty_columns=False): # type: (TextIO, Iterabl
f.write("\n")
def make_type(t, state): # type: (str, State) -> str
if t in state.classes:
return ":ref:`{0}<class_{0}>`".format(t)
print_error("Unresolved type '{}', file: {}".format(t, state.current_class), state)
return t
def make_type(klass, state): # type: (str, State) -> str
link_type = klass
if link_type.endswith("[]"): # Typed array, strip [] to link to contained type.
link_type = link_type[:-2]
if link_type in state.classes:
return ":ref:`{}<class_{}>`".format(klass, link_type)
print_error("Unresolved type '{}', file: {}".format(klass, state.current_class), state)
return klass
def make_enum(t, state): # type: (str, State) -> str