Glavin001 / atom-beautify

:mega: Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | :lipstick: Universal beautification package for Atom editor (:warning: Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding :heart: )
http://unibeautify.com/
MIT License
1.5k stars 453 forks source link

Support for Freemarker. #539

Open eddiellopez opened 9 years ago

eddiellopez commented 9 years ago

Atom offers a good support for freemarker language. It could be nice if beautify could support freemarker also.

prettydiff commented 9 years ago

Freemarker appears to be a HTML template language so the beautification will likely be powered by the Pretty Diff tool. In order for me to provide support I need to know more about the syntax. From looking at the documentation I have gathered this:

<#tag_name> <!-- start tag -->
</#tag_name> <!-- end tag -->

Except, I am looking at documentation here: http://freemarker.org/docs/xgui_declarative_basics.html

<#recurse doc> does not appear to be a start tag. Maybe this is a self-closing tag. If so could you provide me tag names for all self-closing tags, because this will drastically impact beautification.

eddiellopez commented 9 years ago

Hello, thanks for answering!

Besides the tags

<#tag_name> </#tag_name>

There are also user defined directives:

@tag_name /@tag_name

The self closed directives are:

<#assign> (Which can also be explicitly closed)

<#break> (Always inside switch or list)

<#case> (Always inside switch)

<#default>

<#else> (Always inside if or list)

<#elseif> (Always inside if or list)

<#fallback>

<#flush>

<#ftl>

<#global> (Which can also be explicitly closed)

<#import>

<#include>

<#local>

<#t>

<#lt>

<#rt>

<#nested >

<#nt>

<#recover>

<#recurse>

<#return>

<#sep>

<#setting>

<#stop>

<#visit node>

On Tue, Sep 8, 2015 at 3:34 PM, Austin Cheney notifications@github.com wrote:

Freemarker appears to be a HTML template language so the beautification will likely be powered by the Pretty Diff tool. In order for me to provide support I need to know more about the syntax. From looking at the documentation I have gathered this:

<#tag_name> </#tag_name>

Except, I am looking at documentation here: http://freemarker.org/docs/xgui_declarative_basics.html

<#recurse doc> does not appear to be a start tag. Maybe this is a self-closing tag. If so could you provide me tag names for all self-closing tags, because this will drastically impact beautification.

— Reply to this email directly or view it on GitHub https://github.com/Glavin001/atom-beautify/issues/539#issuecomment-138691558 .

prettydiff commented 9 years ago

Try it out at http://prettydiff.com/ignore/testlocation/prettydiff.com.xhtml?m=beautify

I have not yet added support for #assign or #global yet. By Which can also be explicitly closed did you mean these tags may optionally come with a closing tag, like: </#global>?

eddiellopez commented 9 years ago

Yep, that's right. Those tags can be found in both forms (with closing tag or without it).

On Tue, Sep 8, 2015 at 6:25 PM, Austin Cheney notifications@github.com wrote:

Try it out at http://prettydiff.com/ignore/testlocation/prettydiff.com.xhtml?m=beautify

I have not yet added support for #assign or #global yet. By * (Which can also be explicitly closed)* did you mean these tags may optionally come with a closing tag, like: </#global>?

— Reply to this email directly or view it on GitHub https://github.com/Glavin001/atom-beautify/issues/539#issuecomment-138730021 .

prettydiff commented 9 years ago

All features should be supported at http://prettydiff.com/ignore/testlocation/prettydiff.com.xhtml?m=beautify

Just test it out and if there are any problems I will give it a quick fix.