My Ruby Cookbook: #1 Textile Convertor
#!/usr/bin/env ruby
# Used to generate a HTML-ized file from a textile marked up file
#
require 'rubygems'
require 'redcloth'
ARGV.each { |file|
a = File.open(file, "r")
lines = a.readlines
a.close
contents = Array.new()
lines.each { |line|
contents << line
}
html_file = File.new(file +".html", "w")
html_file.puts(RedCloth.new(contents.join()).to_html)
html_file.close
}
Eric Davis
