Current section
Files
Jump to
Current section
Files
README.md
# Tuck 🧵
[](https://hex.pm/packages/tuck)
[](https://tuck.hexdocs.pm/)
[](https://github.com/peregrinefinch/tuck/actions/workflows/test.yml)
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](docs/guide.md).
## Licence
Licensed under the [Apache License, Version 2.0](LICENSE).