#!/usr/bin/env ruby # # textilize -- Converts Textile markup into XHTML. # Copyright (c) 2005 Arto Bendiken. Released under the GNU GPL. # Newest version available from http://bendiken.net/scripts/ # # Requires the RedCloth library: # http://rubyforge.org/projects/redcloth/ # # 2005-10-15 initial version require 'redcloth' def open(filename, mode, default=nil) if filename.nil? or filename == '-' then default else File.open(filename, mode) end end input = open(ARGV[0], 'r', STDIN) output = open(ARGV[1], 'w', STDOUT) output.puts(RedCloth.new(input.read).to_html)