Created
March 22, 2012 06:35
-
-
Save yoshiori/2156666 to your computer and use it in GitHub Desktop.
github の README.rdoc をサクっとプレビューしたい
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 | |
require 'github/markup' | |
require 'tempfile' | |
if ARGV[0] && File.exists?(file = ARGV[0]) | |
html = GitHub::Markup.render(file) | |
tmp = Tempfile::new(['','.html']) | |
tmp.write(html) | |
tmp.close | |
`open #{tmp.path}` | |
sleep 5 | |
else | |
puts "usage: #$0 FILE" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment