Skip to content

Commit f416c41

Browse files
author
Derek Worthen
committed
Added support for Plates
1 parent a09a078 commit f416c41

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lib/consolidate.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,3 +654,24 @@ exports.toffee.render = function(str, options, fn) {
654654
fn(err);
655655
}
656656
}
657+
658+
/**
659+
* Plates Support.
660+
*/
661+
662+
exports.plates = fromStringRenderer('plates');
663+
664+
/**
665+
* Plates string support.
666+
*/
667+
668+
exports.plates.render = function(str, options, fn) {
669+
var engine = requires.plates || (requires.plates = require('plates'))
670+
, map = options.map || undefined;
671+
try {
672+
var tmpl = cache(options) || cache(options, engine.bind(str, options, map));
673+
fn(null, tmpl);
674+
} catch (err) {
675+
fn(err);
676+
}
677+
}

test/fixtures/plates/user.plates

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div id="user"><p id="name"></p></div>

0 commit comments

Comments
 (0)