summaryrefslogtreecommitdiffstats
path: root/emacs.d/nxhtml/tests/in/genshi.ghtml
blob: bf0848db3446fd9f3c3af8d195a84e8fe4220bc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?python
  title = "A Genshi Template"
  fruits = ["apple", "orange", "kiwi"]
?>
<html xmlns:py="http://genshi.edgewall.org/">
  <head>
    <title py:content="title">This is replaced.</title>
  </head>
  <body>
    <p>These are some of my favorite fruits:</p>
    <ul>
      <li py:for="fruit in fruits">
        I like ${fruit}s
      </li>
    </ul>
{% python
    from genshi.builder import tag
    def greeting(name):
        return 'Hello, %s!' % name
%}
${greeting('world')}
  </body>
</html>