Unibeautify / unibeautify

One Beautifier to rule them all, One Beautifier to clean them, One Beautifier to bring them all and in the darkness sheen them
https://unibeautify.com/
MIT License
544 stars 41 forks source link

Liquid files with 2 Extensions handled differently #249

Open devatdotdev opened 4 years ago

devatdotdev commented 4 years ago

Is your feature request related to a problem? Please describe. It is not an issue with the current code, but a request to update the way it processes files with an extension before .liquid

Describe the solution you'd like

Description

I would also like to see support for the several possible forms of liquid, used in files with format ..liquid.

Match extensions - Info on what needs to be done .html.liquid: - Beautified as HTML, then the result should be beautified as liquid. Current liquid formatters never seem to place control blocks on new lines such as {% if %} / {% endif %} and counterparts {%- if -%} / {%- endif -%} or {% for %} / {% endfor %} as examples. These tags should be placed on new lines matching parent line's indentation AFTER the file is formatted as regular HTML for best results. .scss.liquid: - Beautified as SCSS, then the result should be beautified as liquid (explanation above.) .js.liquid: - Beautified as JavaScript, then the result should be beautified as liquid (explanation above.) .liquid - Beautified as Liquid only.

Describe alternatives you've considered I have searched far and wide for a code formatter that works will with .liquid files and .html.liquid, etc. One doesn't exist yet. I believed your project was uniquely prepared to handle this as it integrates several other beautifiers so theoretically you could chain beautifiers to achieve a better result for these files.

Additional context I realize that this would require a beautifier to run AFTER others in the chain, that performs the "control blocks on new lines" feature, so I will be looking into writing this myself and will submit a link to the github project once created. If you are able to allow for a new feature to chain beautifiers, I believe there would be other uses for this in other template languages as well.

Glavin001 commented 4 years ago

@devatdotdev : Liquid is supported: https://unibeautify.com/docs/language-liquid Have you tried https://playground.unibeautify.com/ ? Could you provide some examples of what does and does not work?