File: tutorial2.kid

package info (click to toggle)
kid 0.9.6-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 2,264 kB
  • ctags: 4,633
  • sloc: python: 7,417; makefile: 120; sh: 47; xml: 4
file content (23 lines) | stat: -rw-r--r-- 563 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?xml version="1.0" encoding="utf-8"?>
<?python 
# you can treat templates just like python modules
import kid ; kid.enable_import()
from tutorial import display_dict

lil_bears = { 'PHP' : 'Too soft',
              'XSLT' : 'Too hard',
              'Kid' : 'Just right!' }

?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://purl.org/kid/ns#">
  <head>
    <title>Let's use that template function</title>
  </head>
  <body>
    <h1>Here's a table of stuff</h1>

    ${display_dict('Template Language', 'Rating', lil_bears)}

  </body>
</html>