From 1f772917d2cf0fce441c7d3b0b2cb808ffbeb934 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 24 Oct 2019 19:06:09 +0200 Subject: [PATCH] makerst: Separate signals/enums/properties/methods with a line (cherry picked from commit c2e5ef4cec37597d472250370eda5a3696700bb1) --- doc/tools/makerst.py | 49 ++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 18772d103da..98735c58675 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -425,21 +425,30 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S # Signals if len(class_def.signals) > 0: f.write(make_heading('Signals', '-')) + index = 0 + for signal in class_def.signals.values(): - #f.write(".. _class_{}_{}:\n\n".format(class_name, signal.name)) + if index != 0: + f.write('----\n\n') + f.write(".. _class_{}_signal_{}:\n\n".format(class_name, signal.name)) _, signature = make_method_signature(class_def, signal, False, state) f.write("- {}\n\n".format(signature)) - if signal.description is None or signal.description.strip() == '': - continue - f.write(rstize_text(signal.description.strip(), state)) - f.write("\n\n") + if signal.description is not None and signal.description.strip() != '': + f.write(rstize_text(signal.description.strip(), state) + '\n\n') + + index += 1 # Enums if len(class_def.enums) > 0: f.write(make_heading('Enumerations', '-')) + index = 0 + for e in class_def.enums.values(): + if index != 0: + f.write('----\n\n') + f.write(".. _enum_{}_{}:\n\n".format(class_name, e.name)) # Sphinx seems to divide the bullet list into individual