Mau.Renderer (mau v0.8.0)
View SourceRenderer for the Mau template engine.
Handles rendering of AST nodes into output strings. For Group 1, only handles text node rendering.
Summary
Functions
Renders a template AST with the given context.
Handles both single nodes and lists of nodes.
Renders an AST node to a string.
Handles text nodes and expression nodes with literal evaluation.
Examples
iex> Mau.Renderer.render_node({:text, ["Hello world"], []}, %{})
{:ok, "Hello world"}
iex> Mau.Renderer.render_node({:expression, [{:literal, ["hello"], []}], []}, %{})
{:ok, "hello"}
iex> Mau.Renderer.render_node({:expression, [{:literal, [42], []}], []}, %{})
{:ok, "42"}