diff --git a/.gitignore b/.gitignore
index 3c3629e..5f9e8b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,5 @@
-node_modules
+/node_modules
+*.iml
+*.ipr
+*.iws
+/.idea
\ No newline at end of file
diff --git a/dot/index.html b/dot/index.html
new file mode 100644
index 0000000..d15c7b9
--- /dev/null
+++ b/dot/index.html
@@ -0,0 +1,14 @@
+{{##def.content:
+ {{ function todos_macro(items) { }}
+
+ {{~items: item:index }}
+ {{#def['item_partial'] || (def['item_partial'] = def.loadFile('/item_partial.def'))}}
+ {{~}}
+
+ {{ } }}
+
+
+ {{ todos_macro(it.todos); }}
+
+#}}
+{{#def['layout'] || (def['layout'] = def.loadFile('/layout.def'))}}
\ No newline at end of file
diff --git a/dot/item_partial.def b/dot/item_partial.def
new file mode 100644
index 0000000..b04f188
--- /dev/null
+++ b/dot/item_partial.def
@@ -0,0 +1,6 @@
+
+
+
diff --git a/dot/layout.def b/dot/layout.def
new file mode 100644
index 0000000..84c6209
--- /dev/null
+++ b/dot/layout.def
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ doT Template Example
+
+ {{#def.content }}
+
+ back
+
+
diff --git a/index.js b/index.js
index 51b585b..157bb71 100644
--- a/index.js
+++ b/index.js
@@ -6,6 +6,7 @@ var mustache = require('mustache');
var dust = require('dustjs-linkedin');
var ejs = require('ejs');
var nunjucks = require('nunjucks');
+var dot = require('dot');
var app = express();
@@ -79,5 +80,24 @@ app.get('/ejs', function(req, res) {
res.send(ejs.render(template, options));
});
+
+
+app.get('/dot', function(req, res) {
+ var template = fs.readFileSync('./dot/index.html', 'utf8');
+
+ var dot_render = dot.template(template,undefined,
+ {
+ loadFile : function(path) {
+ return fs.readFileSync(__dirname +"/dot"+ path);
+ }
+ });
+
+ var options = {
+ filename: './dot/index.html',
+ todos: todos
+ };
+ res.send(dot_render(options));
+});
+
app.listen(3000);
console.log('Example is listening on http://127.0.0.1:3000');
diff --git a/nunjucks/index.html b/nunjucks/index.html
index 289f476..635018f 100644
--- a/nunjucks/index.html
+++ b/nunjucks/index.html
@@ -1,9 +1,9 @@
-{% extends "./nunjucks/layout.html" %}
+{% extends "./layout.html" %}
{% macro todos_macro(items) %}
{% for item in items %}
- {% include "./nunjucks/item_partial.html" %}
+ {% include "./item_partial.html" %}
{% endfor %}
{% endmacro %}
diff --git a/public/index.html b/public/index.html
index 7d14f96..42050be 100644
--- a/public/index.html
+++ b/public/index.html
@@ -11,6 +11,7 @@ Template Examples
Dust.js
Nunjucks
EJS
+ doT