From f416c41bc635142a1a678303f72a1293ad71c3eb Mon Sep 17 00:00:00 2001 From: Derek Worthen Date: Wed, 23 Jan 2013 21:01:08 -0800 Subject: [PATCH] Added support for Plates --- lib/consolidate.js | 21 +++++++++++++++++++++ test/fixtures/plates/user.plates | 1 + 2 files changed, 22 insertions(+) create mode 100644 test/fixtures/plates/user.plates diff --git a/lib/consolidate.js b/lib/consolidate.js index 3f664ad..fe1019a 100644 --- a/lib/consolidate.js +++ b/lib/consolidate.js @@ -654,3 +654,24 @@ exports.toffee.render = function(str, options, fn) { fn(err); } } + +/** +* Plates Support. +*/ + +exports.plates = fromStringRenderer('plates'); + +/** +* Plates string support. +*/ + +exports.plates.render = function(str, options, fn) { + var engine = requires.plates || (requires.plates = require('plates')) + , map = options.map || undefined; + try { + var tmpl = cache(options) || cache(options, engine.bind(str, options, map)); + fn(null, tmpl); + } catch (err) { + fn(err); + } +} diff --git a/test/fixtures/plates/user.plates b/test/fixtures/plates/user.plates new file mode 100644 index 0000000..8e68b1f --- /dev/null +++ b/test/fixtures/plates/user.plates @@ -0,0 +1 @@ +