🐛 fix(toctree): use section node when title is empty#291
Merged
gaborbernat merged 1 commit intotox-dev:mainfrom Mar 2, 2026
Merged
🐛 fix(toctree): use section node when title is empty#291gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat merged 1 commit intotox-dev:mainfrom
Conversation
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 tox-dev#48
9d7070e to
b643d7b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
:title:is set to empty to suppress the auto-generated heading, the directive used aparagraphnode as the root container. This broke toctree detection — child group headings like "positional arguments" and "options" were rendered as<h2>in the HTML but weren't discoverable by Sphinx's toctree because they weren't nested inside a propersectionhierarchy. 🐛The fix switches the empty-title container from
paragraph()tosection(""), preserving the document structure that toctree relies on while still suppressing the visible heading. This matches the behavior users expect when they provide their own document title via RST and use:title:to avoid a duplicate.Fixes #48