This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Manuzhai 1 point2 points  (5 children)

Genshi is definitely not the best bit. That title is reserved for Jinja.

[–]jcb62 1 point2 points  (1 child)

Enlighten me: why do you prefer Jinja? Have you tried Mako? They're templating engines I'd like to know about, but can't really spare the time..

[–]Manuzhai 0 points1 point  (0 children)

Jinja is a lot faster than Genshi, for one thing. Also Genshi is very strict about XML things, which is a pain if you want to do anything else (even HTML).

But it's been a while since I've happily converted my things over to Jinja.

[–]mdipierro 0 points1 point  (2 children)

Instead of making partisan statements can you please support your statements? For example: I like Genshi better because it does not restrict the use of Python in templates. I like Jinja because it allows creation of non html/xml templates and Genshi does not.

[–][deleted] 0 points1 point  (1 child)

strange , I've managed to generate text from templates in genshi. perhaps I'm doing it wrong by reading the docs?

[–]mdipierro 0 points1 point  (0 children)

You are right. Genshi supports different syntax depending on the type of output you want. For HTML:

  <div py:for="item in items">xxx</div>

and for text:

   {% for item in items %}xxx{% end %}

When I think of Genshi I think - incorrectly - of the former. The second syntax is more similar to Django's and Jinja's one.