Skip to content

Data types

Peter Johnson edited this page Feb 8, 2023 · 22 revisions

Data Types

⚠️⚠️ THIS WIKI IS BEING USED TO JOT DOWN IDEAS AT PRESENT. DON'T ASSUME ANYTHING IS FIXED. ⚠️⚠️

All placeholders, variables, commands and filters return data of a specific type.

The supported types are given in the following table. Each type has a default string representation.

Types not yet implemented are marked with a ⛔ symbol.

Type Description Default string Truthiness
Text Plain text strings The text itself All non-empty text is truthy
Int 32 bit integer The integer as a base 10 string All non-zero integers are truthy.
Float Floating point number The floating point value rendered to full precision. Very large or small values may use scientific notation. All floats that do not test equal to zero are truthy
Boolean Boolean value: values are specified using commands @true and @false "1" for true and "0" for false @true is truthy!
DateTime Representation of a date and time The ISO standard date string Always truthy
File Represents a file in the file system Full path to the file Always truthy
Directory Represents a directory in the file system Full path to the directory Always truthy
URL Represents a URL Complete URL Always truthy
Array Array of values of a single type Concatenation, comma separated, of the default text values of the array elements, surrounded by square brackets Truthy iff at least one element is truthy.
OS Object describing the underlying operating system OS version Always truthy
Any Wraps any of the other data types. The default string of the wrapped data type. Truthy iff the wrapped data type is truthy
Null A null object. Has no value or attributes. Empty string. Always falsey

The pseudo type Number is used in the documentation. It is used to mean either an Int or a Float.

A placeholder itself has the type of the output of the last filter, or of the source if there are no filters. When a top level placeholder is rendered the data it returns is converted to text using the data type's default string representation.

Variables take the type of the value assigned to them.

The return type of @ commands varies according to the command. See the command reference for details.

The input and output types of filters depend on the filter. See the filter reference for details.

Various cast filters are provided for converting from some types to others.

Clone this wiki locally