reddit / emacs

[ANN] unpackaged/imenu-eww-headings: Offer HTML headings in EWW buffers with Imenu

github-alphapapa · 2022-04-12 16:29
Phil-Hudson · 2022-04-12 19:06
What a good idea! Once you see it, you wonder why it wasn't standard already.
XCapitan_1 · 2022-04-12 19:47
Do any of you actually use eww for browsing? I'm just curious. I occasionally open eww from elfeed, but that's about it. And only those sites that I know look well with it.
oantolin · 2022-04-13 00:31
I have a slightly different take on this in my configuration, in library [shr-heading.el](https://github.com/oantolin/emacs-config/blob/master/my-lisp/shr-heading.el). In addition to imenu support I wanted next and previous heading navigation commands. It turns out you then get imenu support for free, since one way you can specify imenu entries is by providing a "goto previous imenu entry" function. I renamed it shr-heading.el instead of eww-heading because I realized it's useful in other places that use shr too, not just in eww. I use it in elfeed-show-mode too, and am considering using it in gnus-article-mode.
oantolin · 2022-04-13 00:41
I don't use it for all browsing, but I do like it for websites where I expect to basically just read text. First, I configure shr to ignore website colors, `(setq shr-use-colors nil)`. That alone makes a small but significant fraction of websites more readable: there is some weird trend of using very thin gray letters against a slightly lighter gray background (I suspect it's gate-keeping to make sure only young people with very good eyes can read the website). Second, it's sad how many websites that really just serve text improve a lot without JavaScript. Third, plenty of websites have no regard for reasonable line widths, and my Emacs frame and font size are chosen to make lines readable. For webpages with lots of images, or with video or audio files, or that use MathJax I do use a normal browser.
7890yuiop · 2022-04-13 02:10
Could you please raise a feature request for this upstream? It sounds like a no-brainer enhancement for these standard features.
_viz_ · 2022-04-13 04:10
If it makes you feel any younger, I find most websites have poor contrast (especially the dark themed ones). The annoyance with "light" theme extends to Emacs themes as well unfortunately. I wonder if I am the only person in their early twenties that struggles with this...
paretoOptimalDev · 2022-04-13 20:55
I do when I know i'm where to go and that i'm just going to copy paste one or more things into emacs. Sometimes I try research and searching but my mind isn't used to the text interface enough yet or something. If I get used to this imenu interface that could change.
github-alphapapa · 2022-04-21 21:00
I probably will eventually, but I have a lot of other Emacs projects at the moment. :) I have FSF copyright assignment for Emacs, so feel free to pitch the code at them (or maybe someone else will find a better solution).
github-alphapapa · 2022-04-21 21:01
Sometimes, sure. As you said, it depends on the content. It happens to work very well for, e.g. https://spec.matrix.org/v1.2/client-server-api
github-alphapapa · 2022-04-21 21:08
That looks great! Would you consider upstreaming it? Or even contributing it to `unpackaged` to replace this would be nice. :)
fuzzbomb23 · 2022-11-18 10:50
The [shrface](https://melpa.org/#/shrface) package also has exposes headings to Imenu.
github-alphapapa · 2022-11-18 21:46
Good point. One of these ought to be upstreamed...