# A browser extension to show key data about a PEP

**URL:** <https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645>\
**Category:** Discourse Feedback\
**Created:** [December 18, 2024, 9:47pm UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645 "2024-12-18T21:47:47Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![loic-simon](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/loic-simon/32/37461_2.png) [@loic-simon](https://discuss.python.org/u/loic-simon)\
**Post date:** [December 18, 2024, 9:47pm UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645/1 "2024-12-18T21:47:47Z")

</div>

When talking about PEPs, we often refer to them only by their number (as in “PEP 705”), sometimes without a link or any information about their subject.

I don’t think it’s inherently a bad habit: if you actually know that PEP number, it’s the most concise of referring to it unambiguously, saving time for both the writer and the reader.

If you don’t, though, you tipically have to search it up – not necessarily to read the whole PEP, but just to figure out “ah yes, it’s that one!” or “oh right, it deals with that subject, written 15 years ago!”

In some discussions covering a lot of background with different PEPs involved, I found that this quickly led to a lot of back and forth between Discourse and the PEP pages, with the consequent loss of focus and time.

* * *

To make this experience easier, I’d like to present here a small Chrome extension I’ve developed for myself, if anyone here finds it useful: [**PEP Tooltip**](https://chromewebstore.google.com/detail/pep-tooltip/fkheggfpgnfefhdannmjnkjehjnceokl)!

Features :

- Add a ℹ character\[1\] alongside each “PEP XXX” pattern in any [discourse.python.org](http://discourse.python.org) message;
- On hover, reveals a small tooltip containing key information\[2\] about this PEP (fetched from [peps.python.org](http://peps.python.org) official API), with a link to the PEP;
- Integrates well in both dark and light modes, and within various markdown / Discourse markups;
- Handles new posts loaded when scrolling a page;
- Lightweight, only requires read / update permission on [discourse.python.org](http://discourse.python.org), does not collect any data whatsoever;
- Totally open source (written in TypeScript); I wholeheartedly welcome any feedback or contributions on [the GitHub repo](https://github.com/loic-simon/pep-tooltip)!

While I only tested it on Chrome, I’m pretty sure it works well on any Chromium-based browser. I’m totally open to the idea of making a Firefox version if there is interest!\[3\]

* * *

_Hope this kind of message is welcome in #Discourse Feedback; since it meta and Discourse-specific, I thought so, but I can move it to #Python Help or anywhere 😄_

* * *

1. I tried to use various Unicode symbols and a custom SVG, I found this emoji the most usable (automatically adjusts to text size/style) and portable across plarforms (all Unicode characters are not), but this is open to change! 

2. Picked somewhat arbitrairely, open to change! 

3. I considered making it a Discourse plugin, but what I wanted looked _way_ arder to achieve, if even possible…

---

<div class="post-metadata">

**Author:** ![stoneleaf](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/stoneleaf/32/88_2.png) [@stoneleaf](https://discuss.python.org/u/stoneleaf)\
**Post date:** [December 18, 2024, 10:45pm UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645/2 "2024-12-18T22:45:21Z")

</div>

[In this post](https://discuss.python.org/t/finding-a-bloc-star-provider/73918) PEP 13 (both inside and outside a link) aren’t being tagged.

Still, a very cool tool!

---

<div class="post-metadata">

**Author:** ![loic-simon](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/loic-simon/32/37461_2.png) [@loic-simon](https://discuss.python.org/u/loic-simon)\
**Post date:** [December 18, 2024, 10:54pm UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645/3 "2024-12-18T22:54:08Z")

</div>

Thanks for trying it out! Your example seem to works well for me, did you refresh after install? Do you have anything in the console?

> **Screenshot**
>
> ![image](https://us1.discourse-cdn.com/flex002/uploads/python1/original/3X/3/d/3dfe22604b6fec1bbd19352d861b7a9268a939a5.png)

(you can also [open an issue](https://github.com/loic-simon/pep-tooltip/issues) if you feel like it!)

---

<div class="post-metadata">

**Author:** ![stoneleaf](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/stoneleaf/32/88_2.png) [@stoneleaf](https://discuss.python.org/u/stoneleaf)\
**Post date:** [December 18, 2024, 10:58pm UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645/4 "2024-12-18T22:58:38Z")

</div>

> [@loic-simon](#):
>
> Your exemple seem to works well for me, did you refresh after install?

I did, but I had to refresh that page to see the changes – probably cached.

Thanks, again!

---

<div class="post-metadata">

**Author:** ![smontanaro](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/smontanaro/32/1389_2.png) [@smontanaro](https://discuss.python.org/u/smontanaro)\
**Post date:** [December 18, 2024, 11:01pm UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645/5 "2024-12-18T23:01:24Z")

</div>

Worked for me in Brave. I hadn’t looked at that page before though.

---

<div class="post-metadata">

**Author:** ![cdce8p](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cdce8p/32/3575_2.png) [@cdce8p](https://discuss.python.org/u/cdce8p)\
**Post date:** [December 19, 2024, 12:51am UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645/6 "2024-12-19T00:51:03Z")

</div>

It seems Discourse might have a feature to allow auto-replacing certain words with links. Wouldn’t that be an option as well?

> **[Watched Words Reference Guide](https://meta.discourse.org/t/watched-words-reference-guide/241735#p-1178196-link-7)**
>
> 🔖 This is a reference guide for describing how the Watched Words page functions and the different types of action types you can use to block specific words on a Discourse site. 🙋 Required user level: Administrator Understanding Watched Words...

---

<div class="post-metadata">

**Author:** ![loic-simon](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/loic-simon/32/37461_2.png) [@loic-simon](https://discuss.python.org/u/loic-simon)\
**Post date:** [December 19, 2024, 12:59am UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645/7 "2024-12-19T00:59:34Z")

</div>

Interesting! That looks useful too, but it seems to be a side-wide option (“required user level : Adminitrator”). I suppose automatically adding links to “PEP XXX” patterns would be feasible and not too controversial (and useful to all users by default!).

That doesn’t quite adress my goal though, which is to have information such as PEP title, status, date… directly in the page, without the need to click a link 😄

---

<div class="post-metadata">

**Author:** ![smontanaro](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/smontanaro/32/1389_2.png) [@smontanaro](https://discuss.python.org/u/smontanaro)\
**Post date:** [December 19, 2024, 1:17am UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645/8 "2024-12-19T01:17:00Z")

</div>

> [@cdce8p](#):
>
> It seems Discourse might have a feature to allow auto-replacing certain words with links.

That would only apply to PEP references on Discourse though, correct? What if some package’s docs referenced a PEP? Tooltips would help there as well I would think.

---

<div class="post-metadata">

**Author:** ![AA-Turner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/aa-turner/32/4979_2.png) [@AA-Turner](https://discuss.python.org/u/AA-Turner)\
**Post date:** [December 19, 2024, 6:23am UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645/9 "2024-12-19T06:23:13Z")

</div>

Ideally, documentation would link to references where appropriate \[1\] (PEPs, RFCs, etc) — e.g. in Sphinx one may use the PEP, RFC, CVE, etc roles in text. Replacing all patterns of `PEP[-][0-9]{,4}` on every webpage might lead to annoying false-positives!

A

* * *

1. and should be encouraged to if not

---

<div class="post-metadata">

**Author:** ![Nineteendo](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/nineteendo/32/19122_2.png) [@Nineteendo](https://discuss.python.org/u/Nineteendo)\
**Post date:** [December 19, 2024, 6:52am UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645/10 "2024-12-19T06:52:28Z")

</div>

Shouldn’t it add a link in the title too?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/python1/original/3X/9/2/928d1d00fba73a444d079d2750f43b2f23e84c42.png)

---

<div class="post-metadata">

**Author:** ![loic-simon](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/loic-simon/32/37461_2.png) [@loic-simon](https://discuss.python.org/u/loic-simon)\
**Post date:** [December 19, 2024, 10:26am UTC](https://discuss.python.org/t/a-browser-extension-to-show-key-data-about-a-pep/74645/11 "2024-12-19T10:26:27Z")

</div>

> [@smontanaro](#):
>
> That would only apply to PEP references on Discourse though, correct?

The extension is also limited to Discouse, both by design (I think it would be way too intrusive to alter text on all sites, and lead to false positives as Adam pointed out) and for technical reasons (for example, I use some Discourse CSS variables to handle well light vs. dark mode).

That said, I thought to extend it to other relevant sites such as GitHub, maybe some day!

> [@Nineteendo](#):
>
> Shouldn’t it add a link in the title too?

I chose to only process text in messages, to avoid annoying tooltips showing up in unexpected places throughout the site (eg. in the posts lists, in the top-right menus…)

Post titles could be special-cased, though if a PEP number is mentioned in a title, it’s very likely to appear in the first lines of the message!
