template engine

P

piotr

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
 
J

Jorge Godoy

(...)
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/).
 
C

Cliff Wells

piotr said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,192
Latest member
KalaReid2

Latest Threads

Top