From 270c81034318de2f97d0970cd59454abac889de6 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Tue, 19 Jul 2022 18:17:04 +0300 Subject: Add more call-to-action notes when documentation is missing --- doc/tools/make_rst.py | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) (limited to 'doc/tools') diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 492a438d9b..82d4ddb3b2 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -723,15 +723,30 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: f.write(make_type(child, state)) f.write("\n\n") + has_description = False + # Brief description - if class_def.brief_description is not None: + if class_def.brief_description is not None and class_def.brief_description.strip() != "": + has_description = True + f.write(f"{format_text_block(class_def.brief_description.strip(), class_def, state)}\n\n") # Class description if class_def.description is not None and class_def.description.strip() != "": + has_description = True + f.write(make_heading("Description", "-")) f.write(f"{format_text_block(class_def.description.strip(), class_def, state)}\n\n") + if not has_description: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this class. Please help us by :ref:`contributing one `!" + ) + + "\n\n" + ) + # Online tutorials if len(class_def.tutorials) > 0: f.write(make_heading("Tutorials", "-")) @@ -872,6 +887,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if m.description is not None and m.description.strip() != "": f.write(f"{format_text_block(m.description.strip(), m, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this annotation. Please help us by :ref:`contributing one `!" + ) + + "\n\n" + ) index += 1 @@ -904,6 +927,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if property_def.text is not None and property_def.text.strip() != "": f.write(f"{format_text_block(property_def.text.strip(), property_def, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this property. Please help us by :ref:`contributing one `!" + ) + + "\n\n" + ) index += 1 @@ -925,6 +956,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if m.description is not None and m.description.strip() != "": f.write(f"{format_text_block(m.description.strip(), m, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this constructor. Please help us by :ref:`contributing one `!" + ) + + "\n\n" + ) index += 1 @@ -945,6 +984,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if m.description is not None and m.description.strip() != "": f.write(f"{format_text_block(m.description.strip(), m, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this method. Please help us by :ref:`contributing one `!" + ) + + "\n\n" + ) index += 1 @@ -967,6 +1014,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if m.description is not None and m.description.strip() != "": f.write(f"{format_text_block(m.description.strip(), m, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this operator. Please help us by :ref:`contributing one `!" + ) + + "\n\n" + ) index += 1 @@ -992,6 +1047,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if theme_item_def.text is not None and theme_item_def.text.strip() != "": f.write(f"{format_text_block(theme_item_def.text.strip(), theme_item_def, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this theme property. Please help us by :ref:`contributing one `!" + ) + + "\n\n" + ) index += 1 -- cgit v1.2.3