c4rlo / vimhelp

Google App Engine based project which regularly generates HTML versions of the Vim help files
https://vimhelp.org
MIT License
83 stars 9 forks source link

Frequent Hidden Links #16

Closed kfollstad closed 3 years ago

kfollstad commented 3 years ago

Hi @c4rlo

First off, I wanted to say thanks for making this site. I find it to be very useful as an alternative to viewing vim's help in a split, allowing you to throw it up on a secondary monitor at an arbitrary font size when you need to dig into the manual for a longer read or if you want to look something up when you just have your phone on you.

One thing I noticed while using the site was that there are a lot of hidden clickable links (that link to the various vim tags). This seems like an antipattern to me - and can result in a lot of accidental navigations if someone highlights text as they read or if they are touching the page to scroll on a mobile device.

I submitted a one liner for you consideration in the hopes that it would help others avoid those issues. The PR does however have the downside of exposing that there are a lot of embedded 'd' links - perhaps more tags are linked than are actually desirable.

For example, in sentences from the help like: _A_ common mistake _is_ to have _a_ line with _a_ _space_ or tab

I just took a brief look at the code, but it seemed like one possible solution to this was to filter the vim tags against a blacklist (which could just be a file of common English words) before passing them in as a list of tag-file tuples into VimH2H (in /vimhelp/vimh2h.py). At least that was my thought but I might have missed some relevant details. Anyhow I don't know if you think that would be a worthwhile enhancement as well but I thought I would throw it out there, in case it might be helpful.

c4rlo commented 3 years ago

Thank you for your feedback! Your concern makes sense to me. I will take a closer look when I get some time.

c4rlo commented 3 years ago

How does https://vimhelp2.uc.r.appspot.com/ (my staging instance) look to you? It has:

a.d { color: black; }
a.d:link, a.d:visited { text-decoration: underline silver; }
a.d:active, a.d:hover { text-decoration: underline black; }

Feels like a reasonable compromise to me.

kfollstad commented 3 years ago

Nice! I think it is an improvement - the reader gets a subtle visual clue as to where there are links but without being visually overwhelmed by all of them. Particularly on mobile, my impression was that would be fewer accidental clicks while scrolling with the new styling. Thanks for taking up this issue!

c4rlo commented 3 years ago

Awesome. This change is now live.