Re: Newline stripping in templates: the dnl way

2012-06-28 Thread Stephen Kelly
Leon Matthews wrote: > On 2 March 2012 09:45, Carl Meyer > wrote: >> Same reason any ticket stalls - it seems that nobody felt strongly >> enough about it to put the time into reviewing and thoroughly testing >> the patch and marking it Ready for Checkin. If you'd like to see it in >> (post 1.4 a

Re: Newline stripping in templates: the dnl way

2012-06-27 Thread Leon Matthews
On 2 March 2012 09:45, Carl Meyer wrote: > Same reason any ticket stalls - it seems that nobody felt strongly > enough about it to put the time into reviewing and thoroughly testing > the patch and marking it Ready for Checkin. If you'd like to see it in > (post 1.4 at this point, of course), feel

Re: Newline stripping in templates: the dnl way

2012-03-01 Thread Leon Matthews
> Same reason any ticket stalls - it seems that nobody felt strongly > enough about it to put the time into reviewing and thoroughly testing > the patch and marking it Ready for Checkin. If you'd like to see it in > (post 1.4 at this point, of course), feel free to do that! Fair enough. I realise

Re: Newline stripping in templates: the dnl way

2012-03-01 Thread Carl Meyer
On 03/01/2012 01:28 PM, Leon Matthews wrote: > It looks like a lot of work looks went into this patch, why did it stall? Same reason any ticket stalls - it seems that nobody felt strongly enough about it to put the time into reviewing and thoroughly testing the patch and marking it Ready for Check

Re: Newline stripping in templates: the dnl way

2012-03-01 Thread Leon Matthews
> I believe that is what has been suggested, and tickets produced by > SmileyChris and worked on by others to that end, at > https://code.djangoproject.com/ticket/2594 That's... quite fantastic. A actual patch for the exactly the behaviour I had in mind. Why was it not commited for 1.3 or 1.4?

Re: Newline stripping in templates: the dnl way

2012-02-28 Thread Tai Lee
On Feb 29, 8:15 am, Leon Matthews wrote: > Would it be feasible to add some logic, something along the lines of: > > "Template lines containing just tags with no literal content do not > produce a line in the output  (unless of course the tag itself > produces one)" I believe that is what has b

Re: Newline stripping in templates: the dnl way

2012-02-28 Thread Leon Matthews
> Django templates are useful (and used) for all sorts of text-based > formats. For some of these, an exact control over whitespace is needed > throughout the entire file (eg. text/plain), Agreed. When I started using Django templates I was very surprised at the output I was seeing. After a whil

Re: Newline stripping in templates: the dnl way

