By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,922 Members | 1,689 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,922 IT Pros & Developers. It's quick & easy.

template engine

P: n/a
Hi,

I'm looking for a template engine that can give me names of required
variables in parse time.
Calculation of a value for a specific variable name could be possibly done
in specified callback function.

For example:

<html>
<head>
<title>$title</title>
</head>
<body>
#if user
hello $user/name
#else
hello guest
#endif
</body>
</html>

for above document engine should call my function first giving an argument
"title", then second time with argument "user", and optionally if result
for user was not empty call function again with argument "user/name"
then engine should replace specific placeholders with results of my
callback function
obviously this is just example syntax, I hope you catch the idea

that would be nice if engine could work with non HTML documents.

thanks in advance for your help, and sorry for my English :)
//peter
Jan 13 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
piotr <pi***********@gmail.comwrites:

(...)
for user was not empty call function again with argument "user/name"
then engine should replace specific placeholders with results of my
callback function
obviously this is just example syntax, I hope you catch the idea

that would be nice if engine could work with non HTML documents.

thanks in advance for your help, and sorry for my English :)
Take a look at Kid (http://www.kid-templating.org/) and Genshi
(http://genshi.edgewall.org/).

--
Jorge Godoy <jg****@gmail.com>
Jan 13 '07 #2

P: n/a
On Sat, 13 Jan 2007 16:42:16 -0200, Jorge Godoy wrote:
Take a look at Kid (http://www.kid-templating.org/) and Genshi
(http://genshi.edgewall.org/).
I've already done a short look at kid, but to be honest I don't like it's
XML/Python syntax. I strongly prefer idea from SimpleTAL or HTMLTemplates
where HTML and Python code are separated.
But syntax is for me not so important like functionality so maybe I have
to get back and look at kid again :)

any other engines? :)

thanks
//peter
Jan 13 '07 #3

P: n/a
piotr wrote:
On Sat, 13 Jan 2007 16:42:16 -0200, Jorge Godoy wrote:
>Take a look at Kid (http://www.kid-templating.org/) and Genshi
(http://genshi.edgewall.org/).

I've already done a short look at kid, but to be honest I don't like it's
XML/Python syntax. I strongly prefer idea from SimpleTAL or HTMLTemplates
where HTML and Python code are separated.
But syntax is for me not so important like functionality so maybe I have
to get back and look at kid again :)

any other engines? :)
Perhaps Breve might interest you:

http://breve.twisty-industries.com

Regards,
Cliff

Jan 13 '07 #4

P: n/a
<html>
<head>
<title>$title</title>
</head>
<body>
#if user
hello $user/name
#else
hello guest
#endif
</body>
</html>
This example code would work in cheetah with only 2 changes...

www.cheetahtemplate.org

Pete

Jan 14 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.