From 50498d237e13d2dcf52ed64089edb6ded54abc91 Mon Sep 17 00:00:00 2001 From: Miguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org> Date: Tue, 17 Sep 2024 11:36:02 +0200 Subject: [PATCH] Add title for hanging paragraph in nav --- toMkdocs/toMkdocs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toMkdocs/toMkdocs.py b/toMkdocs/toMkdocs.py index 34b414f..83d2b47 100644 --- a/toMkdocs/toMkdocs.py +++ b/toMkdocs/toMkdocs.py @@ -34,7 +34,7 @@ class LineType(Enum): @dataclass class Line: """ Represents a line in the markdown file. """ - text:str + text:str = '' lineType:LineType = LineType.TEXT @@ -345,7 +345,8 @@ def prepareForMkdocs(clauses:list[Clause], includeHangingParagraphs:bool = False if not includeHangingParagraphs: clauses[i].lines = [] else: - clauses[i].lines = [Line("<mark>Editor note: This is a hanging paragraph and it must be moved to its own clause</mark>")] + clauses[i].lines + clauses[i].title = "Hanging Paragraph" + clauses[i].lines = [Line("<mark>Editor note: This is a hanging paragraph and it must be moved to its own clause</mark>"), Line()] + clauses[i].lines # Repair wrong markdown for indented lines. # Add 2 spaces to existing 2-space indentions -- GitLab