gleam/bbmustache

Types

pub external type Argument
pub type CompileError {
  FileNotFound
  IncorrectSection(String)
  InvalidDelimiters
  UnclosedSection(String)
  UnclosedTag
  UnsupportedTag(String)
}

Constructors

  • FileNotFound
  • IncorrectSection(String)
  • InvalidDelimiters
  • UnclosedSection(String)
  • UnclosedTag
  • UnsupportedTag(String)
pub external type Template

Functions

pub external fn builder(of: StringBuilder) -> Argument
pub fn compile(tmpl: String) -> Result(Template, CompileError)
pub fn compile_file(path: String) -> Result(
  Template,
  CompileError,
)
pub external fn int(of: Int) -> Argument
pub external fn list(of: List(Argument)) -> Argument
pub external fn object(of: List(#(String, Argument))) -> Argument
pub fn render(template: Template, injecting args: List(
    #(String, Argument),
  )) -> String
pub external fn string(of: String) -> Argument