Skip to content

Commit 9d7070e

Browse files
committed
🐛 fix(toctree): use section node when title is empty
When :title: was set to empty, a paragraph node was used as the container instead of a section. Child group headings weren't recognized by toctree since they weren't inside a proper section hierarchy. Fixes #48
1 parent 7bc2756 commit 9d7070e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/sphinx_argparse_cli/_logic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def run(self) -> list[Node]:
187187
self.env.note_reread() # this document needs to be always updated
188188
title_text = self.options.get("title", f"{self.parser.prog} - CLI interface").strip()
189189
if not title_text:
190-
home_section: Element = paragraph()
190+
home_section: Element = section("")
191191
else:
192192
home_section = section("", title("", Text(title_text)), ids=[self.make_id(title_text)], names=[title_text])
193193

0 commit comments

Comments
 (0)