You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by bob <bo...@accurev.com> on 2000/08/30 08:30:24 UTC
#comment directive?
Anyone (else) interested in a #comment directive, to
allow for multiline comments? Useful for copyrights,
debugging, or other stuff you don't want in the
end-result of the template?
ie:
#comment {
This will never be seen
}
semantically equiv to
#if (false) {
This will never be seen
}
Bear in mind, we already have single-line comments as double-hashes.
## This will never be seen.
Eh?
-bob
Re: #comment directive?
Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
bob wrote:
>
> Anyone (else) interested in a #comment directive, to
> allow for multiline comments? Useful for copyrights,
> debugging, or other stuff you don't want in the
> end-result of the template?
>
> ie:
>
> #comment {
> This will never be seen
> }
>
> semantically equiv to
>
> #if (false) {
> This will never be seen
> }
>
> Bear in mind, we already have single-line comments as double-hashes.
>
> ## This will never be seen.
+1, definitely useful (even to template developers). ;)
--
Daniel Rall <dl...@finemaltcoding.com>
Re: #comment directive?
Posted by John McNally <jo...@clearink.com>.
>
> > > I would also like to see a:
> > >
> > > #compress
> > > {
> > >
> > > }
> > >
> > > which would remove the newlines in the output. this is good for
compressing
> > > <table>'s so that there isn't funny spaces in the rendered
pages...damn
> > > stupid browsers. :-)
>
> It's deinetely worth purusing. Taking your whole template into a clause
like that
> would make it very 'view-source' unfirendly and easy to edit at the same
time.
> This is not nice, still some pepole will like it...
>
> > Just removing newlines or totally collapsing all whitespace?
>
> collapsing all withiespace would clobber normal text. We need something
more
> rectified here.
>
If it is not difficult, it would be good to only remove whitespace between
the first/last non-whitespace character and the closing/opening tag. But if
this proves to be too difficult, a #compress that removes all whitespace
outside of a tag, would still be very useful. As a primary use (I think) is
to build an "imagemap-like" navigation that renders correctly on todays
browsers. This involves a series of <td>, <a>, and <img> tags that cannot
have any whitespace in between. So please add the directive regardless.
Re: #comment directive?
Posted by Rafal Krzewski <Ra...@e-point.pl>.
Jason van Zyl wrote:
> > collapsing all withiespace would clobber normal text. We need something more
> > rectified here.
>
> No, no collapse multiple spaces into single spaces. Collapse multiple
> newlines into a single new line :)
Fine, but if you lavee a single extra space within <td> it will still break your
table.
I'd say - if a text block between tags is all whitespace, kill it, otherwise
collapse all withespace (staces, tabs, newlines) into a single space. I think this
would work.
Rafal
Re: #comment directive?
Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
Jason van Zyl wrote:
> [snip]
> No, no collapse multiple spaces into single spaces. Collapse multiple
> newlines into a single new line :)
...and this functionality is already in the visitor/Utils class, I
believe. =)
--
Daniel Rall <dl...@finemaltcoding.com>
Re: #comment directive?
Posted by Jason van Zyl <jv...@periapt.com>.
On Wed, 30 Aug 2000, Rafal Krzewski wrote:
> Jason van Zyl wrote:
> >
> > On Wed, 30 Aug 2000, Jon Stevens wrote:
> >
> > > on 8/29/2000 11:30 PM, "bob" <bo...@accurev.com> wrote:
> > >
> > > > Anyone (else) interested in a #comment directive, to
> > > > allow for multiline comments? Useful for copyrights,
> > > > debugging, or other stuff you don't want in the
> > > > end-result of the template?
> > >
> > > +1
>
> +1 It will be GRAET for debugging.
>
> > > I would also like to see a:
> > >
> > > #compress
> > > {
> > >
> > > }
> > >
> > > which would remove the newlines in the output. this is good for compressing
> > > <table>'s so that there isn't funny spaces in the rendered pages...damn
> > > stupid browsers. :-)
>
> It's deinetely worth purusing. Taking your whole template into a clause like that
> would make it very 'view-source' unfirendly and easy to edit at the same time.
> This is not nice, still some pepole will like it...
>
> > Just removing newlines or totally collapsing all whitespace?
>
> collapsing all withiespace would clobber normal text. We need something more
> rectified here.
No, no collapse multiple spaces into single spaces. Collapse multiple
newlines into a single new line :)
jvz.
--
Jason van Zyl
jvanzyl@periapt.com
Re: #comment directive?
Posted by Rafal Krzewski <Ra...@e-point.pl>.
Jason van Zyl wrote:
>
> On Wed, 30 Aug 2000, Jon Stevens wrote:
>
> > on 8/29/2000 11:30 PM, "bob" <bo...@accurev.com> wrote:
> >
> > > Anyone (else) interested in a #comment directive, to
> > > allow for multiline comments? Useful for copyrights,
> > > debugging, or other stuff you don't want in the
> > > end-result of the template?
> >
> > +1
+1 It will be GRAET for debugging.
> > I would also like to see a:
> >
> > #compress
> > {
> >
> > }
> >
> > which would remove the newlines in the output. this is good for compressing
> > <table>'s so that there isn't funny spaces in the rendered pages...damn
> > stupid browsers. :-)
It's deinetely worth purusing. Taking your whole template into a clause like that
would make it very 'view-source' unfirendly and easy to edit at the same time.
This is not nice, still some pepole will like it...
> Just removing newlines or totally collapsing all whitespace?
collapsing all withiespace would clobber normal text. We need something more
rectified here.
Rafal
Re: #comment directive?
Posted by Jason van Zyl <jv...@periapt.com>.
On Wed, 30 Aug 2000, Jon Stevens wrote:
> on 8/29/2000 11:30 PM, "bob" <bo...@accurev.com> wrote:
>
> > Anyone (else) interested in a #comment directive, to
> > allow for multiline comments? Useful for copyrights,
> > debugging, or other stuff you don't want in the
> > end-result of the template?
>
> +1
>
> I would also like to see a:
>
> #compress
> {
>
> }
>
> which would remove the newlines in the output. this is good for compressing
> <table>'s so that there isn't funny spaces in the rendered pages...damn
> stupid browsers. :-)
Just removing newlines or totally collapsing all whitespace?
jvz.
--
Jason van Zyl
jvanzyl@periapt.com
Re: #comment directive?
Posted by Jon Stevens <jo...@latchkey.com>.
on 8/29/2000 11:30 PM, "bob" <bo...@accurev.com> wrote:
> Anyone (else) interested in a #comment directive, to
> allow for multiline comments? Useful for copyrights,
> debugging, or other stuff you don't want in the
> end-result of the template?
+1
I would also like to see a:
#compress
{
}
which would remove the newlines in the output. this is good for compressing
<table>'s so that there isn't funny spaces in the rendered pages...damn
stupid browsers. :-)
-jon
--
http://scarab.tigris.org/ | http://noodle.tigris.org/
http://java.apache.org/ | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/ | http://www.sourcexchange.com/