Skip to content

gh-127833: Fix grammar snippet formatting for help() output - #129692

Closed
encukou wants to merge 6 commits into
python:mainfrom
encukou:doc-grammar-snippets
Closed

gh-127833: Fix grammar snippet formatting for help() output #129692
encukou wants to merge 6 commits into
python:mainfrom
encukou:doc-grammar-snippets

Conversation

@encukou

@encukouencukou commented Feb 5, 2025

Copy link
Copy Markdown
Member

Change pydoc_data to show the "input" of grammar snippet
directives, which is formatted the way we want.

See also this Sphinx issue: sphinx-doc/sphinx#13302
And: sphinx-doc/sphinx#4454

A known issue is cross-grammar links, like those in
the string format specification mini-language, which render
as reST source:

element_index: `~python-grammar:digit`+ | `index_string`

I don't see a good way to fix this before Sphinx is refactored.


📚 Documentation preview 📚: https://cpython-previews--129692.org.readthedocs.build/

Change pydoc_data to show the "input" of grammar snippet
directives, which is formatted the way we want.
See also this Sphinx issue: sphinx-doc/sphinx#13302
And: sphinx-doc/sphinx#4454
A known issue is cross-grammar links, like those in
the string format specification mini-language, which render
as reST source:
element_index: `~python-grammar:digit`+ | `index_string`
I don't see a good way to fix this before Sphinx is refactored.
This is usually done at release time.
Comment threadLib/pydoc_data/topics.py Outdated
Comment threadDoc/tools/extensions/pydoc_topics.py
Comment threadDoc/tools/extensions/pydoc_topics.py Outdated
Comment threadDoc/tools/extensions/pydoc_topics.py Outdated
@hugovk

hugovk commented Feb 6, 2025

Copy link
Copy Markdown
Member

(re: https://github.com/python/cpython/actions/runs/13162643246/job/36735040454?pr=129692, I've updated the branch from main to pull in the new change detection (#129627))

@encukou

Copy link
Copy Markdown
MemberAuthor

Thank you!
Does the change look good now?

@encukou

Copy link
Copy Markdown
MemberAuthor

This PR was made obsolete by new Sphinx and #130376. Thank you Adam!

@encukouencukou closed this Mar 20, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@encukou@hugovk