Skip to content

Commit

Permalink
Merge pull request #61 from baryshev/master
Browse files Browse the repository at this point in the history
Add support for ECT
  • Loading branch information
tj committed Sep 16, 2012
2 parents da37cd0 + bec6156 commit 7f7674f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions Readme.md
Expand Up @@ -10,6 +10,7 @@

- [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/)
- [ejs](https://github.com/visionmedia/ejs)
- [haml](https://github.com/visionmedia/haml.js) [(website)](http://haml-lang.com/)
- [haml-coffee](https://github.com/9elements/haml-coffee) [(website)](http://haml-lang.com/)
Expand Down
24 changes: 24 additions & 0 deletions lib/consolidate.js
Expand Up @@ -504,4 +504,28 @@ exports.just.render = function(str, options, fn){
var JUST = require('just');
var engine = new JUST({ root: { page: str }});
engine.render('page', options, fn);
};

/**
* ECT support.
*/

exports.ect = function(path, options, fn){
var engine = requires.ect;
if (!engine) {
var ECT = require('ect');
engine = requires.ect = new ECT();
}
engine.configure({ cache: options.cache });
engine.render(path, options, fn);
};

/**
* ECT string support.
*/

exports.ect.render = function(str, options, fn){
var ECT = require('ect');
var engine = new ECT({ root: { page: str }});
engine.render('page', options, fn);
};
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -30,7 +30,8 @@
"walrus": "0.9.0",
"mustache": "0.4.0",
"dot": "0.2.6",
"just": "0.1.8"
"just": "0.1.8",
"ect": "0.2.8"
},
"main": "index",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion test/consolidate.js
Expand Up @@ -17,4 +17,5 @@ require('./shared').test('qejs');
require('./shared').test('walrus');
require('./shared').test('mustache');
require('./shared').test('dot');
require('./shared').test('just');
require('./shared').test('just');
require('./shared').test('ect');
1 change: 1 addition & 0 deletions test/fixtures/ect/user.ect
@@ -0,0 +1 @@
<p><%= @user.name %></p>

0 comments on commit 7f7674f

Please sign in to comment.