Liquid template language parser engine in Swift.
Liquid is a template language that is used by several projects, such as Shopify and Jekyll (which powers GitHub pages). Liquid allows conditional injection of content into html pages through a simple and elegant syntax.
LiquidKit brings the power of Liquid to iOS and macOS. It is currently under development, so not all features are available.
This project is based on the liquid-swift project by yourtion, which provided a barebones implementation of the Lexer and the Parser. However, it was lacking any implementation of Tags, Filters, and everything else, which I have added. It has been renamed and re-hosted since I intend to maintain this project myself.
- Comment
- Raw
- Truthy and falsy
- Whitespace control
- Dot operator
dict.key[index] - Filters
- abs
- append
- at_least
- at_most
- capitalize
- ceil
- compact
- concat
- date
- default
- divided_by
- downcase
- escape
- escape_once
- first
- floor
- join
- last
- lstrip
- map
- minus
- modulo
- newline_to_br
- plus
- prepend
- remove
- remove_first
- replace
- replace_first
- reverse
- round
- rstrip
- size
- slice
- sort
- sort_natural
- split
- strip
- strip_html
- strip_newlines
- times
- truncate
- truncatewords
- uniq
- upcase
- url_decode
- url_encode
- Variable
assigncaptureincrementdecrement
- Operators
==equals!=does not equal>greater than<less than>=greater than or equal to<=less than or equal toorlogical orandlogical andcontainschecks substring inside a string
- Control flow
ifif a certain condition is trueunlessif a certain condition is not metelsifmore conditionselseelse conditionscase/whenswitch statement
- Iteration
forbreakcontinuelimitlimits the loop (for parameters)offsetbegins the loop at the specified index (for parameters)rangedefines a range of numbers to loop throughreversedreverses the order of the loop
cyclegroup
tablerowcolslimitlimits the loop (for parameters)offsetbegins the loop at the specified index (for parameters)rangedefines a range of numbers to loop through
- Default Filter