Permalink
Browse files

add atpl support

  • Loading branch information...
1 parent ddaa07c commit adbf1c8370d154538780ac2eeddcb2d70795dd55 simov committed with Dec 28, 2012
Showing with 25 additions and 1 deletion.
  1. +1 −0 Readme.md
  2. +20 −0 lib/consolidate.js
  3. +2 −1 package.json
  4. +1 −0 test/consolidate.js
  5. +1 −0 test/fixtures/atpl/user.atpl
View
@@ -8,6 +8,7 @@
## Supported template engines
+ - [atpl](https://github.com/soywiz/atpl.js)
- [dust](https://github.com/akdubya/dustjs) [(website)](http://akdubya.github.com/dustjs/)
- [eco](https://github.com/sstephenson/eco)
- [ect](https://github.com/baryshev/ect) [(website)](http://ectjs.com/)
View
@@ -230,6 +230,26 @@ exports.swig.render = function(str, options, fn){
};
/**
+ * Atpl support.
+ */
+
+exports.atpl = fromStringRenderer('atpl');
+
+/**
+ * Atpl string support.
+ */
+
+exports.atpl.render = function(str, options, fn){
+ var engine = requires.atpl || (requires.atpl = require('atpl'));
+ try {
+ var tmpl = cache(options) || cache(options, engine.compile(str, options));
+ fn(null, tmpl(options));
+ } catch (err) {
+ fn(err);
+ }
+};
+
+/**
* Liquor support,
*/
View
@@ -32,7 +32,8 @@
"just": "0.1.8",
"ect": "0.2.10",
"mote": "0.2.0",
- "toffee": "0.0.52"
+ "toffee": "0.0.52",
+ "atpl": ">=0.5.5"
},
"main": "index",
"scripts": {
View
@@ -24,3 +24,4 @@ require('./shared').test('just');
require('./shared').test('ect');
require('./shared').test('mote');
require('./shared').test('toffee');
+require('./shared').test('atpl');
@@ -0,0 +1 @@
+<p>{{user.name}}</p>

0 comments on commit adbf1c8

Please sign in to comment.