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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s