Jonathan | 20 Jan 22:20

bug: documentation uses unsupported (but TAL spec) modifier

I noticed this today in the petal documentation:

=======
omit-tag

Abstract

   <tag tal:omit-tag="EXPRESSION">Some contents</tag>
Example

   <b tal:omit-tag="not:bold">I may not be bold.</b>
If not:bold is evaluated as TRUE, then the <b> tag will be omited. If  
not:bold is evaluated as FALSE, then the <b> tag will stay in place.

Why?

omit-tag statements can be used to leave the contents of a tag in  
place while omitting the surrounding start and end tags if the  
expression which is evaluated is TRUE.

TIP:

If you want to ALWAYS remove a tag, you can use omit-tag="string:1"

=======

i've discussed this before, but "not:" is a TAL modifier that isn't  
in petal

i just wanted to bring this up again, as following the docs in this  
(Continue reading)

Bruno Postle | 27 Jan 14:31
X-Face

Re: bug: documentation uses unsupported (but TAL spec) modifier

On Fri 20-Jan-2006 at 16:20 -0500, Jonathan wrote:
>
> i've discussed this before, but "not:" is a TAL modifier that isn't  
> in petal

> i suggest either:

> * patching petal to use not: which is in the TAL spec (patch below)
> * changing the docs from not to false

Thanks, I've added 'not:' as an alias to 'false:' in Petal::Hash.

Note that 'not:', 'string:' and 'path:' are required by TALES: 

  http://www.zope.org/Wikis/DevSite/Projects/ZPT/TALES%20Specification%201.3

So Petal is still missing 'path:'.

--

-- 
Bruno

Jonathan Vanasco | 27 Jan 17:28

Re: bug: documentation uses unsupported (but TAL spec) modifier


On Jan 27, 2006, at 8:31 AM, Bruno Postle wrote:

> Thanks, I've added 'not:' as an alias to 'false:' in Petal::Hash.
>
> Note that 'not:', 'string:' and 'path:' are required by TALES:
>  http://www.zope.org/Wikis/DevSite/Projects/ZPT/TALES% 
> 20Specification%201.3
>
> So Petal is still missing 'path:'.

I guess the first person who needs to use it gets to make the patch!

( crosses fingers and hopes thats not me )

Jonathan Vanasco | 25 Jan 07:45

Re: bug: documentation uses unsupported (but TAL spec) modifier


actually, i realized a more elegant solution-

lib/Petal/Hash.pm
(  add this  line @72 )
=====
$MODIFIERS->{'not:'} = $MODIFIERS->{'false:'};
=====

that uses the same approach as the rest of Petal.  I was tired and  
didn't notice that would work earlier.

sorry for suggesting  a poor patch earlier.

Bruno Postle | 30 Jan 17:21

Re: bug: documentation uses unsupported (but TAL spec) modifier

Jonathan Vanasco wrote:
> 
> actually, i realized a more elegant solution-

> $MODIFIERS->{'not:'} = $MODIFIERS->{'false:'};

Yep, that's exactly what I did:

https://lists.webarch.co.uk/pipermail/mkdoc-commit/2006-January/001087.html

--

-- 
Bruno


Gmane