News for hackers. Stuff that matters.

Show HN: Code Snippet Formatter – for email and docs

https://snippet-formatter.vercel.app/

I got tired of pasting code snippets into emails etc which always look rubbish, sure I could open up an IDE and copy from there but then I have to create new files. Anyway I made a quick tool to do this for me - kudos to torchlight.dev for the syntax highlighting API. Hope someone finds this useful!
( 3 comments | 4 points | on HN )
Re:Show HN: Code Snippet Formatter – for email and docs by ryan-duve on Tuesday April 12, 2022 @12:53PM (#31005197)
Super neat, thanks for posting.

If you're looking for suggestions for improvement, I noticed the line numbers didn't make it when I pasted into Gmail. If that is unexpected it might be worth looking into.

Re:Show HN: Code Snippet Formatter – for email and docs by georgewr on Wednesday April 13, 2022 @04:47AM (#31012461)
Great feedback, it was intentional - however I think maybe I will add a toggle to give people the option. Thanks!
Re:Show HN: Code Snippet Formatter – for email and docs by vanpythonista on Thursday April 14, 2022 @12:01PM (#31028736)
The Copy to Clipboard button doesn’t seem to be working in Safari (iOS 15).