glowfic-constellation / glowfic

The Glowfic Constellation
https://www.glowfic.com
MIT License
17 stars 11 forks source link

Add alt text to images #836

Open Throne3d opened 6 years ago

Throne3d commented 6 years ago

The most general rule to consider when writing alternative text is the following: the intent is that replacing every image with the text of its alt attribute not change the meaning of the page.

So, in general, alternative text can be written by considering what one would have written had one not been able to include the image.

A corollary to this is that the alt attribute's value should never contain text that could be considered the image's caption, title, or legend. It is supposed to contain replacement text that could be used by users instead of the image; it is not meant to supplement the image. The title attribute can be used for supplemental information.

https://html.spec.whatwg.org/multipage/images.html#alt

The context this came up in was copying & pasting a thread list containing hiatused threads, labeled with alts of "Hourglass". Instead, "Hiatused" or "(Hiatused)" or some such should be used. It looks like describing the picture should only be done if the point of the picture is to showcase the picture – that is, pictures that are used as icons to represent something else should not be described, but instead we should describe [the "something else", here "hiatused"]. It looks like a lot of current alt text is autogenerated from image names.

teceler commented 4 years ago

Improved by #1242 but we probably still need to audit for Unhelpful Alt Text

Marri commented 4 years ago

Hmm, is there a way to set a linter for this going forward? Even a presence check would help, since presence-and-helpfulness is probably hard. Or maybe we already have that and just need to audit historically.

teceler commented 4 years ago

I think haml-lint checks for presence/absence of alt text, that was how I found all the ones missing it