Closed nimbupani closed 12 years ago
This is my 2nd favorite feature of dust http://akdubya.github.com/dustjs/ The 1st being template inheritance, I'm not sure how much handlebars wants to diverge from mustache, but filters and inheritance are awesome. Nothing has happened on dust since June and there are some good pull requests just sitting there. It seems handlebars has more momentum and activity, it would be nice to see these features adopted.
I don't think this is a feature we're likely to add to Handlebars. If you'd like to chain multiple filters, I'd suggest implementing a filter helper that takes a property and array of filter names.
I made a few of these if it helps, I only needed a few but you can easily extend it.
@wagenet what's the reasoning behind not wanting to add filters? I instantly fell in love with it when trying angular.
@icholy Handlebars attempts to keep things relatively simple. Adding filters would significantly increase complexity. You can register your own custom helpers instead.
So, does HB work like Middleman's partial includes (not necessarily the same goal as templating)?
Answered my own question. http://blog.teamtreehouse.com/handlebars-js-part-2-partials-and-helpers
Actually, that's not necessarily what I'm looking for. Something more like includes, http://jlongster.github.io/nunjucks/templating.html#include
I have been using Liquid with Jekyll and have found it very trivial to do standard filters for some of the data.
I have also been using handlebars quite a bit for my node projects, but find that I need to write helpers all the time for any tiny manipulation or having more logic than an if statement.
I wonder if something like this would be useful in Handlebars? I don't think all the functionality of liquid is useful but chainable filters sound like something that would make me write less helper functions.