Comment by mcraiha
14 days ago
Tip for all the blog authors, do NOT post code as image. Specially do not add fake editor UI and drop shadow to the image.
In this case 25 lines of code is 50 kB of image binary.
Also it cannot be searched via search engine. Nor can it be read with screen reader.
Pro tip for everybody: do not post any text as images
Never should I receive a Java exception hundreds of lines long as a cut off JPEG file.
Or a screenshot of a Google Sheet missing the information you’re talking to me about.
We made this to be used as a reply when pictures are misused where text would be better:
https://fewer.pics/
I’m disappointed the rendered picture isn’t advanced CSS. I honestly expected that to be the case.
1 reply →
It should have been animated.
1 reply →
Why ruin the message by writing half of it upside down?
2 replies →
This guide can help if you still want the code to be pretty: https://www.taniarascia.com/adding-syntax-highlighting-to-co...
Or use vim to convert it to HTML https://vi.stackexchange.com/questions/792/how-to-convert-a-...
OCR's come pretty far these days and I can select text off an image with my iPhone processing it locally with a fair bit of success.
It’s also terrible copy-pasting and CMD+F experience.
As long as such 50kB image doesn’t get replaced with 700kB of javascript bundles for coloring code.
I mean, if such coloring it's going to be done, it should be done with HTML/CSS.
For the OP article, for screenreaders perhaps you are sugesting people to use the alt attribute or similar.
[flagged]