@version 0.1.5
@date 2015-04-09
@stability 2 - Unstable
Liquid Filters –

Standard Filters for liquid-lite extending native prototypes.
Currently supported filters
- date - reformat a date syntax reference
Require date-format-lite
var item = { "timestamp": 1363770186, "datetime": "2013-03-20T09:03:06Z" }
- capitalize - capitalize words in the input sentence
- downcase - convert an input string to lowercase
- upcase - convert an input string to uppercase
- first - get the first element of the passed in array
- last - get the last element of the passed in array
- join - join elements of the array with certain character between them.
Native in javascript
- sort - sort elements of the array
Native in javascript
- size - return the size of an array or string
- replace - replace the first or each occurrence.
Native in javascript
barbar #=> 'barfoo'
barfbarobarobarfbarobarobar #=> 'barbar'
- remove - remove each occurrence e.g. barbar #=> ‘barbar’
- split - split a string on a matching pattern e.g. a~b #=> [‘a’,’b’].
Native in javascript
- pluck - map/collect an array on a given property
- truncate - truncate a string down to x characters
- truncatewords - truncate a string down to x words
- camelCase - camelCase notation
- humanTime - 13 #=> “13 seconds”, 78 #=> “1 minute”
- step - 71 #=> “70”, 12.31 #=> “12.4”
Todo
- escape - escape a string
- escape_once - returns an escaped version of html without affecting existing escaped entities
- strip_html - strip html from string
- prepend - prepend a string e.g. foobar #=> ‘foobar’
- append - append a string e.g. foobar #=> ‘foobar’
- minus - subtraction e.g. 2 #=> 2
- plus - addition e.g. 2 #=> ‘11’, 2 #=> 2
- times - multiplication e.g 20 #=> 20
- divided_by - division e.g. 5 #=> 5
- modulo - remainder, e.g. 1 #=> 1
External links
Licence
Copyright (c) 2012 Lauri Rooden <lauri@rooden.ee>
The MIT License
Have an update or suggestion for this note?
You can edit it and send me a pull request.