haml2erb is a tool for converting Haml to Erb markup.
haml2erb is currently distributed as a Rails plugin.
Simply move the main haml2erb directory into the vendor/plugins directory of your Rails application.
Use the haml2erb
command line or from Ruby call the Haml2Erb.convert
method to have Haml markup translated into Erb.
echo '.foo' | haml2erb
# <div class='foo'></div>
Haml2Erb.convert('.foo')
# => "<div class='foo'></div>\n"
For the original implementation: