Hacker News new | ask | show | jobs
by strangetortoise 1942 days ago
I think one of the problems here is that people wanna share code snippets on social media, where generally, the other approaches mean linking to an external github gist or similar, which isn't as visible. I'm not sure if I see a good solution, other than suggesting that the "link previews" for social media sites display the code snippet inline, if it's a link to a pastebin/github gists page.

Edit: Perhaps something can be done by somehow embedding the content into the image (EXIF?) Metadata?

3 comments

Yeah, I was just about to suggest embedding the code in a PNG text chunk: http://www.libpng.org/pub/png/book/chapter11.html#png.ch11.d...

Twitter etc should really already have standardised on a way to store the ALT text in an image so it only ever needs to entered once.

Even GIF has support for text in a couple of different forms.

( Although I learned something new about PNG's support for GIF's text support here: http://www.libpng.org/pub/png/book/chapter11.html#png.ch11.d... )

( I've spent far too long reading the GIF spec in relation to my project that adds audio to GIFs: http://audiogif.rancidbacon.com :) )

Twitter actually supports picture descriptions. I think it embeds it in the alt-text on the page.

https://help.twitter.com/en/using-twitter/picture-descriptio...

Is there way to keep it as text, but make it uneditable? Ohh.. wait!