HTML decoder for HAML code

Is there a separate tool or gem that can be used to organize HTML code (erb or haml). We tried using the htmlbeautifier , but it did not work with HAML code, as it did nothing to decorate the code. Are there any other better tools, and I would like it to be something like a rake task and not necessarily an addition to the editor.

+5
source share
3 answers

In general, HAML is structured in such a way as to make it easy and somewhat compulsory for the author to write β€œbeautiful” code from the very beginning. Most of what the improver does is makes non-synthetically relevant changes to spaces in languages ​​/ formats where spaces are completely irrelevant (possibly with the exception of line breaks). This is an obstacle to decorating HAML because spaces are syntactically relevant. HAML also eliminates the need for braces and the like, so they also do not need to be cleaned.

What exactly do you expect from a HAML designer? Can you give an example of a valid HAML file that you would enter in the decorator, and the result that you want to get from the decorator?

+2
source

Netbeans IDE Code Beautifier. Alt + Shift + F, /

+2

I usually do this with Django using BeautifulSoup , but I ruined a bit and found something called RubyfulSoup , although it says it is not supported, but I think this work will still be done. I searched for alternatives and found a group of others:

These questions and answers can help you.

UPDATE: Check out this Javascript Beautifier !

Hope this is helpful.

+1
source

All Articles