You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Cabrera, Benjamin" <Be...@usa.xerox.com> on 2004/03/03 15:28:33 UTC

Status: macros and white space gobbling

Hi all.

I have read many previous emails about the issue of macros and white space
gobbling. Most go back and forth and give valid workarounds, but I haven't
seen anything about implementing a solution for this.

Is there something in the works for this? Or is there an ongoing debate of
whether to "suppress or not suppress"?

Thanks for a great tool!

Ben Cabrera

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Christoph Reck <ap...@recks.org>.
Nathan Bubna wrote:
> Christoph Reck said:
[snip]
> i'd like to see the default setting be WYTIWYG (what you type is what you get)
> because it is the simplest to understand and fits my idea of what a template
> engine should be/do.  It also follows consistently with the moves Velocity has
> made toward treating line ends just like any other whitespace (except in the
> case of ## comments, of course).

In another thread I mentioned how to move to a non BC change (next release
with a confguration flag that can be set to enable the new feature, defaulting
to the BC form, emitting a deprecation waring; then a release with the
default to the new mode with a warning that BC not garanteed; finaly the BC
code could be removed).

Once it is settable, we can argue what the final default should be...

> 
> Once we have that, it'd be nice to have a way to specify different filters
> (e.g. one that uses Christoph's elegant gobbling rule or the current behavior)
> either globally by specifying some sort of filter class in the
> velocity.properties or locally using a directive.  of course, since i don't
> have a patch to offer or time to make one, i really can't complain much.

I believe it would be better to have the parser separate the whitespace
that may be gobbled. Also a AST post-processor could enforce the gobbling
rule. The new ASTWhitespace nodes could then decide themselves if they shall
be rendered (depending on configuration or event a controlling directive
inserted in the template that modifies the configured flag).

A filter applied to the output of the AST rendering would require reparsing
and thus add a performace penalty.

Once the approach is agreed, one of us (even me!) could leap into
implementing a patch.

Cheers,
Christoph

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Nathan Bubna <na...@esha.com>.
Christoph Reck said:
> my position was to get the whitespace gobbling into a form
> that is consistent over all directives and as far as possible
> to do what users would expect.

yeah, a simple, consistent rule would be nice.  i do see the current
inconsistency as a bug (albeit a *very* minor one).

> Currently velocity leaves any spaces before indented
> directives but gobbles whitespaces up to an EOL after them.
> The leading WS are a nuisance, causing nicely formmatted
> templates to produce ugly output. Alternatively you can uglify
> your templates with #*\n...*# and similar to obtain nice output.
>
> In the case of XHTML, it is possible to use tidy to re-format
> the output. But this implies additional overhead.
>
> Some people would opt that velocity does not touch whitepaces,
> which would be consistent but *really* ugly. This could be
> an optional switch.

i'll admit, i'm one of those people. :)

i'd like to see the default setting be WYTIWYG (what you type is what you get)
because it is the simplest to understand and fits my idea of what a template
engine should be/do.  It also follows consistently with the moves Velocity has
made toward treating line ends just like any other whitespace (except in the
case of ## comments, of course).

Once we have that, it'd be nice to have a way to specify different filters
(e.g. one that uses Christoph's elegant gobbling rule or the current behavior)
either globally by specifying some sort of filter class in the
velocity.properties or locally using a directive.  of course, since i don't
have a patch to offer or time to make one, i really can't complain much.

...
> I guess I will go ahead placing this in bugzilla so that it does not
> get lost as in so many previous user and developer list threads.

thx.

> I do not understand there is so much resistance agains such a simple
> enhancement. I know the proposal it not 100% BC, but again, a swich
> could allow the classic style (by default).
...

i don't think it's resistance so much as it is inertia. :)

Nathan Bubna
nathan@esha.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by "J. B. Rainsberger" <jb...@rogers.com>.
Barbara Baughman wrote:

> So why do I need to suddenly do extra processing so someone else
> doesn't have to do extra processing?

I think you should be doing it, anyway. That's pure opinion. Enforcing 
formatting rules -- of any kind -- by hand is not easily maintained in a 
large number of templates (> 5). As soon as the formatting rules need to 
change, it's easier to change Jalopy than to change some number of 
templates. It's just a kind of refactoring to remove duplication of 
knowledge in the templates -- in this case, the most insidious kind of 
duplication, since it is not obvious that it is duplication. (The 
templates know our formatting rules for Java code. They know too much!)

<snip />
-- 
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Barbara Baughman <ba...@utdallas.edu>.
So why do I need to suddenly do extra processing so someone else
doesn't have to do extra processing?

I use Velocity for web applications, email templates, and putting out
java bean code.  I'm just not bothered with the whitespace handling
(well, maybe a little bit). The argument always seems to be that it
just isn't pretty enough, not that it doesn't work.  So do some extra
processing to make it pretty enough for your needs.

A while ago, this list discussed having some standard extra processors
that you could have Velocity use after (or before?) the parsing.
That would make it easier for Velocity to go through some standardized
further processing in conjunction with the template merge. The user
could then specify the extra processing in the configuration of the
VelocityEngine, and potentially any class with a predefined interface
method would work.  Anything ever happen to that idea?  I kind of
liked it.

Barbara Baughman
X2157

On Wed, 3 Mar 2004, J. B. Rainsberger wrote:

> Serge Knystautas wrote:
>
> > J. B. Rainsberger wrote:
> >
> >>> What about folks who have templates that care about keeping the
> >>> indentation before the Velocity directives?  I have Velocity templates
> >>> that produce Java code, and I want the indenting to be honored.  How
> >>> would you place whitespace before the directive with your solution?
> >>
> >>
> >> You might consider postprocessing the Velocity output with a Java
> >> formatter, rather than tweaking the format of the templates. The
> >> solution I suggest is much more resistant to changes in the templates.
> >
> >
> > I would agree with this.  If you want prettily formatted HTML, use JTidy
> > as a post-processor (during development).  If you want to save transfer
> > space, then use gzip compression in your web server.
>
> Prettily-formatted /Java/, and not web content. Barbara's generating
> Java code. She could use Jalopy or something like that.
> --
> J. B. Rainsberger,
> Diaspar Software Services
> http://www.diasparsoftware.com :: +1 416 791-8603
> Let's write software that people understand
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by "J. B. Rainsberger" <jb...@rogers.com>.
Mike Kienenberger wrote:

> "J. B. Rainsberger" <jb...@rogers.com> wrote:
> 
>>Mike Kienenberger wrote:
>>
>><snip />
>>
>>>Yes, there must be a mode where the designer has complete control of 
>>>whitespace.   There can be no post-processing "pretty printers" for 
> 
> custom 
> 
>>>email messages. 
>>
>>Are you sure? jEdit knows how to format paragraphs of text, so it must 
>>be possible. (It's beside the point, but I find life easier the fewer 
>>assumptions I make.)
> 
> Well, if it was machine-formatted, then it'd hardly be custom, now would it? 
>  :-)

Very well. :)
-- 
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Mike Kienenberger <mk...@alaska.net>.
"J. B. Rainsberger" <jb...@rogers.com> wrote:
> Mike Kienenberger wrote:
> 
> <snip />
> > Yes, there must be a mode where the designer has complete control of 
> > whitespace.   There can be no post-processing "pretty printers" for 
custom 
> > email messages. 
> 
> Are you sure? jEdit knows how to format paragraphs of text, so it must 
> be possible. (It's beside the point, but I find life easier the fewer 
> assumptions I make.)

