I wrote a Tampermonkey (browser extension) script ...
# shameless-promo
p
I wrote a Tampermonkey (browser extension) script today to add some custom buttons to the GitHub writing toolbar. Some utility features to help make AI-written comments suck less. Let me know if anyone else finds it useful 🙂 github.com/ewels/gfm-tidy
👌 3
😯 1
✌️ 1
l
That's really nice, how does it work behind the scene ?
p
1000 lines of glorious javascript 😆
Do you know tampermonkey.net / userscripts? Basically they are a browser plugin that let you inject custom scripts on page load.
So this matches any github URLs and activates on those pages. Then the javascript looks for any comment boxes rendered on the page, and messes with them basically
I started off with one button to do the unwrap thing, but then was looking at all the default buttons that I never use (headings, bold, etc - basic markdown stuff) and thinking about the things that I often find myself doing in vscode. Hence getting a bit carried away with adding new buttons for admonitions,
<details>
expanding areas etc 😅
The nice thing about doing it in the comment editor is that you can easily select text to wrap around
Tampermonkey is a bit of a faff, is the only downside. So it's a bit of a hacker solution. I could probably put it into a Chrome plugin or similar, but not sure I can be bothered 👀
l
It does works nicely ! I'll definitely use it 😉
🎉 1
p
Oh the irony 😆
😄 1