Last active
August 29, 2015 14:03
-
-
Save winks/f0c4a5dc3e9a49c4aa96 to your computer and use it in GitHub Desktop.
Render GitHub Flavored markdown to temp file and view it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
exit unless ARGV.length > 0 | |
require 'github/markdown' | |
require 'tempfile' | |
t=Tempfile.new('gfm_foo') | |
t.write(GitHub::Markdown.render_gfm(File.read(ARGV[0]))) | |
t.rewind() | |
exec("/etc/alternatives/x-www-browser #{t.path}") | |
t.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment