snor v0.2.0 Snor

Snor is a fast and simple implementation of Mustache style templating for Elixir.

Snor also has support for executing functions.

Link to this section Summary

Functions

Render a given template to a string. The second parameter is the map that contains the data to use for interpolation. The third parameter is the module to use for looking up the helper functions.

Link to this section Functions

Link to this function

render(string, data \\ %{}, helpers \\ Snor.Helpers)

render(String.t(), map(), module()) :: String.t()

Render a given template to a string. The second parameter is the map that contains the data to use for interpolation. The third parameter is the module to use for looking up the helper functions.

Examples

iex> Snor.render("Hello {{name}}", %{name: "World"})
"Hello World"

iex> Snor.render("Hello")
"Hello"