Re: Collecting snippets

Dave Howorth <dhoworth-fDajt2Yx3S8pY9vWkoisglpr/1R2p/[email protected]> Thu, 14 Jun 2012 10:43:33 +0100
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Organization MRC Laboratory for Molecular Biology
Message-ID <[email protected]>
Andy Wardley wrote:
> On 13/06/2012 15:22, Dave Howorth wrote:
>> I'm sure there must be a way to do this, and I'm guessing it probably
>> involves WRAPPER, but my brain is fried. Can anybody give me a hint?
> 
> Hi Dave,
> 
> You could have a PRE_PROCESS template define a list for keywords and a
> MACRO to add a keyword to it:
> 
>   [% keywords = [ ];
> 
>      MACRO keyword(k)
>        CALL keywords.push(k);
>   -%]
> 
> And then define a WRAPPER template that looks something like this: [snip]

Thanks Andy, that helped clear my head!

Cheers, Dave