summaryrefslogtreecommitdiff
path: root/app/node_modules/oktemplate/index.js
diff options
context:
space:
mode:
authorSean Fridman <fridman@mail.sfsu.edu>2015-04-06 14:42:06 -0400
committerSean Fridman <fridman@mail.sfsu.edu>2015-04-06 15:27:54 -0400
commit0c02fc37ce4228507bfb2f0829aea0f1d5465c76 (patch)
tree8ffd47a8d00b3796a48be496bd374bd02266d4e4 /app/node_modules/oktemplate/index.js
parent37d5adf48c9c1b3ee326b631828732927797ca4f (diff)
Add Liquid filter to print objects
Diffstat (limited to 'app/node_modules/oktemplate/index.js')
-rw-r--r--app/node_modules/oktemplate/index.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/node_modules/oktemplate/index.js b/app/node_modules/oktemplate/index.js
index 502d2cf..75d7e6f 100644
--- a/app/node_modules/oktemplate/index.js
+++ b/app/node_modules/oktemplate/index.js
@@ -1,10 +1,26 @@
var fs = require('fs');
var path = require('path');
var glob = require('glob');
+var stringify = require('json-to-html');
var LiquidEngine = require('liquid-node').Engine;
var liquid = new LiquidEngine();
/**
+ * Add any custom liquid filters here.
+ */
+liquid.registerFilters({
+
+ /**
+ * Return a string formatted version of a JSON object.
+ * Useful for quick debugging of template data.
+ */
+ stringify: function(obj) {
+ return '<pre>' + stringify(obj) + '</pre>';
+ }
+
+});
+
+/**
* Manages templates. Only supports Mustache currently/
*/
function OKTemplateRepo(options) {