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

doc: Move the class description to be just below the brief description

- Drop the "Brief description" header as it became redundant
  with this change.
- Fix a bug in the editor help where an extraneous newline was added
  after the header if the class isn't inherited by any others.
- Remove the Category line in the rST markup as it's not useful
  for API users.
This commit is contained in:
Hugo Locurcio
2020-01-14 21:38:54 +01:00
parent 57986208f3
commit 3c8abbc4bf
2 changed files with 74 additions and 87 deletions

View File

@@ -393,15 +393,22 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S
f.write(make_type(child, state))
f.write("\n\n")
# Category
if class_def.category is not None:
f.write('**Category:** ' + class_def.category.strip() + "\n\n")
# Brief description
f.write(make_heading('Brief Description', '-'))
if class_def.brief_description is not None:
f.write(rstize_text(class_def.brief_description.strip(), state) + "\n\n")
# Class description
if class_def.description is not None and class_def.description.strip() != '':
f.write(make_heading('Description', '-'))
f.write(rstize_text(class_def.description.strip(), state) + "\n\n")
# Online tutorials
if len(class_def.tutorials) > 0:
f.write(make_heading('Tutorials', '-'))
for t in class_def.tutorials:
link = t.strip()
f.write("- " + make_url(link) + "\n\n")
# Properties overview
if len(class_def.properties) > 0:
f.write(make_heading('Properties', '-'))
@@ -494,18 +501,6 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S
f.write('\n\n')
# Class description
if class_def.description is not None and class_def.description.strip() != '':
f.write(make_heading('Description', '-'))
f.write(rstize_text(class_def.description.strip(), state) + "\n\n")
# Online tutorials
if len(class_def.tutorials) > 0:
f.write(make_heading('Tutorials', '-'))
for t in class_def.tutorials:
link = t.strip()
f.write("- " + make_url(link) + "\n\n")
# Property descriptions
if any(not p.overridden for p in class_def.properties.values()) > 0:
f.write(make_heading('Property Descriptions', '-'))