Skip to content

Commit

Permalink
Add support for Slm
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Jung authored and Ruben Bridgewater committed Jan 24, 2016
1 parent 73c4d86 commit c459107
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- [QEJS](https://github.com/jepso/QEJS)
- [ractive](https://github.com/Rich-Harris/Ractive)
- [react](https://github.com/facebook/react)
- [slm](https://github.com/slm-lang/slm)
- [swig](https://github.com/paularmstrong/swig) [(website)](http://paularmstrong.github.com/swig/)
- [templayed](http://archan937.github.com/templayed.js/)
- [twig](https://github.com/justjohn/twig.js)
Expand Down
22 changes: 22 additions & 0 deletions lib/consolidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,28 @@ exports.vash.render = function(str, options, fn) {
});
};

/**
* Slm support.
*/

exports.slm = fromStringRenderer('slm');

/**
* Slm string support.
*/

exports.slm.render = function(str, options, fn) {
return promisify(fn, function (fn) {
var engine = requires.slm || (requires.slm = require('slm'));

try {
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};

/**
* expose the instance of the engine
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"react": "^0.14.6",
"react-tools": "^0.13.0",
"should": "*",
"slm": "^0.5.0",
"swig": "^1.4.1",
"templayed": ">=0.2.3",
"twig": "^0.8.2",
Expand Down
1 change: 1 addition & 0 deletions test/consolidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ require('./shared').test('htmling');
require('./shared/react').test('react');
require('./shared').test('vash');
require('./shared/helpers').test('vash');
require('./shared').test('slm');
1 change: 1 addition & 0 deletions test/fixtures/slm/user.slm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
p = this.user.name

0 comments on commit c459107

Please sign in to comment.