Typst.Format (Typst v0.1.4)

View Source

Contains helper functions for converting elixir datatypes into the format that Typst expects

Summary

Functions

Converts a series of columns mapped as a nested list to a format that can be plugged in an existing table.

Types

column_data()

@type column_data() :: String.t() | integer()

Functions

array(list)

@spec array(list()) :: String.t()

bold(el)

@spec bold(String.Chars.t()) :: String.t()

content(el)

@spec content(String.Chars.t()) :: String.t()

table_content(columns)

This function is deprecated. use %Typst.Format.Table{}.
@spec table_content([[column_data()]]) :: String.t()

Converts a series of columns mapped as a nested list to a format that can be plugged in an existing table.

Examples

iex> columns = [["John", 10, 20], ["Alice", 20, 30]]
iex> Typst.Format.table_content(columns)
~s/"John", "10", "20",\n  "Alice", "20", "30"/