2012-02-27 Thread Anssi Kääriäinen
On Feb 27, 1:01 pm, Tobia wrote: > After reading all the above, I can see the arguments against this: > >     if forloop.last >         %} empty-form last-related{% >     endif > %}" id="{{ >     ... > > Ugh!! Agreed. Seeing that just changed me from +1 to -0 for multiline tags. Although the mul

Re: Newline stripping in templates: the dnl way

2012-02-27 Thread Tobia
Jonathan French wrote: > Let me make sure I've got this right --- The situation being discussed is > not where whitespace is insignificant and can be stripped, but where > whitespace is important and you want to control the exact amount of it, > e.g. plain text emails. In this case, just using stri

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Jonathan French
Let me make sure I've got this right --- The situation being discussed is not where whitespace is insignificant and can be stripped, but where whitespace is important and you want to control the exact amount of it, e.g. plain text emails. In this case, just using stripwhitespace is not enough. Righ

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread mjl Martin J. Laubach
> > foo bar {# >> #}baz >> >> >> You just made a strong argument against multiline tags: I wouldn't want > to see them abused this way! > Ah, I fully expected to be shot down on "aesthetic" reasons. I still think it's better to have some (maybe slightly ugly) way to do things than no way an

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Tai Lee
I think this discussion is focusing on template tags, not template variables. Maybe even a subset of template tags (e.g. block level tagsif, for, block, filter, etc). Template variables and inline tags (e.g. now) shouldn't have white space stripped. In 100% of cases I can think of I either woul

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Anssi Kääriäinen
On Feb 25, 12:04 pm, Florian Apolloner wrote: > Hi, > > On Saturday, February 25, 2012 10:04:21 AM UTC+1, Anssi Kääriäinen wrote: > > > In most situations white space matters: > > {{ user.lastname }} {{ user.firstname }} > > Right, but > """ > {{ user.lastname }} > {{ user.firstname }} > """ > wou

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Florian Apolloner
Hi, On Saturday, February 25, 2012 10:04:21 AM UTC+1, Anssi Kääriäinen wrote: > > In most situations white space matters: > {{ user.lastname }} {{ user.firstname }} > Right, but """ {{ user.lastname }} {{ user.firstname }} """ would have produced exactly the same output in HTML, hence my state

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Anssi Kääriäinen
On Feb 25, 10:52 am, Florian Apolloner wrote: > Hi, > > On Saturday, February 25, 2012 5:27:43 AM UTC+1, Tai Lee wrote: > > > Adding more symbols to existing tags (e.g. {^ for x in y ^} or {% for > > x in y -%}), multi-line comment tags that don't actually include a > > comment, and half baked com

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Florian Apolloner
Hi, On Saturday, February 25, 2012 5:27:43 AM UTC+1, Tai Lee wrote: > > Adding more symbols to existing tags (e.g. {^ for x in y ^} or {% for > x in y -%}), multi-line comment tags that don't actually include a > comment, and half baked comment tags (where the closing tag is > assumed) are all

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread Tai Lee
Adding more symbols to existing tags (e.g. {^ for x in y ^} or {% for x in y -%}), multi-line comment tags that don't actually include a comment, and half baked comment tags (where the closing tag is assumed) are all going to make templates uglier, and harder to read. The comment tag based solutio

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread Florian Apolloner
s/why/way/ sry :( On Friday, February 24, 2012 11:47:21 PM UTC+1, Florian Apolloner wrote: > > Hi, > > On Friday, February 24, 2012 7:48:29 PM UTC+1, ojno wrote: >> >> Jinja implements whitespace control by putting a minus sign after/before >> the % in a tag - >> http://jinja.pocoo.org/docs/te

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread Florian Apolloner
Hi, On Friday, February 24, 2012 7:48:29 PM UTC+1, ojno wrote: > > Jinja implements whitespace control by putting a minus sign after/before > the % in a tag - http://jinja.pocoo.org/docs/templates/#whitespace-control - > I haven't tried it myself, but it looks like {% tag -%} is equivalent to >

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread Jonathan French
Jinja implements whitespace control by putting a minus sign after/before the % in a tag - http://jinja.pocoo.org/docs/templates/#whitespace-control - I haven't tried it myself, but it looks like {% tag -%} is equivalent to your {% tag %}{# . On 24 February 2012 17:37, Tobia wrote: > Tai Lee wrot

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread Tobia
Tai Lee wrote: > I don't think adding {# to the end of lines is easy to understand at a > glance, it doesn't even convey a hint of meaning like "dnl" does I beg to differ. {# is already recognized by template authors as meaning "start of comment", and they know (or should know) that it cannot ext

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread Aymeric Augustin
2012/2/24 mjl Martin J. Laubach > For this (avoiding newlines) the currently discussed multiline > tags > would work pretty well too without adding more cruft to the template > language: > > foo bar {# > #}baz > > > Martin,

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread mjl Martin J. Laubach
For this (avoiding newlines) the currently discussed multiline tags would work pretty well too without adding more cruft to the template language: foo bar {# #}baz mjl -- You received this message because you are subsc

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread Aron Griffis
On Fri, Feb 24, 2012 at 9:45 AM, Tom Evans wrote: > In your folder are: > {^ for item in folder ^} > {{ item }}, > {^ endfor ^} > > This would render as "In your folder are: item1,item2,item3," > > Changing some of the carets: > > In your folder are: > {% for item in folder ^} > {{ item }}, > {^ e

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread Tom Evans
On Fri, Feb 24, 2012 at 2:10 PM, Tobia wrote: > Hi all, > regarding issue #2594 "Template system should handle whitespace > better" explaining the need for some kind of (optional) whitespace > stripping from the output of templates, I've been looking at the > proposed solutions and compared them t

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread Tai Lee
I definitely want to see a resolution to this issue. Django templates when white space matters (e.g. plain text emails) are painful. But, I don't think adding {# to the end of lines is easy to understand at a glance, it doesn't even convey a hint of meaning like "dnl" does, but either option is pre

Newline stripping in templates: the dnl way

2012-02-24 Thread Tobia
Hi all, regarding issue #2594 "Template system should handle whitespace better" explaining the need for some kind of (optional) whitespace stripping from the output of templates, I've been looking at the proposed solutions and compared them to other template and macro engines. In particular, a his