Created
June 17, 2015 09:42
-
-
Save yemartin/df25314d1310035d81ab to your computer and use it in GitHub Desktop.
Highlight code snippet in the clipboard, making it ready to be pasted into 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 | |
# | |
# Dependency: highlight (http://www.andre-simon.de/doku/highlight/en/highlight.php) | |
# $ brew install highlight | |
# | |
# Usage: | |
# 1. Copy some code snippet into the clipboard. | |
# 2. $ pbhighlight [syntax] # syntax parameter is optional. Default set below. | |
# 3. Paste into Keynote. | |
# | |
SYNTAX=$1 | |
: ${SYNTAX:=ruby} # <----- Your default syntax here | |
# Customize styling below to your liking | |
pbpaste \ | |
| highlight \ | |
--out-format rtf \ | |
--line-numbers \ | |
--font-size 24 \ | |
--font Inconsolata \ | |
--style bclear \ | |
--encoding=utf8 \ | |
--wrap \ | |
--wrap-no-numbers \ | |
--line-length 80 \ | |
--line-number-length 2 \ | |
--syntax $SYNTAX \ | |
| pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment