Roundup Tracker - Issues

Issue 2550507

classification
Title: Support alternate template engines
Type: rfe Severity: minor
Components: Web interface Versions: devel
process
Status: new Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: lu_zero, rouilj, stefan, techtonik, tobias-herp
Priority: Keywords:

Created on 2009-02-18 20:30 by lu_zero, last changed 2016-06-27 03:44 by rouilj.

Messages
msg3556 Author: [hidden] (lu_zero) Date: 2009-02-18 20:30
TAL isn't exactly the easiest nor the nicest template engine available
to python, mako and genshi could be an interesting alternative.
msg3569 Author: [hidden] (tobias-herp) Date: 2009-02-22 00:15
Well, this is a matter of taste. IMO, a templating language for
HTML/XHTML output *should* be XML-based, and mako is not
(http://www.makotemplates.org/).

Genshi supports XML-based templating
(http://genshi.edgewall.org/wiki/Documentation/0.5.x/templates.html#id5),
and it supports text templates as well, which could come in handy for a
configuration wizard (issue 2550515).  I can imagine that processing
instructions can be useful sometimes, e.g. to change a variable (append
to a list) in conditional code.

However, lots of Roundup folks like TAL/METAL, and we don't even make
use of it's strengths to the full extent.  If done properly, TAL
templates can be viewed with a browser and give a good impression of the
interpreted template.  I'm sure our templates can be optimized for
speed, too (e.g. multiple calls to context/is_view_ok could be avoided
by storing the result in a variable).  And we could update to METAL 1.1
(http://wiki.zope.org/ZPT/METALSpecification11), which would allow to
extend macros.

TAL/METAL is standardized; there are non-Python implementations.  I
don't consider some shorter attribute names ('py:if' instead of
'tal:condition') justify a complete switch of the templating language.

Thus, if you prefer Genshi, you are invited to make a suggestion for a
pluggable template engine interface.  Theoretically, the template
language used is specified in the template itself (for the XHTML flavour
of TAL, at least)... but perhaps we should stick with one of those
choices (TAL/METAL or Genshi) per tracker instance, or even per Roundup
installation.
msg3571 Author: [hidden] (lu_zero) Date: 2009-02-22 08:42
I wholeheartedly agree, that's why I wrote support and not switch.

mako main point is that is fast and quite simple, genshi main point is
that has pretty much everything tal has to offer but is way simpler to
grasp. Supporting any template engine (see turbogears) is a good choice
to get more people involved.
msg3577 Author: [hidden] (tobias-herp) Date: 2009-02-23 00:44
AFAIK, Turbogears supports Genshi, which evolved from Kid.  I don't
think it supports other templating languages, such as TAL/METAL, does it?
msg3579 Author: [hidden] (lu_zero) Date: 2009-02-23 01:25
Tobias wrote:
> Tobias <tobias.herp@gmx.de> added the comment:
> 
> AFAIK, Turbogears supports Genshi, which evolved from Kid.  I don't
> think it supports other templating languages, such as TAL/METAL, does it?

It supports pretty much any template

http://en.wikipedia.org/wiki/TurboGears#Template_plugins

turbogears is quite modular so you can mix and match if needed.

-- 

Luca Barbato
Gentoo Council Member
Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/~lu_zero
msg3701 Author: [hidden] (stefan) Date: 2009-05-06 14:15
FWIW, I'v just started playing with jinja (http://jinja.pocoo.org/), and
results look promising.
My primary goal now is to understand how to (minimally) refactor the
existing core code such that alternative template engines can be
configured via config.ini.

(FWIW, I do not agree that any template language ought to be XML-based.
But as lu_zero says, this shouldn't become a language discussion, but
rather a discussion about whether it's possible to open Roundup up to
support TAL alternatives.)
msg4800 Author: [hidden] (techtonik) Date: 2013-02-21 14:05
Support for Template Loader API is committed to HEAD as well as example 
Jinja2 template based on Twitter bootstrap. ;)
msg5656 Author: [hidden] (rouilj) Date: 2016-06-27 03:44
Is this ready to be closed?

It looks like we have a second template language supported by the core.
History
Date User Action Args
2016-06-27 03:44:09rouiljsetnosy: + rouilj
messages: + msg5656
2013-02-21 14:05:57techtoniksetnosy: + techtonik
messages: + msg4800
2009-05-06 14:15:45stefansetnosy: + stefan
messages: + msg3701
2009-02-23 01:25:44lu_zerosetmessages: + msg3579
2009-02-23 00:44:51tobias-herpsetmessages: + msg3577
2009-02-22 08:42:12lu_zerosetmessages: + msg3571
2009-02-22 00:15:50tobias-herpsetnosy: + tobias-herp
messages: + msg3569
2009-02-18 20:34:07lu_zerosetcomponents: + Web interface
2009-02-18 20:31:21lu_zerosettype: rfe
severity: normal -> minor
versions: + devel
2009-02-18 20:30:49lu_zerocreate