Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #88 from jugoncalves/master

add templayed
  • Loading branch information...
commit b4f4eec35dc7b6b5818f25085b2fef686855e829 2 parents 5cfeff9 + e55f541
@tj authored
View
1  Readme.md
@@ -25,6 +25,7 @@
- [mustache](https://github.com/janl/mustache.js)
- [QEJS](https://github.com/jepso/QEJS)
- [swig](https://github.com/paularmstrong/swig) [(website)](http://paularmstrong.github.com/swig/)
+ - [templayed](http://archan937.github.com/templayed.js/)
- [toffee](https://github.com/malgorithms/toffee)
- [underscore](https://github.com/documentcloud/underscore) [(website)](http://documentcloud.github.com/underscore/)
- [walrus](https://github.com/jeremyruppel/walrus) [(website)](http://documentup.com/jeremyruppel/walrus/)
View
1  examples/express.js
@@ -1,4 +1,3 @@
-
// npm install express
var express = require('../../express')
View
1  index.js
@@ -1,2 +1 @@
-
module.exports = require('./lib/consolidate');
View
20 lib/consolidate.js
@@ -448,6 +448,26 @@ exports.hogan.render = function(str, options, fn){
};
/**
+ * templayed.js support.
+ */
+
+exports.templayed = fromStringRenderer('templayed');
+
+/**
+ * templayed.js string support.
+ */
+
+exports.templayed.render = function(str, options, fn){
+ var engine = requires.templayed || (requires.templayed = require('templayed'));
+ try {
+ var tmpl = cache(options) || cache(options, engine(str)(options));
+ fn(null, tmpl);
+ } catch (err) {
+ fn(err);
+ }
+};
+
+/**
* Handlebars support.
*/
View
3  package.json
@@ -33,7 +33,8 @@
"ect": "0.2.10",
"mote": "0.2.0",
"toffee": "0.0.52",
- "atpl": ">=0.5.5"
+ "atpl": ">=0.5.5",
+ "templayed": ">=0.2.3"
},
"main": "index",
"scripts": {
View
1  test/consolidate.js
@@ -25,3 +25,4 @@ require('./shared').test('ect');
require('./shared').test('mote');
require('./shared').test('toffee');
require('./shared').test('atpl');
+require('./shared').test('templayed');
View
1  test/fixtures/templayed/user.templayed
@@ -0,0 +1 @@
+<p>{{user.name}}</p>
Please sign in to comment.
Something went wrong with that request. Please try again.