Skip to content

misleading docstring for sphinx.util.parsing.nested_parse_to_nodes() #13828

Closed

Description

@gmilde

Describe the bug

The docstring of sphinx.util.parsing.nested_parse_to_nodes() says:

... In Docutils, section nodes should only be children of Structural nodes, which includes document, section, and sidebar nodes.

However, "section" elements can only be children of "document" or "section" elements, not "sidebar".

How to Reproduce

See <section> in "The Docutils Document Tree" and the Docutils Generic XML document type definition (DTD) docutils.dtd.

Activity

  1. AA-Turner commented on Aug 10, 2025

    @AA-Turner
    Member

    Would you be able to create a PR @gmilde?

    A

  2. gmilde commented on Aug 11, 2025

    @gmilde
    Author
  3. AA-Turner commented on Aug 11, 2025

    @AA-Turner
    Member

    Thank you for the patch! It's easier on our end to manage things through the PR workflow though if at all possible.

    Providing a PR is not simple, as I don't have a developer install...

    It should be fairly simple, you don't need to install anything to make a change to a docstring. We have a contributor guide but the essential steps would be:

    $ git clone https://github.com/sphinx-doc/sphinx.git
    $ cd sphinx
    $ git switch -c <branch name here>
    $ git am -3 <patch name here>.patch
    $ git commit -a
    $ git push
    

    If you open a PR, you will be shown as the commit author etc, but that gets lost if I open one on your behalf.

  4. gmilde commented on Aug 11, 2025

    @gmilde
    Author
  5. timhoffm commented on Aug 11, 2025

    @timhoffm
    Contributor

    For simple doc changes, where you don’t want to test anything locally, you can alternatively do everything through the GitHub interface:

    1. fork the repo (if you haven’t done already)
    2. make a new branch
    3. go to the file you want to change and edit it.
    4. you should be able to commit your changes directly to your new branch and GitHub should suggest to make a pull request
  6. locked as resolved and limited conversation to collaborators on Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions