While working on it one issue raised due to jinja2 dotted name support.

Currently jinja2 master template is named master.html, what happens
when you try to use the admin extension with genshi?
Well, it crashes as it expects master.html to be a genshi template.

This is caused by the fact that both jinja2 and genshi use .html as
their template extension, so if you have an extension that uses genshi
templates they would try to inherit from master.html expecting it to
be a genshi template.
The same issue doesn't happen with mako as mako templates are clearly
named .mak and so you will have master.html for your jinja2 template
and master.mak for mako and each template would inherit from
master.html or master.mak avoiding clashes.

The only solution to this issue I can think of is to use the .jinja2
extension for jinja2 templates so that they wouldn't collide anymore
with genshi templates, this is what some frameworks do and would solve
the clash making possible to have both genshi and jinja2 templates in
the same project.

As the jinja2 quickstart is still in beta and jinja2 dotted names
support has been a recent addition in 2.1.5 we are on time to change
it, while changing how genshi behaves would probably break many more
projects

I'm open to other proposals as I can see that some users might not
like the idea of having to use .jinja2 as the extension for jinja2
templates as the suggested extension on the jinja2 doc is actually
.html.

On Thu, Apr 12, 2012 at 5:04 AM, Michael Pedersen <[email protected]> wrote:
> Ya know, I really hate it when logical arguments get made that I should have
> thought of. Just can't stand it.
>
> Alessandro is right, we should have a default engine, all the time. Our
> current default is Genshi, and there's a strong argument to be made for
> making that the all the time engine.
>
> Anybody have any arguments against it?
>
> On Wed, Apr 11, 2012 at 3:30 PM, Alessandro Molina
> <[email protected]> wrote:
>>
>> On Wed, Apr 11, 2012 at 11:13 AM, Carlos Daniel Ruvalcaba Valenzuela
>> <[email protected]> wrote:
>> >
>> > That warning got me thinking that maybe I should also load Mako with
>> > Jinja, I'm not really sure if not loading another template system can
>> > hurt other functions such as TW, but I'm under the impression that the
>> > TW integration code sets the TW templates to either Mako or Genshi
>> > depending on what we have loaded.
>> >
>> > Any ideas on that?
>> >
>>
>> Thinking of it,
>> I'm starting to think that we should probably always add the genshi
>> dependency by default whenever any other tempate engine is used to
>> quickstart a tg project.
>> I know that it is something many people might not use and one more
>> dependency, but I see some reasons to do it anyway:
>>
>> 1) Many extensions like debugbar, admin and so on require Genshi to
>> work (admin works both with genshi and mako) . So people will have to
>> install it anyway and having it available from the begin might help
>> new users to work with TG without issues. As Genshi is already the
>> default template engine for TG it would make sense to have it as the
>> always available one.
>>
>> 2) Power Users are perfectly able to delete a line from their
>> setup.py, while newcomers might not even know what is setup.py and
>> would get angry if they  click on the admin link and see an error
>> after they just quickstarted the app with the random template engine
>> one of their friends told them is the best.
>>
>> 3) Having a clear default template engine, even if not perfect, would
>> make life easier for people that write extensions. Probably not having
>> a default engine will bring us to the point where every extension is
>> written with the author favorite engine resulting in projects that use
>> all template engines: one for each extension they plugged in.
>>
>> 4) Please note that point three has the side effect that whenever the
>> user plugs an app with a new template engine he will have to write the
>> master template for that specific template engine, having 4 master
>> templates to keep in sync is pain for everyone. At least if we make
>> genshi the default one he will probably have to write only two master
>> templates.
>>
>> Just my two cents, but they seem to make a lot of sense to me
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "TurboGears Trunk" 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-trunk?hl=en.
>>
>
>
>
> --
> Michael J. Pedersen
> My Online Resume: http://www.icelus.org/ -- Google+ http://plus.ly/pedersen
> Google Talk: [email protected] -- Twitter: pedersentg
>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears Trunk" 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-trunk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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-trunk?hl=en.

Reply via email to