Skip to content

Instantly share code, notes, and snippets.

@yoshiori
Created March 22, 2012 06:35
Show Gist options
  • Save yoshiori/2156666 to your computer and use it in GitHub Desktop.
Save yoshiori/2156666 to your computer and use it in GitHub Desktop.
github の README.rdoc をサクっとプレビューしたい
#!/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