Quick Markdown Preview For Github Readme

I write my Readme in marddown, and often it gets messed up and then I have to commit & push until its finally right, so I wrote a small script to get a preview (using githubs markdown library)!

Usage

markdown README.markdown
... chrome pops up with the html preview

Install
gem install redcarpet

Put this into e.g. ~/bin/markdown and do a chmod +x on it

#!/usr/bin/env ruby
raise "gime a file!!" unless ARGV[0]
exec "redcarpet #{ARGV[0]} > /tmp/markdown.html && chromium-browser /tmp/markdown.html"

Alternatively: Interactive Live Preview<

3 thoughts on “Quick Markdown Preview For Github Readme

Leave a comment