[Grok-dev] Re: Templating alternatives,
Was: Neanderthal sprint topics
faassen at startifact.com
Sun Sep 30 04:01:04 EDT 2007
Jan-Wijbrand Kolman wrote:
> * Providing Genshi as a templating option should not be just on the Grok
> layer. If I understand you correctly, your prototype was indeed on a
> Zope-3 level, and that's good! If we were to embrace Genshi (or whatever
> other alternative templating system), we should (IMHO) make sure it is a
> usable alternative for Zope-3 itself first too.
Actually there is really no Zope 3 layer for template integration to
speak of right now, so you'd have to invent one. You use pagetemplates
by importing from the zope.pagetemplate package and such. We'd use
Genshi by importing from the Genshi package.
It's quite possible of course eventually some small integration logic
will be written, in which case we should release this as a Zope 3
package preferably. It can't be our priority on the near term though, as
we don't really know what "Zope 3 integration of template languages" means.
And eventually some buffet successor will hopefully arise for template
language pluggability. Though I spoke to Jim about this in may and he
was very skeptical about such efforts, and he said: "just use the
package and use 'import'". While I disagree with his skepticism, he does
have a point: it's definitely the right way to get started. :)
> * I would not like the idea of having Genshi as the *default* templating
> system when using Grok, as long as Zope-3 itself uses ZPT as the
> default. Still, I fully agree that we should provide an easily
> accessible way of choosing a templating system for your application
The first question is what 'default' means in terms of Grok templating
If we support two template languages, X and Y, in Grok, which one is the
default? My idea is that they're recognized on a file extension basis,
so if you drop something with an extension for X into foo_templates,
it'll use template language X, and if you drop something in with an
extension for Y it'll use template language Y. So far there's no default.
I can see three meanings for a template language X being the default for
* it's presented in our official documentations as the main template
language. So, the tutorial examples are all in template language X,
except where we give an example of how you can also use template language Y.
* Grok itself preferably uses it, for instance in the Admin UI
implementation. More generally, existing Grok code out there uses
template language X.
* It's the most solidly implemented template language. I.e. the least
buggy, it's clear it got the most banging on so actually works, unlike
template language Z, which is theoretically integrated but actually
crashes when you macroify the groklet with the adaptoids and then it
breaks, how horrible, has anyone be using this?
More information about the Grok-dev