-
-
Notifications
You must be signed in to change notification settings - Fork 841
Add a Sphinx role to link to GitHub labels #932
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
Conversation
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.
Neat!
This might also be helpful in a couple of other places in the devguide that link e.g. to doc or easy issues, but I wonder if it's a bit overkill to create a role just for it 🤔
This will only work by clicking through the links manually, right? Even invalid labels will return a valid search page with no results, so we won't be able to detect them automatically. Also, FWIW, I'm fixing that section in #930. |
My thinking behind creating a role was that we can define all the params stuff in a single place, and it'll then also be consistent. Using GitHub's defaults here:
It also deals with escaping and quoting labels that contains spaces.
Yep.
Correct, just for manual checking.
Great, I knew you were working on it somewhere, thank you! |
Any particular reason to sort by last update rather than the default of opening time? I don't know if it makes any difference on the load on GH. |
I used the default options GitHub gave me after clicking one of the labels in the issue list, at https://github.com/python/devguide/issues Here's timings in a fresh Incognito window with local cache disabled, 3 loads for each. The URLs used in this PR:
The same but removing the
About the same? But perhaps using the |
Definitely; I'd go for that. |
Updated! |
I searched through the devguide and I can confirm these are the only two places where they are currently used, but they link to issues only so we might not be able to use the new role if it links to https://github.com/python/cpython/labels/{LABEL-NAME}:
In #930 I can add links to all the labels (the currently proposed link would work fine there), and I was also planning to add a page with several useful search queries (there it won't work). In addition in #930 I have another link that won't be able to use the role: https://github.com/python/cpython/labels?q=expert. IOW, it looks like this role will be only useful in the page that lists the label, unless we make it more flexible. |
Yep, that's right. Originally this PR used ugly links like So it's less useful than before, but I think it's more readable to see But I'm happy to close this, or replace with normal links, or wait for normal links in #930 :) |
This adds a
:gh-label:
role to link to a GitHub label on https://github.com/python/cpython.For example:
`:gh-label:`docs`
->https://github.com/python/cpython/issues?q=is%3Aopen+sort%3Aupdated-desc+label%3Adocs
:gh-label:`skip news`
->https://github.com/python/cpython/issues?q=is%3Aopen+sort%3Aupdated-desc+label%3A%22skip+news%22
This makes it easy to click through to see recent examples of the actual label in use.
It also helps #821 because we can click through and find which labels have since been deleted (e.g.
invalid
) or renamed (library
).