highlights clipboard code for Keynote presentations
If you are presenting code, you should do this as text, as people could copy it after you share your slides. There is no option for code in Keynote, so here is a simple way to do this.
First install hightlight
on your Mac using Homebrew.
# be sure to update brew
sudo brew update
# when updated install highlight
sudo brew install highlight
This could take a while. Meanwhile, you can copy the function
into your ~/.profile
file.
Open another shell session on Terminal.app, copy the code you want to highlight and run:
# syntax [theme] [font-size]
hc js malokai 40
The RTF result of code highlighting is now copied to your clipboard. Paste it on Keynote and voilá, color was added to your code.
PROTIP: run highlight -w
to see a list of available themes.