I have a rails project, the views only consist with HTML.ERB files, my client wants to convert ERB to HAML. I have too many views file. It's taking a huge amount of time to convert file by file. So that any simply way I can convert HTML to haml? I installed haml plugin under my project.
In Haml, we write a tag by using the percent sign and then the name of the tag. This works for %strong , %div , %body , %html ; any tag you want. Then, after the name of the tag is = , which tells Haml to evaluate Ruby code to the right and then print out the return value as the contents of the tag.
Haml (HTML Abstraction Markup Language) is a templating system that is designed to avoid writing inline code in a web document and make the HTML cleaner.
You can use from the command line html2haml
html2haml your_erb_file new_haml_file
If you want to convert all your files in one go, look at this article : http://shifteleven.com/articles/2008/06/08/converting-erb-to-haml-snippet
There you go: http://html2haml.heroku.com/
EDIT: Moved to https://html2haml.herokuapp.com/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With