Quantcast

Option for setting default mode for compress directive

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Option for setting default mode for compress directive

freemarker-user mailing list
Hi all,

I checked the source code for CompressedBlock and StandardCompress and
found the undocumented argument single_line(boolean) which is exactly
the feature I'm looking for. I'm using Freemarker for html development
and I have a lot of macros that sometimes are nested to construct html
fragments. However using compress today when it outputs newlines is
inconvenient since the output becomes really ugly (imho).

So I was wondering if there would be a possibility in next version of
Freemarker to set an option somewhere to have compress to always use
single_line=true which would make me very happy :).

Have a good day everyone!

//Jerker

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Option for setting default mode for compress directive

Daniel Dekany
Tuesday, December 16, 2014, 4:13:38 AM, Jerker Klang wrote:

> Hi all,
>
> I checked the source code for CompressedBlock and StandardCompress and
> found the undocumented argument single_line(boolean) which is exactly
> the feature I'm looking for. I'm using Freemarker for html development
> and I have a lot of macros that sometimes are nested to construct html
> fragments. However using compress today when it outputs newlines is
> inconvenient since the output becomes really ugly (imho).
>
> So I was wondering if there would be a possibility in next version of
> Freemarker to set an option somewhere to have compress to always use
> single_line=true which would make me very happy :).
>
> Have a good day everyone!
>
> //Jerker

A global settings that change the behavior of a standard directive is
not something I like. Because, then if you want to reuse or just see a
template somewhere, you can't be sure anymore what will it do, as that
depends on a FreeMarker setting that's maybe set somewhere in the
middle of a Java code. You as the template author has no control over
that. Is there a problem with <#compress single_line=true>...</#compress>
(other than missing documentation, as you say)? Do you have to use it
often in the source code? Any other ideas other than a global option?
Can you demonstrate the use case a bit more?

(The ultimate solution would be better parse-time whitespace gobbling,
but that's again planned but still far away. Right now you could use
#t and such, though I guess it's too messy to put that all around. I
still wonder if with what *parse-time* feature could your problem be
addressed... any idea?)

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Loading...