I often write mails that partly consist of source code, like Java or C (or any other arbitrary code).
In order to get the formatting right, I always have to:
- Paste the code
- Indent it correctly
- Change the font to a monospaced one
- Maybe apply boldface to some keywords to improve readability
- Hit Enter a few times and change the font back to sans-serif
Now, there are wonderful code highlighting libraries out there. Isn't there an easy way to be able to send code that is easily and beautifully formatted within mails composed in Gmail?
Update: I have some solutions now, one involving copying and pasting to an online syntax highlighter. The real solution I was hoping for is some kind of extension maybe that highlights pasted code in place, meaning I'd only have to paste to Gmail, select the code, and then click a button or hit a keyboard shortcut.
I'm on OS X, if that matters, although I guess this is easier to do with a browser-based solution.