glemplate/html

Utilities for rendering HTML templates.

Functions

pub fn encode(text: String) -> StringBuilder

Encode content as HTML entities so it’s safe in an HTML template.

Note! This is not safe for use in <script> or <style> tags!

pub fn render(
  template: Template,
  assigns: Dict(String, AssignData),
  template_cache: Dict(String, Template),
) -> Result(StringBuilder, RenderError)

Render an HTML template.

Search Document