Typsty.Template (Typsty v0.1.0)

Copy Markdown View Source

A Typst template with the assigns to render it with.

The ~TYPST sigil and the render/1 of a document module return this struct, as does a component's render/0 (see Typsty.Component). Pass a template to Typsty.to_pdf/3, Typsty.to_png/3 or Typsty.to_svg/3 to render it.

  • :source - the Typst source.
  • :assigns - the assigns to render it with, which the template reads from its assigns dictionary.
  • :file - the file it's in, which errors point at, or nil for a template built from a string (its errors point at lines of the string).

The other fields are internal: they record where the template starts in its file.

Summary

Types

t()

@type t() :: %Typsty.Template{
  assigns: map(),
  column: pos_integer() | nil,
  file: Path.t() | nil,
  indentation: non_neg_integer() | nil,
  line: pos_integer(),
  source: String.t()
}