News for hackers. Stuff that matters.
Re:Stop sending template engines to the browser. How to make... by dochtman on Friday September 14, 2012 @09:22AM (#4521466)
The compiler output looks roughly like this:

  var Jasinja = {
    "filters": {
      "attr": function(obj, name) { return obj[name]; }
    },
    "tests": {
      "lower": function(val) { return val.toLowerCase() == val; }
    },
    "templates": {
      "test": {
        "macros": {},
        "blocks": {},
        "render": function(ctx, tmpl) {
          return "a";
        }
      }
    }
  };
So you can easily add some filters by setting Jasinja.filters['myfilter'] to a function.

There are no comments on this comment yet.