Join GitHub today
Create syntax-highlighted RTF snippets for pasting into, e.g., Keynote #26
I'm going to paste the body here in case the gist goes away. But the comments look pretty useful, e.g. using alternative highlighters like Pygments..
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Highlight your source. "highlight -O rtf myfile.php | pbcopy". This will highlight the source code in RTF format and copy the result of that operation to your Mac's clipboard.
Paste into your slide in Keynote. Keynote will create a new text box with your highlighted code. You can adjust the width as needed, and adjust the font size with cmd+ and cmd-
@yihui Do you have any thoughts on the basic problem? Which is creating syntax highlighted snippets that are convenient to paste into, say, Keynote. I frequently render to Word, so I can copy and paste with style. And then I still have to fiddle with the text background. It feels ridiculous.
I have never used Keynote myself, but I think this is definitely doable (I don't know how to solve the background issue, though; will