Loading toMkdocs/toMkdocs.py +8 −3 Original line number Diff line number Diff line Loading @@ -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") Loading Loading
toMkdocs/toMkdocs.py +8 −3 Original line number Diff line number Diff line Loading @@ -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") Loading