Package documentation

tuck

1.0.0

By Peregrine Finch

Tuck 🧵

Package Version Hex Docs Tests

Templates for HTML, email, and other text in Pooka.

Installation

sh
pooka add tuck

Usage

Pooka
module main

import pooka/json.{JObject, JString}
import tuck

main() {
  let assert Ok(page) = tuck.parse("Hello, {{ name }}!")
  let data = JObject([#("name", JString("Owl"))])
  echo tuck.render(page, data)
}

Parse once, then render with different data. Libraries add includes and template inheritance; HTML output escapes dynamic values by default. Conditions, loops, filters, registered host functions, local scopes, explicit partial arguments, super(), and resource-bounded APIs are covered in the guide.

Licence

Licensed under the Apache License, Version 2.0.