-
Notifications
You must be signed in to change notification settings - Fork 0
/
mako.html
41 lines (40 loc) · 1.8 KB
/
mako.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<title>Mako</title>
<meta charset="UTF-8">
<link href="./css/stylesheet.css" rel="stylesheet">
</head>
<body>
<section>
<div>
<h1>Mako</h1>
<p>Mako is a non-XML syntax templating language that uses native Python. It is the default language in Pyramid and Pylons.</p>
</div>
<div>
<h2>Code Sample</h2>
<div class="code_sample">
<code>
<pre><span class="token"><%</span><span class="key_word">inherit</span> <span class="code">file="base.html"</span><span class="token">/></span>
<span class="token"><%</span>
rows = [[v <span class="key_word">for</span> v <span class="key_word">in range</span>(0,10)] <span class="key_word">for</span> row <span class="key_word">in range</span>(0,10)]
<span class="token">%></span>
<table>
<span class="token">%</span> <span class="key_word">for</span> row <span class="key_word">in</span> rows:
<span class="token">${</span>makerow(row)<span class="token">}</span>
<span class="token">%</span> <span class="key_word">endfor</span>
</table>
<span class="token"><%</span><span class="key_word">def</span> <span class="code">name="makerow(row)"</span><span class="token">></span>
<tr>
<span class="token">%</span> <span class="key_word">for</span> name <span class="key_word">in</span> row:
<td><span class="token">${</span>name<span class="token">}</span></td>\
<span class="token">%</span> <span class="key_word">endfor</span>
</tr>
<span class="token"></%</span><span class="key_word">def</span><span class="token">></span></pre>
</code>
</div>
</div>
</section>
<script data-main="js/main" src="js/require.js"></script>
</body>
</html>