Created
November 30, 2015 19:46
-
-
Save sahilseth/d6ef3cc6df116cbdf876 to your computer and use it in GitHub Desktop.
highlight code for keynote etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Do you want to display some code in a Keynote presentation? | |
It's easy. All you need is Homebrew installed. | |
First you need to install the program highlight. | |
brew install highlight | |
So you have a piece of code. For example some Python code. The take that snippet of code and save it to a file like code.py. Now all you need to do is run this: | |
highlight -O rtf code.py | pbcopy | |
Then, switch back into Keynote and simply paste. | |
But if you don't want to create a file of the snippet, simply copy the snippet from within your editor and run this: | |
pbpaste | highlight -S py -O rtf | pbcopy | |
The -S py means "syntax is py (for python)". | |
You can use highlight for a bunch of other things like creating HTML. See man highlight for more tips. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment