Skip to content

Add allow_section_headings to SphinxDirective parsing methods #12503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Jul 2, 2024

See #12492.

A

@chrisjsewell
Copy link
Member

chrisjsewell commented Jul 2, 2024

Thanks @AA-Turner, my one question would be; is it clear to user what "allowing titles" means?
Perhaps it might be nicer to change it to allow_headings or something?
Or make it clearer in the param docstrings, that by titles we mean headings?

As per #12492 (comment), I'll just link here my little "blog" on the difficulties of allowing nested headings https://gist.github.com/chrisjsewell/0c5827add50074fef0937e2543e955b4

@AA-Turner AA-Turner changed the title Add allow_titles to SphinxDirective parsing methods Add allow_section_headings to SphinxDirective parsing methods Jul 2, 2024
Comment on lines +440 to +446
:param allow_section_headings:
Are titles (sections) allowed in the directive's content?
Note that this option bypasses Docutils' usual checks on
doctree structure, and misuse of this option can lead to
an incoherent doctree. In Docutils, section nodes should
only be children of ``Structural`` nodes, which includes
``document``, ``section``, and ``sidebar`` nodes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much better thanks!

Copy link
Member

@chrisjsewell chrisjsewell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cheers!

@AA-Turner AA-Turner merged commit 24a0385 into sphinx-doc:master Jul 2, 2024
23 checks passed
@AA-Turner AA-Turner deleted the directive-parse-rst/allow-titles branch July 2, 2024 22:54
@AA-Turner AA-Turner added this to the 7.4.0 milestone Jul 13, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants