Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert existing html.erb to Haml [closed]

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.

like image 372
palani Avatar asked Feb 11 '10 06:02

palani


People also ask

How do you write HAML in HTML?

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.

What is HAML file?

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.


2 Answers

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

like image 159
Mike Avatar answered Sep 25 '22 22:09

Mike


There you go: http://html2haml.heroku.com/

EDIT: Moved to https://html2haml.herokuapp.com/

like image 40
mikewilliamson Avatar answered Sep 23 '22 22:09

mikewilliamson