This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
index.html
278 lines (263 loc) · 13.5 KB
/
index.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Node Templates</title>
<link rel="stylesheet" href="styles.css" type="text/css" media="all">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
</head>
<body>
<header>
<h1>Node Templates</h1>
<a id="github" href="https://github.com/paularmstrong/node-templates"><span>Fork me on GitHub!</span> <span>Feel awesome!</span></a>
<p>There are a lot of template languages available for Node.js. But how do you pick the right one?</p>
<p>This page aims to help you choose the template language that's best for you and your project.</p>
<nav>
<h2>Pages</h2>
<ul>
<li><a href="index.html">Feature Comparison</a></li>
<li><a href="benchmarks.html">Benchmarks</a></li>
<li><a href="contributing.html">Contributing</a></li>
</ul>
</nav>
<h2>Template Languages <span>(alphabetical)</span></h2>
<ul>
<li><a href="http://coffeekup.org/">CoffeeKup</a> - Markup as CoffeeScript.</li>
<li><a href="https://github.com/visionmedia/ejs">EJS</a> - Embedded JavaScript templates</li>
<li><a href="https://github.com/creationix/haml-js">Haml-js</a> - Haml ported to server-side Javascript. This is a traditional server-side templating language.</li>
<li><a href="https://github.com/visionmedia/haml.js">Haml.js</a> - Faster / Express compliant Haml implementation</li>
<li><a href="http://jade-lang.com/">Jade</a> - Robust, elegant, feature rich template engine for Node.js.</li>
<li><a href="https://github.com/kof/node-jqtpl">JQTpl</a> - Port of jQuery's Template Engine to Node.js.</li>
<li><a href="https://github.com/raycmorgan/Mu">Mu2</a> - A Mustache template engine for Node.js.</li>
<li><a href="https://github.com/paularmstrong/swig">Swig</a> - Swig is a template engine inspired by the Django syntax.</li>
<li><a href="https://github.com/constantology/Templ8">Templ8</a> - JavaScript client/server template engine.</li>
<li><a href="https://github.com/gsf/whiskers.js">Whiskers</a> - A mustachioed templating library.</li>
</ul>
</header>
<section>
<h2>Feature Comparisons</h2>
<table id="features">
<thead>
<tr>
<th>(click to toggle)</th>
<th scope="col">CoffeeKup</th>
<th scope="col">EJS</th>
<th scope="col">Haml-js</th>
<th scope="col">Haml.js</th>
<th scope="col">Jade</th>
<th scope="col">JQTpl</th>
<th scope="col">Mu2</th>
<th scope="col">Swig</th>
<th scope="col">Templ8</th>
<th scope="col">Whiskers</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Express Support</th>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
</tr>
<tr>
<th scope="row">Browser Support</th>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><a class="partial" href="#jqtpl-browser">✜</a></td>
<td><a class="partial" href="#mu-browser">✜</a></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
</tr>
<tr>
<th scope="row">Available via npm</th>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
</tr>
<tr>
<th scope="row">Variable Filters</th>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
</tr>
<tr>
<th scope="row">Shorthand HTML Syntax</th>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
</tr>
<li>
<th scope="row">Extends / Block Template Inheritance</th>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
</li>
<tr>
<th scope="row">Escapes Output</th>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
</tr>
<tr>
<th scope="row">Iteration</th>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
</tr>
<tr>
<th scope="row"><code>if/else</code> Conditionals</th>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><a class="partial" href="#mu-ifelse">✜</a></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
</tr>
<tr>
<th scope="row"><code>else if</code> Conditionals</th>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
</tr>
<tr>
<th scope="row">Extendable Tags, Logic, and/or Filters</th>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="no">✖</span></td>
</tr>
<tr>
<th scope="row">Partials / Includes<sup><a class="partial" href="#partials">✜</a></sup></th>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
<td><span class="yes">✔</span></td>
</tr>
</tbody>
<tfoot>
<tr>
<th colspan="11">Footnotes</th>
</tr>
<tr id="jqtpl-browser">
<th><span class="partial">✜ JQTpl Browser Support</span></th>
<td colspan="10">JQTpl can be supported in the browser via the <a href="https://github.com/jquery/jquery-tmpl">jQuery Templates plugin</a></td>
</tr>
<tr id="mu-browser">
<th><span class="partial">✜ Mu Browser Support</span></th>
<td colspan="10">Mu2/Mustache can be supported in the browser via <a href="https://github.com/janl/mustache.js">mustache.js</a>.</td>
</tr>
<tr id="mu-ifelse">
<th><span class="partial">✜ Mu <code>if / else</code></span></th>
<td colspan="10">Mu2/Mustache only supports <code>if</code> logic.</td>
</tr>
<tr id="partials">
<th><span class="partial">✜ Partials</span></th>
<td colspan="10">Language has some way to include and render sub-templates from within the main template.</td>
</tr>
</tfoot>
</table>
</section>
<footer>
<p>Found an error? Want to add another Template Engine? <a href="contributing.html">Find out how...</a></p>
<p>Created for the Node.js community by <a href="http://paularmstrongdesigns.com">Paul Armstrong</a>.</p>
</footer>
<script>
$(document).ready(function () {
$('table#features tbody tr th:first-child').bind('click', function () {
var remove = [],
i = 0,
els = null,
row = $(this).parent('tr').toggleClass('selected').parent('tbody').find('.selected').each(function () {
$(this).find('td').each(function (i) {
if ($(this).has('span.no').length) {
remove.push(i + 2);
}
});
});
$('table#features thead th, table#features tbody td').removeClass('nonmatch');
i = remove.length;
while (i) {
i -= 1;
els = $('table#features thead th:nth-child(' + remove[i] + '), table#features tbody td:nth-child(' + remove[i] + ')').addClass('nonmatch');
}
});
});
</script>
</body>
</html>