Skip to content
Snippets Groups Projects
Commit 6dcbedae authored by Andreas Kraft's avatar Andreas Kraft
Browse files

Debugging

parent da20debb
No related branches found
No related tags found
No related merge requests found
......@@ -391,16 +391,21 @@ class Document:
file.write(f'{indentation}- {navTitle}:\n')
for i, f in enumerate(self.clauses):
if not f.title:
print("continue")
continue
# TODO handle if the next clause is more than one level deeper
_title = f.title.replace("'", '"')
nextClause = self.clauses[i+1] if i+1 < len(self.clauses) else None
if nextClause is None or nextClause.level <= f.level:
file.write(f" {' '*f.level}- '{_title}': '{navTitle}/{f.clauseNumber}.md'\n")
file.write(f"{indentation}{' '*f.level}- '{_title}': '{navTitle}/{f.clauseNumber}.md'\n")
else:
file.write(f" {' '*f.level}- '{_title}':\n")
file.write(f"{indentation}{' '*f.level}- '{_title}':\n")
if len(f) > 0:
file.write(f" {' '*nextClause.level}- 'Introduction': '{navTitle}/{f.clauseNumber}.md'\n")
file.write(f"{indentation}{' '*nextClause.level}- 'Hanging paragraph': '{navTitle}/{f.clauseNumber}.md'\n")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment