Skip to content
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

Infra: Add tooltips to type/status in PEP 0 #2838

Merged
merged 10 commits into from
Oct 22, 2022
Merged

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Oct 19, 2022

We can use :abbr:`MET (my excellent tooltip), which is turned into <abbr title="my excellent tooltip">MET</abbr> to show what the initials in the PEP 0 tables mean.

Browsers often style them with a dotted underline to indicate hoverability.

For example:

image

Also fix a couple of Flake8 findings: remove the f from plain strings.

Preview

@hugovk hugovk added the infra Core infrastructure for building and rendering PEPs label Oct 19, 2022
@hugovk hugovk requested a review from AA-Turner as a code owner October 19, 2022 13:57
Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Good idea!

Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

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

+1 to the idea

I think it makes more sense to implement in PEP.details though, and return a shorthand key instead of type and status, where the shorthand key would contain the result of the call to the new function. This also means the new function doesn't have to work backwards to get the full properties.

A

@hugovk
Copy link
Member Author

hugovk commented Oct 19, 2022

Updated! Like this?

Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

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

Great idea @hugovk ; I'd been hoping to do something about that for quite a while but had never gotten the time to actually do something. And +1 to @AA-Turner 's suggestion as well, which it looks like you implemented as at least I would interpret it.

One other nice improvement would be eliding redundant labels present in most tables, e.g. P in process PEP tables, I in informational PEP tables, A in accepted PEPs, etc. But if that's not trivially achievable here (or not non-controversial), that can go in a separate issue.

pep_sphinx_extensions/pep_zero_generator/parser.py Outdated Show resolved Hide resolved
hugovk and others added 2 commits October 20, 2022 11:45
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
@AA-Turner
Copy link
Member

@hugovk I pushed what I meant to this branch as it was too complicated for inline suggestions -- please revert / etc if you want to take a different route, but this was the line I was going down (it also fixes a slight bug in the old implementation with e.g. 581, 602 which were marked as Active rather than Accepted).

A

Copy link
Member Author

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Thanks, looks good! One little style nit :)

.pre-commit-config.yaml Outdated Show resolved Hide resolved
hugovk and others added 2 commits October 22, 2022 10:34
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@hugovk hugovk merged commit c0b28da into python:main Oct 22, 2022
@hugovk hugovk deleted the infra-tooltips branch October 22, 2022 07:43
@AA-Turner
Copy link
Member

Thanks Hugo!

A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Core infrastructure for building and rendering PEPs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants