diff --git a/README.md b/README.md index e3280a6..85f4c27 100644 --- a/README.md +++ b/README.md @@ -174,59 +174,59 @@ A number of functions are provided out of the box by Jtwig. A few more are provi | Function | Description |----------|------------ | abs | `abs(number)`
Returns the absolute value of a number. -| batch | `batch(items, batch_size, filler_item)`
"Batches" items by returning a list of lists with the given number of items. If you provide a second parameter, it is used to fill missing items. +| batch | `batch(items, batch_size)`
`batch(items, batch_size, filler_item)`
"Batches" items by returning a list of lists with the given number of items. If you provide a second parameter, it is used to fill missing items. | blank_if_null | `blank_if_null(value)`
If the value given is null, returns a blank string instead of "null". -| butlast | `butlast(collection)`
Returns all items from a list except for the last one. -| capitalize | `capitalize(value)`
Capitalizes a value. The first character will be uppercase, all others lowercase. -| capitalize_all | `capitalize_all(value)`
Capitalizes all words (separate by whitespace) in a string. The first character in each word will be uppercase. -| center | `center(value, max_width)`
Pads a string with whitespace on the left and right as necessary to 'center' the given value. +| butlast | `butlast(collection)`
`butlast(string)`
`butlast(values, ...)`
Returns all items except for the last one from a collection, series of values, or a string. If a string is passed, it will be treated as a collection of chars. +| capitalize | `capitalize(string)`
Capitalizes a value. The first character will be uppercase, all others lowercase. +| capitalize_all | `capitalize_all(string)`
Capitalizes all words (separate by whitespace) in a string. The first character in each word will be uppercase. +| center | `center(string, max_width)`
`center(string, max_width, padding_string)`
Pads a string with whitespace on the left and right as necessary to 'center' the given value. If the padding_string argument is provided, that string will be used to pad instead of whitespace. | concat | `concat(values, ...)`
Concatenates any number of values together as strings. | convert_encoding | `convert_encoding(string, output_charset, input_charset)`
Converts a string from one encoding to another. The first argument is the expected output charset and the second one is the input charset. -| date_format | `date_format(date, format, timezone)`
Formats a date to a given format. The format specifier is the same as supported by `SimpleDateFormat`. -| date_modify | `date_modify(date, modifier)`
Modifies a date with a given modifier string. Can be 'seconds', 'minutes', 'hours', 'days', 'months' or 'years'. +| date_format | `date_format(date)`
`date_format(date, format)`
Formats a date to a given format. The format specifier is the same as supported by `SimpleDateFormat`. If the format argument is not specified, the format used will be `yyyy-MM-dd HH:mm:ss`. The date argument should be an instance of `java.util.Date`. +| date_modify | `date_modify(date, modifier)`
Modifies a date with a given modifier string. The modifier string can be things like "+1 day" or "+30 minutes". Recognized modifiers are 'seconds', 'minutes', 'hours', 'days', 'months' or 'years'. The date argument should be an instance of `java.util.Date`. A new instance of `java.util.Date` is returned. | default | `default(value, default_value)`
Returns the passed default value if the value is undefined or empty, otherwise the value of the variable. | dump | `dump(value)`
Uses `clojure.pprint/pprint` to dump the entire value of a variable to a string and returns that string. -| escape | `escape(value, strategy)`
Escapes a string for safe insertion into the final output. The second parameter specifies the escape strategy: 'html' (default), 'js' or 'xml'. -| first | `first(collection)`
Returns the first "element" of a sequence, or a string. -| format | `format(format_string, values, ...)`
Formats a given string by replacing the placeholders (placeholders follow the `String.format` notation). +| escape | `escape(string)`
`escape(string, strategy)`
Escapes a string for safe insertion into the final output. The optional strategy parameter specifies the escape strategy: 'html' (default), 'js' or 'xml'. +| first | `first(collection)`
`first(string)`
`first(values, ...)`
Returns the first "element" of a collection, series of values, or a string (in which case the first character is returned). +| format | `format(format_string, values, ...)`
Formats a given string by replacing the placeholders (placeholders follow the `String.format` notation). The values provided will be used in order for each placeholder in the string. | javascript | `javascript(url)`
Returns a `