Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ View all feature comparisons and templates on the [Node Templates Page](http://p
## Implemented Libraries

(_Alphabetical Order_)

* [coffeekup@0.3.0](http://coffeekup.org/)
* [dust@0.3.0](http://akdubya.github.com/dustjs/)
* [ejs@0.4.2](https://github.com/visionmedia/ejs)
* [dust.js@0.1.0](https://github.com/stanislavfeldman/dust.js), until [dust](http://akdubya.github.com/dustjs/) supports node > 0.4
* [ejs@0.6.1](https://github.com/visionmedia/ejs)
* [haml@0.4.2](https://github.com/creationix/haml-js)
* [hamljs@0.5.1](https://github.com/visionmedia/haml.js)
* [jade@0.16.0](http://jade-lang.com/)
* [jqtpl@1.0.6](https://github.com/kof/node-jqtpl)
* [hamljs@0.5.2](https://github.com/visionmedia/haml.js)
* [jade@0.20.0](http://jade-lang.com/)
* [jqtpl@1.0.7](https://github.com/kof/node-jqtpl)
* [mu2@0.5.3](https://github.com/raycmorgan/Mu)
* [swig@0.5.0](https://github.com/paularmstrong/swig)
* [Templ8@0.2.1](https://github.com/constantology/Templ8)
* [swig@0.9.0](https://github.com/paularmstrong/swig)
* [Templ8@0.3.0](https://github.com/constantology/Templ8)
* [whiskers@0.1.2](https://github.com/gsf/whiskers.js)

## Running

Expand Down
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h2>Pages</h2>
<h2>Template Languages <span>(alphabetical)</span></h2>
<ul>
<li><a href="http://coffeekup.org/">CoffeeKup</a> - Markup as CoffeeScript.</li>
<li><a href="http://akdubya.github.com/dustjs/">dustjs</a> - templates that work in node.js or browser-side</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>
Expand All @@ -51,6 +52,7 @@ <h2>Feature Comparisons</h2>
<tr>
<th>(click to toggle)</th>
<th scope="col">CoffeeKup</th>
<th scope="col">dustjs</th>
<th scope="col">EJS</th>
<th scope="col">Haml-js</th>
<th scope="col">Haml.js</th>
Expand All @@ -67,6 +69,7 @@ <h2>Feature Comparisons</h2>
<th scope="row">Express Support</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="yes">✔</span></td>
Expand All @@ -79,6 +82,7 @@ <h2>Feature Comparisons</h2>
<tr>
<th scope="row">Browser 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>
Expand All @@ -101,11 +105,13 @@ <h2>Feature Comparisons</h2>
<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="yes">✔</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
<td><span class="no">✖</span></td>
Expand All @@ -119,6 +125,7 @@ <h2>Feature Comparisons</h2>
<th scope="row">Shorthand HTML Syntax</th>
<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="yes">✔</span></td>
Expand All @@ -134,6 +141,7 @@ <h2>Feature Comparisons</h2>
<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>
Expand All @@ -151,6 +159,7 @@ <h2>Feature Comparisons</h2>
<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>
Expand All @@ -166,6 +175,7 @@ <h2>Feature Comparisons</h2>
<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>
Expand All @@ -175,6 +185,7 @@ <h2>Feature Comparisons</h2>
<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>
Expand All @@ -185,6 +196,7 @@ <h2>Feature Comparisons</h2>
<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="yes">✔</span></td>
<td><span class="no">✖</span></td>
Expand All @@ -196,6 +208,7 @@ <h2>Feature Comparisons</h2>
<tr>
<th scope="row">Extendable Tags, Logic, and/or Filters</th>
<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>
Expand All @@ -218,6 +231,7 @@ <h2>Feature Comparisons</h2>
<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>
Expand Down
26 changes: 26 additions & 0 deletions lib/languages/dustjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var dust = require('dust.js'),
fs = require('fs'),
data = {
header: 'Colors',
items: [
{name: 'red', current: true, url: '#Red'},
{name: 'green', current: false, url: '#Green'},
{name: 'blue', current: false, url: '#Blue'}
]
},
files = {
simple: fs.readFileSync(__dirname + '/../templates/dustjs/simple.html', 'utf8')
},
tpl = {};

exports.compile = function (type, callback) {
if (!tpl[type]) {
tpl[type] = dust.compile(files[type], type);
dust.loadSource(tpl[type]);
}
callback();
};

exports.render = function (type, callback) {
dust.render(type, data, callback);
};
14 changes: 14 additions & 0 deletions lib/templates/dustjs/simple.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<h1>{header}</h1>
{#items}
<ul>
{#item}
{^current}
<li><strong>{name}</strong></li>
{:else}
<li><a href="{url}">{name}</a></li>
{/current}
{/item}
</ul>
{:else}
<p>The list is empty.</p>
{/items}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"repository": "https://github.com/paularmstrong/node-templates.git",
"homepage": "http://paularmstrong.github.com/node-templates/",
"author": "Paul Armstrong <paul@paularmstrongdesigns.com>",
"contributors" : ["Scott Sanders <scott@stonecobra.com>"],
"dependencies": {
"nopt": ">=1.0.8",
"bench": ">=0.3.2",
Expand All @@ -18,9 +19,12 @@
"jade": "0.16.0",
"jqtpl": "1.0.6",
"mu2": "0.5.3",
"swig": "0.7.0",
"Templ8": "0.2.1",
"whiskers": "0.1.0"
"swig": "0.9.0",
"Templ8": "0.3.0",
"whiskers": "0.1.2",
"dust.js": "0.1.0",
"abbrev": "1.0.3",
"coffee-script": "1.2.0"
},
"main": "index",
"engines": {
Expand Down