Skip to content

Instantly share code, notes, and snippets.

@ascendbruce
Forked from jimbojsb/gist:1630790
Last active August 5, 2018 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ascendbruce/81e7fcc3e9e26758cc552f2818df895f to your computer and use it in GitHub Desktop.
Save ascendbruce/81e7fcc3e9e26758cc552f2818df895f to your computer and use it in GitHub Desktop.
Code highlighting for Keynote presentations

Install dependency

Get Homebrew installed on your mac if you don't already have it.

brew install highlight

Highlight your source

This will highlight the source code in RTF format and copy the result of that operation to your Mac's clipboard.

highlight -O rtf source_file.rb | pbcopy

Parameters examples

highlight -O rtf source_file.rb --line-numbers --font-size 24 --font Inconsolata --style solarized-dark -W -J 50 -j 3 --src-lang ruby | pbcopy

My frequent used config

highlight -O rtf source_file.rb --font-size 24 --font "Source Code Pro" --style moria --src-lang ruby | pbcopy

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment