# file formatter to convert svg output to html file that is interactive (for selecting and coloring lines) # ARGV 0 = Source # ARGV 1 = Destination - will be overwritten if ARGV[0].nil? puts "need source and destination file names" exit end svg = IO.readlines(ARGV[0]) if svg.length < 10 puts "Does not seem to be a SVG file" puts svg exit end header = < #{ARGV[1]}

#{ARGV[0]}

HEAD footer = < FOOT f = File.new(ARGV[1], "w") f.write(header) svg.slice(5..svg.length).each{|line| f.write(line) } f.write(footer) f.flush f.close