Well, if it was machine-formatted, then it'd hardly be custom, now would it? 
 :-)

-Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by "J. B. Rainsberger" <jb...@rogers.com>.
Mike Kienenberger wrote:

<snip />
> Yes, there must be a mode where the designer has complete control of 
> whitespace.   There can be no post-processing "pretty printers" for custom 
> email messages. 

Are you sure? jEdit knows how to format paragraphs of text, so it must 
be possible. (It's beside the point, but I find life easier the fewer 
assumptions I make.)
-- 
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Mike Kienenberger <mk...@alaska.net>.
Barbara Baughman <ba...@utdallas.edu> wrote:
> As long as the rules for whitespace handling are clear and I can
> output anything I want under those rules, I don't consider the
> whitespace handling to be a bug.  Changing the rules so there are some
> things that can no longer be done with a Velocity template is simply
> unacceptable.

Yes, there must be a mode where the designer has complete control of 
whitespace.   There can be no post-processing "pretty printers" for custom 
email messages.  So far, the current design of velocity allows me to have 
such control (even though it does require ugly things like putting ## or 
#**# after all directives.

-Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Barbara Baughman <ba...@utdallas.edu>.
I'm talking about the possibility that the new white space gobbling
rules will break what works now for the sake of having more
aethetically pleasing code (to some).  It's not just my java code;
it's any text processing that wants to purposely indent before a
directive.

It would be pretty easy to develop a script that translates 'pretty'
code in the way suggested (eliminate leading whitespace before a
directive), and then use that for the actual template.

As long as the rules for whitespace handling are clear and I can
output anything I want under those rules, I don't consider the
whitespace handling to be a bug.  Changing the rules so there are some
things that can no longer be done with a Velocity template is simply
unacceptable.

Barbara Baughman
X2157

On Thu, 4 Mar 2004, J. B. Rainsberger wrote:

> Mike Curwen wrote:
>
> > *or*, Velocity could just leave whitespace, newlines and other stuff
> > alone.
>
> No argument here; however, even if Velocity did that perfectly, what
> happens when the Java formatting rules change? Do you want to hand-fix
> all 750 code-generating templates? I prefer to change the formatting
> rules in Jalopy (or somesuch).
> --
> J. B. Rainsberger,
> Diaspar Software Services
> http://www.diasparsoftware.com :: +1 416 791-8603
> Let's write software that people understand
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by "J. B. Rainsberger" <jb...@rogers.com>.
Mike Curwen wrote:

> *or*, Velocity could just leave whitespace, newlines and other stuff
> alone.  

No argument here; however, even if Velocity did that perfectly, what 
happens when the Java formatting rules change? Do you want to hand-fix 
all 750 code-generating templates? I prefer to change the formatting 
rules in Jalopy (or somesuch).
-- 
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: Status: macros and white space gobbling

Posted by Mike Curwen <gb...@gb-im.com>.
*or*, Velocity could just leave whitespace, newlines and other stuff
alone.  

> -----Original Message-----
> From: J. B. Rainsberger [mailto:jbrains@rogers.com] 
> Sent: Wednesday, March 03, 2004 4:36 PM
> To: Velocity Users List
> Subject: Re: Status: macros and white space gobbling
> 
> 
> Serge Knystautas wrote:
> 
> > J. B. Rainsberger wrote:
> > 
> >>> What about folks who have templates that care about keeping the 
> >>> indentation before the Velocity directives?  I have Velocity 
> >>> templates that produce Java code, and I want the indenting to be 
> >>> honored.  How would you place whitespace before the 
> directive with 
> >>> your solution?
> >>
> >>
> >> You might consider postprocessing the Velocity output with a Java
> >> formatter, rather than tweaking the format of the templates. The 
> >> solution I suggest is much more resistant to changes in 
> the templates.
> > 
> > 
> > I would agree with this.  If you want prettily formatted HTML, use 
> > JTidy
> > as a post-processor (during development).  If you want to 
> save transfer 
> > space, then use gzip compression in your web server.
> 
> Prettily-formatted /Java/, and not web content. Barbara's generating 
> Java code. She could use Jalopy or something like that.
> -- 
> J. B. Rainsberger,
> Diaspar Software Services
> http://www.diasparsoftware.com :: +1 416 791-8603
> Let's write software that people understand
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by "J. B. Rainsberger" <jb...@rogers.com>.
Serge Knystautas wrote:

> J. B. Rainsberger wrote:
> 
>>> What about folks who have templates that care about keeping the
>>> indentation before the Velocity directives?  I have Velocity templates
>>> that produce Java code, and I want the indenting to be honored.  How
>>> would you place whitespace before the directive with your solution?
>>
>>
>> You might consider postprocessing the Velocity output with a Java 
>> formatter, rather than tweaking the format of the templates. The 
>> solution I suggest is much more resistant to changes in the templates.
> 
> 
> I would agree with this.  If you want prettily formatted HTML, use JTidy 
> as a post-processor (during development).  If you want to save transfer 
> space, then use gzip compression in your web server.

Prettily-formatted /Java/, and not web content. Barbara's generating 
Java code. She could use Jalopy or something like that.
-- 
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Serge Knystautas <se...@lokitech.com>.
J. B. Rainsberger wrote:
>> What about folks who have templates that care about keeping the
>> indentation before the Velocity directives?  I have Velocity templates
>> that produce Java code, and I want the indenting to be honored.  How
>> would you place whitespace before the directive with your solution?
> 
> You might consider postprocessing the Velocity output with a Java 
> formatter, rather than tweaking the format of the templates. The 
> solution I suggest is much more resistant to changes in the templates.

I would agree with this.  If you want prettily formatted HTML, use JTidy 
as a post-processor (during development).  If you want to save transfer 
space, then use gzip compression in your web server.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by "J. B. Rainsberger" <jb...@rogers.com>.
Barbara Baughman wrote:

> What about folks who have templates that care about keeping the
> indentation before the Velocity directives?  I have Velocity templates
> that produce Java code, and I want the indenting to be honored.  How
> would you place whitespace before the directive with your solution?

You might consider postprocessing the Velocity output with a Java 
formatter, rather than tweaking the format of the templates. The 
solution I suggest is much more resistant to changes in the templates.

Of course, if you've already tried that and it didn't work for you, then 
do ignore me. :)
-- 
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Christoph Reck <ap...@recks.org>.
Barbara Baughman wrote:
> What about folks who have templates that care about keeping the
> indentation before the Velocity directives?  I have Velocity templates
> that produce Java code, and I want the indenting to be honored.  How
> would you place whitespace before the directive with your solution?
> 
> Barbara Baughman
> X2157

