[Grok-dev] Re: Skinning/themeing

Martin Aspeli optilude at gmx.net
Sat May 19 17:11:03 EDT 2007

Hi Martijn,

> It also supports evolution of the framework over time. I.e. you can 
> introduce a new templating language evolutionarily and you're not locked 
> into the same template language forever.

Definitely. Maybe it's not so much about being template neutral, as it 
is about making a strong choice of one templating language and sticking 
to it (at least until a compelling reason can be found to migrate 
*everything* over to a new one).

>> but as a user of a framework, 
>> I want the framework authors to have chosen the template solution for 
>> me.  And I want all documentation and code examples to use the same
>> language as well, so that half of it isn't irrelevant to me no matter 
>> which one I choose. How should I know which one is best for me, anyway, 
>> if I'm new to the framework?
> These are all points and it's one of the things that's been nagging me 
> about the goal of template language neutrality. Some benefits though:
> * as you mentioned: separation of concerns
> * evolution potential: we'd not be locked into ZPTs forever
> * ability to reuse existing code surrounding Buffet (or Smorgasbord). A 
> whole range of template languages become available.
> * Grok/Zope 3 can "get out of the template language business"

We seem to be wanting to get out of a lot of businesses these days. I 
still prefer ZPTs to all other templating solutions I've used and looked 
(though I haven't spent much time with Genshi yet).

> I actually have two goals here:
> * template language neutrality would be good from an architecture 
> perspective


> * I want to move away from ZPT as Grok's template language.


I think it's something that we should give very careful thought to. ZPT 
is the modus operandi in the Zope (2 + 3 + Plone) world. We may find 
there are beneficial synergies here (for example in terms of form 
widgets, particular viewlets and so on).

> I'd be interested in seeing whether we can use Genshi. It's conceptually 
> similar to ZPT. It doesn't support path expressions, but I am thinking 
> more and more path expressions are hurting us more than they gain us. 
> They're shorter, yeah, but only because python expressions in ZPT 
> require you to type: 'python:'! More readable? More comprehensible? I am 
> skeptical. (genshi incidentally does make foo.bar and foo['bar'] mean 
> the same thing, if I recall correctly)

If the benefits of a different templating language are not very strong, 
I think we need to be careful. We could end up "stick in the middle" 
where Zope developers feel uneasy about an alien templating language and 
non-Zope developers feel uneasy about various Zopeisms. :)

I'm not saying it's a bad idea, only that it's not one to take lightly.

> One of the reasons I advocate template language neutrality is so we can 
> get in a new template language *at all*. If we simply replace ZPT with 
> Genshi, our code will break. That's rather too drastic.


> I think Grok should do the following:
> * become template language neutral
> * promote 1 template language in all its examples and own codebase.
> * offer an advanced usage where you can throw in templates in other 
> languages. It would be best if we could do this on the Zope 3 level 
> itself, but that's probably a major assignment we can't take on, so we 
> may end up doing it for Grok.

Broadly, I agree with those.


More information about the Grok-dev mailing list