summaryrefslogtreecommitdiffstats
path: root/lib/template.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-27 12:56:04 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-27 12:56:04 +0100
commit870ca4da0c9fa750acba609aff8d129d5a753466 (patch)
tree9d19a3081cef42ce2d734ca1ebb8a653b5f08d8e /lib/template.js
parent54e1be1e775945b0f7e397c36a1ff1413c63f475 (diff)
downloadgitbook-870ca4da0c9fa750acba609aff8d129d5a753466.zip
gitbook-870ca4da0c9fa750acba609aff8d129d5a753466.tar.gz
gitbook-870ca4da0c9fa750acba609aff8d129d5a753466.tar.bz2
Extend templates filters
Fully remove mathjax from plugins
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, {