My proposal affects only directives alone in a line. If you have
some text, reference or other directives before or after, it
should not gobble the whitesapces around it.

So to answer your question you can either do:

a) switch the whitespace gobbling off by configuration,

b) by a new directive
   #keepSpaces(true)
      #myMacro(...)
   #end

c) or by doing something tricky like:
      #**##myMacro(...)

d) or the same more readable:
      #set( $idented = "" )
      ...
      $indented#myMacro(...)

e) or even with a simple but great dummy directive
      #indented#myMacro(...)


Will Glass-Husain wrote in another mail:
> Dumb question, but how do you vote? I didn't see an option in Bugzilla.  Or
> did you mean comment in the forum?
I noticed that also. I thought it had to do with the fact that
I created the issue and I am thus not allowed to vote for it...
Any bugzilla guru out there who can answer this?

Any other questions?

Cheers,
:) Christoph Reck


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Barbara Baughman <ba...@utdallas.edu>.
What about folks who have templates that care about keeping the
indentation before the Velocity directives?  I have Velocity templates
that produce Java code, and I want the indenting to be honored.  How
would you place whitespace before the directive with your solution?

Barbara Baughman
X2157

On Wed, 3 Mar 2004, Christoph Reck wrote:

> Hi,
>
> my position was to get the whitespace gobbling into a form
> that is consistent over all directives and as far as possible
> to do what users would expect.
>
> Currently velocity leaves any spaces before indented
> directives but gobbles whitespaces up to an EOL after them.
> The leading WS are a nuisance, causing nicely formmatted
> templates to produce ugly output. Alternatively you can uglify
> your templates with #*\n...*# and similar to obtain nice output.
>
> In the case of XHTML, it is possible to use tidy to re-format
> the output. But this implies additional overhead.
>
> Some people would opt that velocity does not touch whitepaces,
> which would be consistent but *really* ugly. This could be
> an optional switch.
>
>
> I expect that when adding velocity markup to an existing text file
> to not affect the spacing in the output. This includes indented #foreach
> directives and inner indented #if/#set/#macro directives.
>
> So the rule I proposed was to allow adding velocity markup, one per line,
> and still have the same output - e.g. add an #if statement around
> existing text to conditionally mask it out. Or add an #foreach around
> a table row and be able to repeat the body with dynamic data, etc.
>
> If a line is looks like this:
>    DirectiveLine ::= LineEnd TabsAndSpaces? Directive TabsAndSpaces? LineEnd
>    TabsAndSpaces ::= (#x20 | #x09)+
>    LineEnd       ::= StartOfStream | ((#x0D #x0A) | #x0D | #x0A) | EndOfStream
> then the first "TabsAndSpaces?" and the closing "TabsAndSpaces? LineEnd"
> should be gobbled. (Note that it supports multiline directives, that is
> why "DirectiveLine" is not simply "Line".) If you whant the first
> "LineEnd" to be gobbled prepend a ## before it (makes the EOL part of
> the previous line!).
>
>
> I guess I will go ahead placing this in bugzilla so that it does not
> get lost as in so many previous user and developer list threads.
>
>
> I do not understand there is so much resistance agains such a simple
> enhancement. I know the proposal it not 100% BC, but again, a swich
> could allow the classic style (by default).
>
>
> I will put a notice here when its in bugzilla for other to vote on it.
>
> Cheers,
> Christoph
>
> Cabrera, Benjamin wrote:
> > Hi all.
> >
> > I have read many previous emails about the issue of macros and white space
> > gobbling. Most go back and forth and give valid workarounds, but I haven't
> > seen anything about implementing a solution for this.
> >
> > Is there something in the works for this? Or is there an ongoing debate of
> > whether to "suppress or not suppress"?
> >
> > Thanks for a great tool!
> >
> > Ben Cabrera
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Christoph Reck <ap...@recks.org>.
Hi,

my position was to get the whitespace gobbling into a form
that is consistent over all directives and as far as possible
to do what users would expect.

Currently velocity leaves any spaces before indented
directives but gobbles whitespaces up to an EOL after them.
The leading WS are a nuisance, causing nicely formmatted
templates to produce ugly output. Alternatively you can uglify
your templates with #*\n...*# and similar to obtain nice output.

In the case of XHTML, it is possible to use tidy to re-format
the output. But this implies additional overhead.

Some people would opt that velocity does not touch whitepaces,
which would be consistent but *really* ugly. This could be
an optional switch.


I expect that when adding velocity markup to an existing text file
to not affect the spacing in the output. This includes indented #foreach
directives and inner indented #if/#set/#macro directives.

So the rule I proposed was to allow adding velocity markup, one per line,
and still have the same output - e.g. add an #if statement around
existing text to conditionally mask it out. Or add an #foreach around
a table row and be able to repeat the body with dynamic data, etc.

If a line is looks like this:
   DirectiveLine ::= LineEnd TabsAndSpaces? Directive TabsAndSpaces? LineEnd
   TabsAndSpaces ::= (#x20 | #x09)+
   LineEnd       ::= StartOfStream | ((#x0D #x0A) | #x0D | #x0A) | EndOfStream
then the first "TabsAndSpaces?" and the closing "TabsAndSpaces? LineEnd"
should be gobbled. (Note that it supports multiline directives, that is
why "DirectiveLine" is not simply "Line".) If you whant the first
"LineEnd" to be gobbled prepend a ## before it (makes the EOL part of
the previous line!).


I guess I will go ahead placing this in bugzilla so that it does not
get lost as in so many previous user and developer list threads.


I do not understand there is so much resistance agains such a simple
enhancement. I know the proposal it not 100% BC, but again, a swich
could allow the classic style (by default).


I will put a notice here when its in bugzilla for other to vote on it.

Cheers,
Christoph

Cabrera, Benjamin wrote:
> Hi all.
> 
> I have read many previous emails about the issue of macros and white space
> gobbling. Most go back and forth and give valid workarounds, but I haven't
> seen anything about implementing a solution for this.
> 
> Is there something in the works for this? Or is there an ongoing debate of
> whether to "suppress or not suppress"?
> 
> Thanks for a great tool!
> 
> Ben Cabrera
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Nathan Bubna <na...@esha.com>.
i suppose it would help to include a link: :)
http://wiki.apache.org/jakarta-velocity/VelocityWhitespaceGobbling

Nathan Bubna
nathan@esha.com

Nathan Bubna said:
> i once tried to get this discussion going on the wiki so that it could be
> better organized and preserved in order for action to be taken on it, but it
> never really got anywhere.  people (myself included) don't seem motivitated
to
> do much besides debate it over email.  unless someone decides to really go
> after this, i don't anticipate much action anytime soon.
>
> Nathan Bubna
> nathan@esha.com
>
> Neeme Praks said:
> > Hi all!
> >
> > Have we got any further on this issue?
> > As the bugzilla issue seems to be open, I guess not?
> > Could we decide something? At least then we could do a patch.
> >
> > Rgds,
> > Neeme
> >
> > Will Glass-Husain wrote:
> > > Dumb question, but how do you vote? I didn't see an option in Bugzilla.
> Or
> > > did you mean comment in the forum?
> > >
> > > I get frustrated with this issue every time I try to generate a text
file
> > > (as opposed to HTML).  It's a real PITA to do readable Velocity
templates
> in
> > > this circumstance.
> > >
> > > Someone needs to do a patch on this.  Then there will be something
> specific
> > > to talk about...
> > >
> > > WILL
> > >
> > > ----- Original Message ----- 
> > > From: "Christoph Reck" <ap...@recks.org>
> > > To: "Velocity Users List" <ve...@jakarta.apache.org>
> > > Sent: Wednesday, March 03, 2004 7:43 AM
> > > Subject: Re: Status: macros and white space gobbling
> > >
> > >
> > >
> > >>My proposal is now a enhancement request in bugzilla:
> > >>   http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27413
> > >>
> > >>Everyone, please vote for it if you agree with my view of
> > >>it!
> > >>
> > >>Cheers,
> > >>Christoph
> > >>
> > >>Cabrera, Benjamin wrote:
> > >>
> > >>>Hi all.
> > >>>
> > >>>I have read many previous emails about the issue of macros and white
> > >
> > > space
> > >
> > >>>gobbling. Most go back and forth and give valid workarounds, but I
> > >
> > > haven't
> > >
> > >>>seen anything about implementing a solution for this.
> > >>>
> > >>>Is there something in the works for this? Or is there an ongoing debate
> > >
> > > of
> > >
> > >>>whether to "suppress or not suppress"?
> > >>>
> > >>>Thanks for a great tool!
> > >>>
> > >>>Ben Cabrera
> > >>
> > >>
> > >>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > >>For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> > >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Nathan Bubna <na...@esha.com>.
i once tried to get this discussion going on the wiki so that it could be
better organized and preserved in order for action to be taken on it, but it
never really got anywhere.  people (myself included) don't seem motivitated to
do much besides debate it over email.  unless someone decides to really go
after this, i don't anticipate much action anytime soon.

Nathan Bubna
nathan@esha.com

Neeme Praks said:
> Hi all!
>
> Have we got any further on this issue?
> As the bugzilla issue seems to be open, I guess not?
> Could we decide something? At least then we could do a patch.
>
> Rgds,
> Neeme
>
> Will Glass-Husain wrote:
> > Dumb question, but how do you vote? I didn't see an option in Bugzilla.
Or
> > did you mean comment in the forum?
> >
> > I get frustrated with this issue every time I try to generate a text file
> > (as opposed to HTML).  It's a real PITA to do readable Velocity templates
in
> > this circumstance.
> >
> > Someone needs to do a patch on this.  Then there will be something
specific
> > to talk about...
> >
> > WILL
> >
> > ----- Original Message ----- 
> > From: "Christoph Reck" <ap...@recks.org>
> > To: "Velocity Users List" <ve...@jakarta.apache.org>
> > Sent: Wednesday, March 03, 2004 7:43 AM
> > Subject: Re: Status: macros and white space gobbling
> >
> >
> >
> >>My proposal is now a enhancement request in bugzilla:
> >>   http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27413
> >>
> >>Everyone, please vote for it if you agree with my view of
> >>it!
> >>
> >>Cheers,
> >>Christoph
> >>
> >>Cabrera, Benjamin wrote:
> >>
> >>>Hi all.
> >>>
> >>>I have read many previous emails about the issue of macros and white
> >
> > space
> >
> >>>gobbling. Most go back and forth and give valid workarounds, but I
> >
> > haven't
> >
> >>>seen anything about implementing a solution for this.
> >>>
> >>>Is there something in the works for this? Or is there an ongoing debate
> >
> > of
> >
> >>>whether to "suppress or not suppress"?
> >>>
> >>>Thanks for a great tool!
> >>>
> >>>Ben Cabrera
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Neeme Praks <ne...@apache.org>.
Hi all!

Have we got any further on this issue?
As the bugzilla issue seems to be open, I guess not?
Could we decide something? At least then we could do a patch.

Rgds,
Neeme

Will Glass-Husain wrote:
> Dumb question, but how do you vote? I didn't see an option in Bugzilla.  Or
> did you mean comment in the forum?
> 
> I get frustrated with this issue every time I try to generate a text file
> (as opposed to HTML).  It's a real PITA to do readable Velocity templates in
> this circumstance.
> 
> Someone needs to do a patch on this.  Then there will be something specific
> to talk about...
> 
> WILL
> 
> ----- Original Message ----- 
> From: "Christoph Reck" <ap...@recks.org>
> To: "Velocity Users List" <ve...@jakarta.apache.org>
> Sent: Wednesday, March 03, 2004 7:43 AM
> Subject: Re: Status: macros and white space gobbling
> 
> 
> 
>>My proposal is now a enhancement request in bugzilla:
>>   http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27413
>>
>>Everyone, please vote for it if you agree with my view of
>>it!
>>
>>Cheers,
>>Christoph
>>
>>Cabrera, Benjamin wrote:
>>
>>>Hi all.
>>>
>>>I have read many previous emails about the issue of macros and white
> 
> space
> 
>>>gobbling. Most go back and forth and give valid workarounds, but I
> 
> haven't
> 
>>>seen anything about implementing a solution for this.
>>>
>>>Is there something in the works for this? Or is there an ongoing debate
> 
> of
> 
>>>whether to "suppress or not suppress"?
>>>
>>>Thanks for a great tool!
>>>
>>>Ben Cabrera
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Will Glass-Husain <wg...@forio.com>.
Dumb question, but how do you vote? I didn't see an option in Bugzilla.  Or
did you mean comment in the forum?

I get frustrated with this issue every time I try to generate a text file
(as opposed to HTML).  It's a real PITA to do readable Velocity templates in
this circumstance.

Someone needs to do a patch on this.  Then there will be something specific
to talk about...

WILL

----- Original Message ----- 
From: "Christoph Reck" <ap...@recks.org>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Wednesday, March 03, 2004 7:43 AM
Subject: Re: Status: macros and white space gobbling


> My proposal is now a enhancement request in bugzilla:
>    http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27413
>
> Everyone, please vote for it if you agree with my view of
> it!
>
> Cheers,
> Christoph
>
> Cabrera, Benjamin wrote:
> > Hi all.
> >
> > I have read many previous emails about the issue of macros and white
space
> > gobbling. Most go back and forth and give valid workarounds, but I
haven't
> > seen anything about implementing a solution for this.
> >
> > Is there something in the works for this? Or is there an ongoing debate
of
> > whether to "suppress or not suppress"?
> >
> > Thanks for a great tool!
> >
> > Ben Cabrera
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Christoph Reck <ap...@recks.org>.
My proposal is now a enhancement request in bugzilla:
   http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27413

Everyone, please vote for it if you agree with my view of
it!

Cheers,
Christoph

Cabrera, Benjamin wrote:
> Hi all.
> 
> I have read many previous emails about the issue of macros and white space
> gobbling. Most go back and forth and give valid workarounds, but I haven't
> seen anything about implementing a solution for this.
> 
> Is there something in the works for this? Or is there an ongoing debate of
> whether to "suppress or not suppress"?
> 
> Thanks for a great tool!
> 
> Ben Cabrera


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Status: macros and white space gobbling

Posted by Claude Brisson <cl...@renegat.net>.
Cabrera, Benjamin wrote :

> Hi all.
>
> I have read many previous emails about the issue of macros and white space
> gobbling. Most go back and forth and give valid workarounds, but I haven't
> seen anything about implementing a solution for this.
>
> Is there something in the works for this? Or is there an ongoing debate of
> whether to "suppress or not suppress"?

As you may have read, there are basically two approaches :
 - the use of comments (like ## at the end of each line, or #* *# to glob indentation)
 - a post filtering

Some have spoken about a #glob or #filter user directive, that should not be really difficult to write using the user directives
mechanism, but I did not hear of any implementation.

In fact :
 - if you need some kind of strict formatting for a non-html format, the comments workaround will often do the trick
 - if you want to reduce the page of your html pages, just use application/gzip mode
 - if you want to beautify generated code, well use a beautifer/cleaner like JTidy

CloD


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org