Skip to content

Rewrite the "Docutils markup API" page #12505

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

Docutils represents document source lines in a class
``docutils.statemachine.ViewList``. This is a list with extended functionality
-- for one, slicing creates views of the original list, and also the list
contains information about the source line numbers.
Copy link
Member

Choose a reason for hiding this comment

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

Here's a fun fact for you; the docutils parser (incorrectly IMO) uses the offset into the StringList, rather than the actual source line you assign to the line, to report most warnings, making the source information kind of meaningless 😒

see e.g. https://github.com/live-clones/docutils/blob/0e6d91c9272f062257cbeb007eb075a7a62c5ebc/docutils/docutils/parsers/rst/states.py#L429-L434

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.

Nice thanks

@AA-Turner AA-Turner changed the title Rewrite "Parsing directive content as reStructuredText" Rewrite the "Docutils markup API" page Jul 3, 2024
@AA-Turner AA-Turner merged commit b5b383f into sphinx-doc:master Jul 3, 2024
23 checks passed
@AA-Turner AA-Turner deleted the directive-parse-rst/markup-docs branch July 3, 2024 01:09
@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants