Highlighting code syntax in Keynote
One of the many time-consuming activities associated with giving technical talks at conferences (something I love doing) is highlighting the code syntax, like in my recent talk at State of the Browser:
Until today I didn’t know any way to do this beyond manually selecting each bit of code and changing its colour, one selector, one property, one value at a time. I recently switched from coding in the seemingly abandoned Espresso to Panic’s excellent Nova. Built right into Nova is a ‘Copy with Syntax Highlighting’ feature, which does just what you’d want it to in terms of pasting ready-formatted code straight into Keynote (or wherever).
And then, such is the way of these things, I stumbled across Sara Soueidan’s blog post which showed how to do the same thing in VS Code. Sara also pointed to the handy Slides Code Highlighter utility made by Roman Nurik, which achieves the same thing regardless of your choice of code editor.
It’s a nice reminder that despite everything, there are still nice people doing nice things for others for seemingly little reward. And speaking of which, for completion I should point you towards Prism, a free syntax highlighter developed by Lea Verou and others, and used on millions of websites including this one. It also works in ePub ebooks.