Skip to content

GH-121970: Extract issue_role into a new extension - #130615

Merged
AA-Turner merged 5 commits into
python:mainfrom
AA-Turner:docs/issue-role
Feb 27, 2025
Merged

GH-121970: Extract issue_role into a new extension#130615
AA-Turner merged 5 commits into
python:mainfrom
AA-Turner:docs/issue-role

Conversation

@AA-Turner

@AA-TurnerAA-Turner commented Feb 26, 2025

Copy link
Copy Markdown
Member

@AA-TurnerAA-Turner added docs Documentation in the Doc dir skip news needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Feb 26, 2025
@AA-TurnerAA-Turner changed the title GH-121970: Extract issue_role into a new extensionGH-121970: Extract issue_role into a new extensionFeb 26, 2025
Comment threadDoc/tools/extensions/issue_role.py
Comment threadDoc/tools/extensions/issue_role.py Outdated
return [prb], [msg]

issue_url = self.ISSUE_URI.format(issue)
refnode = nodes.reference(issue, f"bpo-{issue}", refuri=issue_url)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here we're passing something like 12345 and bpo-12345 as the first two arguments.

Before we were passing something like bpo-12345 and bpo-12345 for both.

I see the second one is used in the refnode:

<reference refuri="https://bugs.python.org/issue?@action=redirect&bpo=13936">bpo-13936</reference>

How is the first one used?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

It's the docutils rawsource, it should reflect what was actually written in the document.

Sphinx uses this for translation, I don't think these nodes are translatable but I'll double check.

A

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

See e.g. https://github.com/python/python-docs-fr/blob/3.13/whatsnew/3.13.po#L394-L399, the whole role is included in the translation string.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So should it match 12345 or bpo-12345?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(Unresolving so the question isn't hidden :)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

The text of what is actually written in the document, so "14159".

Comment threadDoc/tools/extensions/issue_role.py Outdated
AA-Turnerand others added 2 commits February 27, 2025 14:21
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

@hugovkhugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@miss-islington-app

Copy link
Copy Markdown

Thanks @AA-Turner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@AA-Turner
AA-Turner deleted the docs/issue-role branch February 27, 2025 19:06
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 27, 2025
…H-130615)
(cherry picked from commit 043ab3a)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@bedevere-app

Copy link
Copy Markdown

GH-130651 is a backport of this pull request to the 3.13 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.13 bugs and security fixes label Feb 27, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 27, 2025
…H-130615)
(cherry picked from commit 043ab3a)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@bedevere-app

Copy link
Copy Markdown

GH-130652 is a backport of this pull request to the 3.12 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.12 only security fixes label Feb 27, 2025
AA-Turner added a commit that referenced this pull request Feb 27, 2025
) (#130651)
(cherry picked from commit 043ab3a)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
AA-Turner added a commit that referenced this pull request Feb 27, 2025
) (#130652)
(cherry picked from commit 043ab3a)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants

@AA-Turner@hugovk