[Grok-dev] Re: grok.PageTemplate and content types
Martijn Faassen
faassen at startifact.com
Mon Jan 15 15:33:04 EST 2007
Philipp von Weitershausen wrote:
> Martijn Faassen wrote:
>> Philipp von Weitershausen wrote:
>> [snip]
>>> Right. It should probably suggest that different parsers would be
>>> used, e.g.:
>>>
>>> index = grok.PageTemplate('<p />', parse='xml')
>>>
>>> or
>>>
>>> class MyView(grok.View):
>>> grok.template('index.pt', parse='xml')
>>
>> I still am not convinced grok.template should be used for this. This
>> would force anyone to spell out the name of a template if they only
>> want to control the parser.
>
> Good point. So let's use file extensions ;)
So instead of having people spell out the filename explicitly when not
needed they'll have to rename a file instead? :)
File extensions are in my opinion not a good way to parameterize the
templating engine; I think we can argue fairly well that the choice of
an XML parser or not as a parameter of the whole templating activity in
case of ZPT.
I would really like to let new extensions be used to hook in new kinds
of templating engine altogether.
I think we can assume that parameterization of the template engine is
something that occurs with enough template engines that we might want a
special Grok knob for it.
Regards,
Martijn
More information about the Grok-dev
mailing list