Skip to content

Instantly share code, notes, and snippets.

@rhysforyou
Created August 3, 2010 11:02
Show Gist options
  • Save rhysforyou/506186 to your computer and use it in GitHub Desktop.
Save rhysforyou/506186 to your computer and use it in GitHub Desktop.
require 'rubygems'
gem 'bluecloth', '>= 2.0.0'
require 'bluecloth'
require 'trollop'
opts = Trollop::options do
opt :in, "The file to parse", :default => 'markdown.txt'
opt :out, "The file to output to", :default => 'markdown.html'
end
markdown = ''
File.open(opts[:in], "r").each_line do |f|
markdown += f.to_s
end
File.new(opts[:out])
File.open(opts[:out], 'w') do |f|
f.syswrite(BlueCloth.new(markdown).to_html())
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment