What is the best way to format the code of a Fremarker macro
containing embedded html code, used to implement the widget renderers? Let's consider, for example: <#macro renderFieldTitle style title><#if style?has_content><span class="${style}"></#if>${title}<#if style?has_content></span></#if></ #macro> Should we try to format it to maximize its readibility? For example: <#macro renderFieldTitle style title> <#if style?has_content> <span class="${style}"> </#if> ${title} <#if style?has_content> </span> </#if> </#macro> Or should we format it so that the generated code (html) is more readable? For example: <#macro renderFieldTitle style title><#if style?has_content><span class="${style}"></#if> ${title} <#if style?has_content></span></#if></#macro> I am trying to improve the new widget macro libraries and I am not sure how to proceed. Jacopo smime.p7s (3K) Download Attachment |
Hi Jacopo
Have you had a look at any of the stuff here: http://freemarker.sourceforge.net/docs/dgui_misc_whitespace.html ? It might be possible to find the best of both worlds. Regards Scott HotWax Media On 18/04/2009, at 2:04 AM, Jacopo Cappellato wrote:
smime.p7s (3K) Download Attachment |
Thanks Scott,
this is exactly what I was looking for. Jacopo On Apr 17, 2009, at 4:19 PM, Scott Gray wrote: > Hi Jacopo > > Have you had a look at any of the stuff here: http://freemarker.sourceforge.net/docs/dgui_misc_whitespace.html > ? > > It might be possible to find the best of both worlds. > > Regards > Scott > > HotWax Media > http://www.hotwaxmedia.com > > On 18/04/2009, at 2:04 AM, Jacopo Cappellato wrote: > >> What is the best way to format the code of a Fremarker macro >> containing embedded html code, used to implement the widget >> renderers? >> >> Let's consider, for example: >> >> <#macro renderFieldTitle style title><#if style?has_content><span >> class="${style}"></#if>${title}<#if style?has_content></span></ >> #if></#macro> >> >> Should we try to format it to maximize its readibility? For example: >> >> <#macro renderFieldTitle style title> >> <#if style?has_content> >> <span class="${style}"> >> </#if> >> ${title} >> <#if style?has_content> >> </span> >> </#if> >> </#macro> >> >> Or should we format it so that the generated code (html) is more >> readable? For example: >> >> <#macro renderFieldTitle style title><#if style?has_content><span >> class="${style}"></#if> >> ${title} >> <#if style?has_content></span></#if></#macro> >> >> I am trying to improve the new widget macro libraries and I am not >> sure how to proceed. >> >> Jacopo >> > smime.p7s (3K) Download Attachment |
Free forum by Nabble | Edit this page |