Skip to content

Instantly share code, notes, and snippets.

@scottwb
Created April 6, 2010 10:29
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 scottwb/357446 to your computer and use it in GitHub Desktop.
Save scottwb/357446 to your computer and use it in GitHub Desktop.
Previews a markdown file in the browser.
#!/usr/bin/env ruby
#
# Previews a markdown file in the browser.
#
# Usage: markdown <filename>
#
# Requires: gem install maruku
#
infile = ARGV[0]
outfile = ARGV[0].split('.').first + '.html'
system "maruku #{infile}"
system "open #{outfile}"
sleep 2
system "rm -f #{outfile}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment