Created
October 10, 2012 15:06
-
-
Save mistersourcerer/3866215 to your computer and use it in GitHub Desktop.
Colorizing Ruby [or other lang] code from command line, to paste in keynote
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
#!/bin/bash | |
#http://pygments.org/docs/cmdline/ | |
LANG="ruby" | |
if [ -n "$2" ] | |
then | |
LANG=$2; | |
fi | |
if [ -a "$1" ] | |
then | |
pygmentize -l $LANG -f rtf $1 | pbcopy | |
else | |
pbpaste | pygmentize -l $LANG -f rtf | pbcopy | |
fi |
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
color myfile.rb | |
# or, if you have the code in your "Cmmd + C area" | |
color | |
# now just go to the keynote and hit Cmmd + V |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment