Mercurial > genshi > mirror
comparison examples/bench/genshi_text/template.txt @ 592:1da8de3e5e51 trunk
Add a new syntax for text templates, which is available alongside the old syntax for now. The new syntax is more poweful and flexible, using Django-style directive notation.
author | cmlenz |
---|---|
date | Mon, 13 Aug 2007 12:40:56 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
590:36b5a03534a0 | 592:1da8de3e5e51 |
---|---|
1 <!DOCTYPE html | |
2 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> | |
5 | |
6 <head> | |
7 <title>${escape(title)}</title> | |
8 </head> | |
9 | |
10 <body> | |
11 {% include header.txt %} | |
12 {% def greeting(name) %} | |
13 Hello, ${name}! | |
14 {% end %} | |
15 | |
16 <div>${greeting(user)}</div> | |
17 <div>${greeting("me")}</div> | |
18 <div>${greeting("world")}</div> | |
19 | |
20 <h2>Loop</h2> | |
21 {% if items %}<ul> | |
22 {% for idx, item in enumerate(items) %}\ | |
23 <li{% if idx + 1 == len(items) %} class="last"{% end %}>${escape(item)}</li> | |
24 {% end %} | |
25 </ul>{% end %} | |
26 | |
27 {% include footer.txt %} | |
28 </body> |