Skip to content

Instantly share code, notes, and snippets.

@mdavid
Created August 19, 2015 23:18
Show Gist options
  • Save mdavid/2f3c26ffc5270bfd8219 to your computer and use it in GitHub Desktop.
Save mdavid/2f3c26ffc5270bfd8219 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
brew install markdown
#!/bin/bash -e
hash=`cat $1 | md5`
scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
tmpfile="$scratch/$hash.tmp.html"
renderedMarkdown=`markdown $1 > $tmpfile`
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome $tmpfile
read
function finish {
rm -rf "$scratch"
}
trap finish EXIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment