Edgewall Software

source: trunk/examples/bench/genshi_text/template.txt

Last change on this file was 706, checked in by cmlenz, 16 years ago

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.

  • Property svn:eol-style set to native
File size: 650 bytes
RevLine 
[706]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>
Note: See TracBrowser for help on using the repository browser.