elf-notes/content/docs/zola/filters.json

205 lines
5.7 KiB
JSON

{
"definitions": [
{
"dd": "Converts string to lowercase",
"dt": "lower"
},
{
"dd": "Converts string to uppercase",
"dt": "upper"
},
{
"dd": "Counts the words in a string",
"dt": "wordcount"
},
{
"dd": "Capitalizes the first letter, lowercase the rest",
"dt": "capitalize"
},
{
"dd": "Takes two strings as arguments, replaces the first with the second",
"dt": "replace"
},
{
"dd": "Escapes quoted strings",
"dt": "addslashes"
},
{
"dd": "Provides a slug for the string",
"dt": "slugify"
},
{
"dd": "Capitalizes each word in the string",
"dt": "title"
},
{
"dd": "Removes leading and trailing whitespace",
"dt": "trim"
},
{
"dd": "Removes leading whitespace",
"dt": "trim_start"
},
{
"dd": "Removes trailing whitespace",
"dt": "trim_end"
},
{
"dd": "Removes leading characters that match a pattern",
"dt": "trim_start_matches"
},
{
"dd": "Removes trailing characters that match a pattern",
"dt": "trim_end_matches"
},
{
"dd": "Truncates the string to the length specified",
"dt": "truncate"
},
{
"dd": "Replaces line breaks (\\n or \\r\\n) with HTML line breaks (<br>)",
"dt": "linebreaksbr"
},
{
"dd": "Remove space ( ) and line breaks (\\n or \\r\\n) between HTML tags",
"dt": "spaceless"
},
{
"dd": "Tries to remove HTML tags from input",
"dt": "striptags"
},
{
"dd": "Returns the first element of an array",
"dt": "first"
},
{
"dd": "Returns the last element of an array",
"dt": "last"
},
{
"dd": "Returns the nth element of an array",
"dt": "nth"
},
{
"dd": "Joins an array with a delimeter",
"dt": "join"
},
{
"dd": "Returns the length of an array, an object, or a string",
"dt": "length"
},
{
"dd": "Returns a reversed string or array",
"dt": "reverse"
},
{
"dd": "Sorts an array into ascending order. You can sort objects by providing a fieldname argument",
"dt": "sort"
},
{
"dd": "Removes duplicate items from an array. You can filter objects by providing a fieldname argument",
"dt": "unique"
},
{
"dd": "Slices an array by the given start and end parameter",
"dt": "slice"
},
{
"dd": "Groups an array using the required attribute argument",
"dt": "group_by"
},
{
"dd": "Filters the array values, returning objects whose attribute is equal to the argument",
"dt": "filter"
},
{
"dd": "Retrieves an attribute from each object in an array",
"dt": "map"
},
{
"dd": "Appends values to an array",
"dt": "concat"
},
{
"dd": "Performs classic (%-based) URL encoding",
"dt": "urlencode"
},
{
"dd": "Encodes URLs, including any slashes",
"dt": "urlencode_strict"
},
{
"dd": "Can return an alternative text if the argument is greater than one",
"dt": "pluralize"
},
{
"dd": "Returns a number rounded",
"dt": "round"
},
{
"dd": "Generates human-readable sizes for integers",
"dt": "filesizeformat"
},
{
"dd": "Parses a timestamp into a date(time) string",
"dt": "date"
},
{
"dd": "Escapes a string's HTML",
"dt": "escape"
},
{
"dd": "Escapes XML special characters",
"dt": "escape_xml"
},
{
"dd": "Marks a variable as safe: HTML will not be escaped",
"dt": "safe"
},
{
"dd": "Accesses a value from an object when the key is not a valid identifier.",
"dt": "get"
},
{
"dd": "Splits a string into an array of strings, separated by a pattern.",
"dt": "split"
},
{
"dd": "Converts a value into an integer.",
"dt": "int"
},
{
"dd": "Converts a value into a float.",
"dt": "float"
},
{
"dd": "Transforms a value into its JSON representation",
"dt": "json_encode"
},
{
"dd": "Returns a string representation of the value.",
"dt": "as_str"
},
{
"dd": "Provides a default value if the name is not present in the context",
"dt": "default"
},
{
"dd": "Converts the variable contents from markdown to HTML",
"dt": "markdown"
},
{
"dd": "Encode the variable to base64",
"dt": "base64_encode"
},
{
"dd": "Decode the variable from base64",
"dt": "base64_decode"
},
{
"dd": "Format a number in a variety of ways",
"dt": "num_format"
}
]
}