On Thu, Feb 26, 2009 at 7:35 AM, Christoph Zwerschke <[email protected]> wrote:
>
> Mark Ramm schrieb:
>> Right now it is easy to write a render method that configures and uses
>> genshi however you want.   And your custom render method can be stuck
>> in the renderers dictionary and even set as the default renderer.
>
> I think it's not so easy because it is not documented anywhere.

Agreed, and this is something we should fix.   I started on this this
weekend, but did not finish.

But when the docs are completed they willl be here:

http://www.turbogears.org/2.0/docs/main/Templates/Alternative.html#writing-your-own-render-function

> And
> there are some pitfalls. For instance, you cannot name your rendered
> like one of the default renderers, even if you intend to replace one of
> these, because this entry will be overwritten. You also cannot reuse the
> default renderer function in your own function (unless you directly
> import it) because in the config file they have not yet been set up.

I don't think they won't be overwritten if you don't have them in the
list of renderers to prepare.

>> This allows total flexibility in how genshi, mako, jinja2, and
>> whatever other template engine you want to use are setup -- and does
>> not limit you to a common subset of features supported by buffet.
>
> My feeling is that we have thrown away the baby with the bathwater here.
>        It was in fact possible to provide options specific to one
> templating engine with buffet. If it had shortcomings, buffet should
> have been improved instead of completely throwing it away. I guess the
> problem was that nobody cared about buffet because nobody felt
> responsible. Maybe we as TG community should have better enforced and
> improved the buffet standard. But I guess it's probably too late already.


Yea, too late already.  And there are many things that went wrong with
buffet and nobody was willing to do the work to fix it.   And the
simple render function solution worked, and was what Pylons was using
so we standardized on it.

>> But it would probably be a good idea to have a few simple options for
>> the three default renderers so you don't even have to write the couple
>> of lines of code required to create your own renderer for those common
>> cases.
>
> Either that or the couple of lines that you need to add should be
> clearly documented with some examples. Best let's do both. (Just saw
> that there is already a ticket http://trac.turbogears.org/ticket/2137
> and added a comment. I think its priority should be set to high again.)

Yea, makes sense.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to