How to convert html.slim to html.erb?

I have many html.slim files that I would like to convert to html.erb files since I am not familiar with the subtle syntax. Is there a converter for thin to erb?

I found a converter for html to slim that has the functionality I'm looking for, but it does not do slim to erb. http://html2slim.herokuapp.com/

+6
source share
2 answers

Use Slim :: ERBConverter from slim itself, there is also a slimrb command line tool, see http://rdoc.info/gems/slim/frames for more documentation.

+7
source

They are both engine templates, and they have different functionality.

There will never be any converter, because there are so few cases when such a tool is needed. Such a tool should support both language functions, but they are not fully compatible (there are things that exist in one and are not available in the other, and vice versa).

To answer your original question, how can you convert slim to erb, I answer that you need to learn both languages ​​and do it manually.

My suggestion is that you study the one you plan to use and stick to (My suggestion is ERB). If you are a beginner, do not jump on different engines, stick to one, study it to the bone, and then, after many years of experience, try to do the same or do better with other engines.

-1
source

All Articles