Is there a good HAML -> ERB/HTML converter?

主宰稳场 提交于 2019-12-17 16:24:02

问题


I'm looking for a reliable way to convert a HAML template to an equivalent ERB/HTML template?

Has anyone come across one?


回答1:


I recommend you to use HAML2ERB service. It's really cool and generates valid ERB/HTML code! The benefits are:

  1. HTTPS - if you need some security for your markup;
  2. API - you could write the plugin or something else for your IDE;
  3. Simple - just put your HAML code to the textbox and click "Convert";
  4. Project is active - the author is currently working on it.

Project was tested on big HAML views (over 800 lines of markup) from the real production app and it worked fine for me.

Good luck!




回答2:


have you try W2tags, you can even test it live in: w2tags.heroku.com




回答3:


I just wrote a HAML to ERB translator in Haskell. https://github.com/danchoi/herbalizer

If you're still trying to find a tool for this problem, let me know if it works well enough or not.




回答4:


Apparently there's some challenging issues with translating HAML to ERB, as HAML supports some niceties that don't easily translate back to ERB without parsing the Ruby code. A naive implementation using the HAML engine is here:

HAML to HTML demo




回答5:


There is our fork of haml2erb which does not support all the HAML syntax, but it's good enough for us to write Rhomobile views in HAML.




回答6:


Haml2Erb is very awesome online converter. It really helps me a lots



来源:https://stackoverflow.com/questions/967262/is-there-a-good-haml-erb-html-converter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!