-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Convert PR numbers in docs/change_log to clickable links #4346
Convert PR numbers in docs/change_log to clickable links #4346
Conversation
Uses the sphinx include-read event to regex replace all occurrences of a PR number `(#X)` with a link `[(#X)](https://github.com/psf/black/pull/X)`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
docs/conf.py
Outdated
|
||
|
||
def handle_include_read( | ||
app: Sphinx, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we're not formatting this file with Black? Let's fix that in a separate PR though.
The preview is at https://black--4346.org.readthedocs.build/en/4346/change_log.html, looks great! |
Looks very clean! I skimmed the changelog and I did find a few inconsistencies that weren't always linked properly:
It may be easiest to linkify all mentions, even if outside parenthesis. |
Oops sorry, I merged just as @RedGuy12's comment appeared. Agree it makes sense to linkify all instances of |
Good point, I overlooked that there were inconsistencies, didn't scroll that far 😄 - `Black` is now more awesome (#X) Also, some people mention issues in the descriptions which would then cause invalid links. |
Issue links are actually fine, GitHub redirects them. I put up an implementation in #4347. |
Alright, thanks for the review! |
Description
Closes #4258.
This adds a listener to the sphinx
include-read
event to find all PR numbers(#X)
with regex and replace them with the corresponding link[(#X)](https://github.com/psf/black/pull/X)
.I didn't add an entry to
CHANGES.md
since this seems like a rather minor docs change.Checklist - did you ...
CHANGES.md
if necessary?