Liquex.Parser.Object (liquex v0.10.2) View Source
Helper methods for parsing object tags and arguments used by objects
Link to this section Summary
Functions
Parse arguments. Arguments are key/value pairs, but a key may have multiple values separated by commas.
Parses closing object tag with white space removing.
Parses filter that starts with a pipe
Parse keyword field
Parses object. May contain arguments, literals, and filters.
Link to this section Functions
Specs
arguments(NimbleParsec.t()) :: NimbleParsec.t()
Parse arguments. Arguments are key/value pairs, but a key may have multiple values separated by commas.
Examples
* "img_url: '400x400', crop: 'bottom', filter: 'blur'"
* "img_size: 800, 600"
Specs
close_object_remove_whitespace(NimbleParsec.t()) :: NimbleParsec.t()
Parses closing object tag with white space removing.
Examples
* "-}} "
Specs
filter(NimbleParsec.t()) :: NimbleParsec.t()
Parses filter that starts with a pipe
Examples
* "| sort"
* "| at_most: 5"
Parse keyword field
Examples
* "key: value"
Specs
keyword_fields(NimbleParsec.t()) :: NimbleParsec.t()
Specs
object(NimbleParsec.t()) :: NimbleParsec.t()
Parses object. May contain arguments, literals, and filters.
It special cases space removing tags such as {{-
and -}}
to properly
remove any spaces leading and trailing spaces if requested.
Examples
* "{{ 'hello world' }}"
* "{{ 5 + 5 }}"
* "{{ variable_a | at_most: 5 }}"
* "{{- my_array | sort -}}"