[Templates] chains of filters

[prev] [thread] [next] [Date index for 2004/09/12]

From: Bruce McKenzie
Subject: [Templates] chains of filters
Date: 14:18 on 12 Sep 2004
I've written a few filters for munging text containing my own tokens for
various things, but I don't seem to be able to chain them together. That
is,
This works:

  [% FILTER emphasis %][% FILTER urls   %]
    *Some bold text* nam liber [ back to homepage | index.html ]  tempor
^some italic text^ soluta nobis option congue nihil etc. 
  [% END # %][% END # %]

So does defining the text as " BLOCK mytext" and then calling 
  [% mytext | urls | emphasis %]

I'd like to be able to group these filters with something like
   [% FILTER urls +  emphasis %]
     text
   [% END # %]

However, only one fillter gets applied with that syntax. Actually, what
I'd really like to do is write a template that looks like this
   [% my_group_of_filters %]
      Text to munge
   [% END %]

That would seem to require a MACRO that starts but does not finish a
BLOCK. Sounds like something that probably isn't (and shouldn't be)
possible, but I thought I'd ask anyway. 

Obviously, I can make a subroutine my_group_of_filters that runs the
text through several filters,  but I'd rather do it in proper TTK syntax
if I can.



--
Bruce 
 


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] chains of filters
Bruce McKenzie 14:18 on 12 Sep 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52