toml
Read structured data from a TOML file.
The file must contain a valid TOML table. TOML tables will be converted into Typst dictionaries, and TOML arrays will be converted into Typst arrays. Strings and booleans will be converted into the Typst equivalents and numbers will be converted to floats or integers depending on whether they are whole numbers. For the time being, datetimes will be converted to strings as Typst does not have a built-in datetime yet.
The TOML file in the example consists of a table with the keys title
,
version
, and authors
.
Example
#let details = toml("details.toml")
Title: #details.title \
Version: #details.version \
Authors: #(details.authors
.join(", ", last: " and "))

ParametersParameters are the inputs to a function. They are specified in parentheses after the function name.
Parameters are the inputs to a function. They are specified in parentheses after the function name.
path
Path to a TOML file.