liquid.filters.standard
liquid.filters.standard
Provides standard liquid filters
append
(
base
,suffix
)
— Append a suffix to a string</>attr
(
base
,prop
)
— Similar as__getattr__()
but also works like `getitem()</>ceil
(
base
)
— Get the ceil of a number</>compact
(
base
)
— Remove empties from a list</>default
(
base
,deft
,allow_false
)
— Return the deft value if base is not set.Otherwise, return base </>divided_by
(
base
,dvdby
)
— Implementation of / or //</>escape_once
(
base
)
— Escapse html characters only once of the string</>floor
(
base
)
— Get the floor of a number</>liquid_date
(
base
,fmt
)
— Format a date/datetime</>liquid_map
(
base
,prop
)
— Map a property to a list of objects</>liquid_slice
(
base
,start
,length
)
— Slice a list</>minus
(
base
,sep
)
— Implementation of -</>modulo
(
base
,sep
)
— Implementation of %</>newline_to_br
(
base
)
— Replace newline with<br />
</>plus
(
base
,sep
)
— Implementation of +</>prepend
(
base
,prefix
)
— Prepend a prefix to a string</>regex_replace
(
base
,regex
,replace
,case_sensitive
,count
)
(str) — Replace matching regex pattern</>remove
(
base
,string
)
— Remove a substring from a string</>remove_first
(
base
,string
)
— Remove the first substring from a string</>replace_first
(
base
,old
,new
)
— Replace the first substring with new string</>sort
(
base
)
— Get the sorted list</>sort_natural
(
base
)
— Get the sorted list in a case-insensitive manner</>split
(
base
,sep
)
— Split a string into a listIf the sep is empty, return the list of characters </>strip_html
(
base
)
— Strip html tags from a string</>strip_newlines
(
base
)
— Strip newlines from a string</>times
(
base
,sep
)
— Implementation of *</>truncate
(
base
,length
,ellipsis
)
— Truncate a string</>truncatewords
(
base
,length
,ellipsis
)
— Truncate a string by words</>uniq
(
base
)
— Get the unique elements from a list</>url_decode
(
base
)
— Url-decode a string</>url_encode
(
base
)
— Url-encode a string</>where
(
base
,prop
,value
)
— Query a list of objects with a given property value</>
liquid.filters.standard.
DateTime
(
dt
, fmt
)
__str__
(
)
→ str
How it is rendered
liquid.filters.standard.
EmptyDrop
(
)
The EmptyDrop class borrowed from liquid
liquid.filters.standard.
split
(
base
, sep
)
Split a string into a listIf the sep is empty, return the list of characters
liquid.filters.standard.
append
(
base
, suffix
)
Append a suffix to a string
liquid.filters.standard.
prepend
(
base
, prefix
)
Prepend a prefix to a string
liquid.filters.standard.
times
(
base
, sep
)
Implementation of *
liquid.filters.standard.
minus
(
base
, sep
)
Implementation of -
liquid.filters.standard.
plus
(
base
, sep
)
Implementation of +
liquid.filters.standard.
modulo
(
base
, sep
)
Implementation of %
liquid.filters.standard.
ceil
(
base
)
Get the ceil of a number
liquid.filters.standard.
floor
(
base
)
Get the floor of a number
liquid.filters.standard.
liquid_date
(
base
, fmt
)
Format a date/datetime
liquid.filters.standard.
default
(
base
, deft
, allow_false=False
)
Return the deft value if base is not set.Otherwise, return base
liquid.filters.standard.
divided_by
(
base
, dvdby
)
Implementation of / or //
liquid.filters.standard.
escape_once
(
base
)
Escapse html characters only once of the string
liquid.filters.standard.
newline_to_br
(
base
)
Replace newline with <br />
liquid.filters.standard.
remove
(
base
, string
)
Remove a substring from a string
liquid.filters.standard.
remove_first
(
base
, string
)
Remove the first substring from a string
liquid.filters.standard.
replace_first
(
base
, old
, new
)
Replace the first substring with new string
liquid.filters.standard.
sort
(
base
)
Get the sorted list
liquid.filters.standard.
sort_natural
(
base
)
Get the sorted list in a case-insensitive manner
liquid.filters.standard.
liquid_slice
(
base
, start
, length=1
)
Slice a list
liquid.filters.standard.
strip_html
(
base
)
Strip html tags from a string
liquid.filters.standard.
strip_newlines
(
base
)
Strip newlines from a string
liquid.filters.standard.
truncate
(
base
, length
, ellipsis='...'
)
Truncate a string
liquid.filters.standard.
truncatewords
(
base
, length
, ellipsis='...'
)
Truncate a string by words
liquid.filters.standard.
uniq
(
base
)
Get the unique elements from a list
liquid.filters.standard.
url_decode
(
base
)
Url-decode a string
liquid.filters.standard.
url_encode
(
base
)
Url-encode a string
liquid.filters.standard.
where
(
base
, prop
, value
)
Query a list of objects with a given property value
liquid.filters.standard.
liquid_map
(
base
, prop
)
Map a property to a list of objects
liquid.filters.standard.
attr
(
base
, prop
)
Similar as __getattr__()
but also works like `getitem()
liquid.filters.standard.
compact
(
base
)
Remove empties from a list
liquid.filters.standard.
regex_replace
(
base
, regex
, replace=''
, case_sensitive=False
, count=0
)
→ str
Replace matching regex pattern