Re: [Paste] Tempita re-usable code templates

Top Page
Author: Ian Bicking
Date:  
To: Rick van der Zwet
CC: paste-users
Subject: Re: [Paste] Tempita re-usable code templates
I don't really like textual inclusion. It's all messy with scopes, and also
compile-time (and not much in Tempita is compile-time). Tempita does
support {{def}}, though maybe right now that's not easily accessible in the
way you want. Maybe if there was some form of import, like:

{{import "utils.tmpl" as utils}}

{{utils.foo}}


Then in utils.tmpl

{{def foo}}
some text
{{enddef}}

On Thu, Jun 17, 2010 at 2:21 AM, Rick van der Zwet
<info@???>wrote:

> I found myself copy pasting generic code blocks, so the attached patch
> introduces the include 'tag' so that you can nicely arrange your code
> in generic blocks.
>
> Idea borrowed from django it's template engine
> http://docs.djangoproject.com/en/dev/ref/templates/builtins/#include
>
> Cheerz,
> /Rick
> --
> http://rickvanderzwet.nl
>
> --
> You received this message because you are subscribed to the Google Groups
> "Paste Users" group.
> To post to this group, send email to paste-users@???.
> To unsubscribe from this group, send email to
> paste-users+unsubscribe@???<paste-users%2Bunsubscribe@???>
> .
> For more options, visit this group at
> http://groups.google.com/group/paste-users?hl=en.
>
>



-- 
Ian Bicking  |  http://blog.ianbicking.org

-- 
You received this message because you are subscribed to the Google Groups "Paste Users" group.
To post to this group, send email to paste-users@???.
To unsubscribe from this group, send email to paste-users+unsubscribe@???.
For more options, visit this group at http://groups.google.com/group/paste-users?hl=en.