whoward / cadenza

parser and renderer library for liquid-like templates
13 stars 6 forks source link

Implement standard Liquid filters #16

Closed joefiorini closed 11 years ago

joefiorini commented 11 years ago

There are some collection filters in Liquid that do not come with Cadenza out of the box (eg. sort, map, etc.) Also, filters for limit, offset and reversed would add the functionality that comes with for loops in Liquid. Is there any reason you wouldn't want these in core? If so I'll keep them isolated in my own app.

whoward commented 11 years ago

absolutely! pass them along and i'm sure they'll make a good addition to cadenza's filter library

whoward commented 11 years ago

I popped a few filters on the latest commit: limit, offset and reversed

Not sure just yet how best to tackle sort and map but if you'd like to give some input I'd love to hear it. I'm hoping to do a 0.8 release of the gem pretty soon and these filters plus a Cadenza source renderer will be the rest of the feature set going into it I think.

whoward commented 11 years ago

I added implementations of map/collect/pluck and sort which should cover the filters you mentioned - feel free to open up a ticket with some more suggested filters to implement!