Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding mote

  • Loading branch information...
commit 379c492e0c370cefb21f649b273787b71f5b0753 1 parent dbfdd2a
Julian Gautier jgautier authored
Showing with 24 additions and 2 deletions.
  1. +20 −0 lib/consolidate.js
  2. +2 −1  package.json
  3. +2 −1  test/consolidate.js
20 lib/consolidate.js
View
@@ -542,4 +542,24 @@ exports.ect.render = function(str, options, fn){
var ECT = require('ect');
var engine = new ECT({ root: { page: str }});
engine.render('page', options, fn);
+};
+
+/**
+ * Swig support.
+ */
+
+exports.mote = fromStringRenderer('mote');
+
+/**
+ * Swig string support.
+ */
+
+exports.mote.render = function(str, options, fn){
+ var engine = requires.mote || (requires.mote = require('mote'));
+ try {
+ var tmpl = cache(options) || cache(options, engine.compile(str));
+ fn(null, tmpl(options));
+ } catch (err) {
+ fn(err);
+ }
};
3  package.json
View
@@ -31,7 +31,8 @@
"mustache": "0.4.0",
"dot": "0.2.6",
"just": "0.1.8",
- "ect": "0.2.10"
+ "ect": "0.2.10",
+ "mote": "0.2.0"
},
"main": "index",
"scripts": {
3  test/consolidate.js
View
@@ -19,4 +19,5 @@ require('./shared').test('walrus');
require('./shared').test('mustache');
require('./shared').test('dot');
require('./shared').test('just');
-require('./shared').test('ect');
+require('./shared').test('ect');
+require('./shared').test('mote');
Please sign in to comment.
Something went wrong with that request. Please try again.