Skip to content

Instantly share code, notes, and snippets.

@emilong
Created April 1, 2012 19:48
Show Gist options
  • Save emilong/2278098 to your computer and use it in GitHub Desktop.
Save emilong/2278098 to your computer and use it in GitHub Desktop.
Convert HTML to HAML
require 'rubygems'
require 'find'
require 'haml'
require 'haml/html'
Find.find("content") do |path|
if path.end_with? "htm"
File.open(path) do |input|
File.open(path + "l.haml", "w") do |output|
output.write Haml::HTML.new(input.read).render
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment