summaryrefslogtreecommitdiffstats
path: root/lib/template.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/template.js')
-rw-r--r--lib/template.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/template.js b/lib/template.js
index d04deee..32c46de 100644
--- a/lib/template.js
+++ b/lib/template.js
@@ -66,6 +66,14 @@ var TemplateEngine = function(book) {
);
};
+// Add filters
+TemplateEngine.prototype.addFilters = function(filters) {
+ _.each(filters, function(func, key) {
+ this.book.log.debug.ln("add filter '"+key+"'");
+ this.env.addFilter(key, func);
+ }, this);
+};
+
// Render a string from the book
TemplateEngine.prototype.renderString = function(content, context, options) {
var context = _.extend({}, context, {