View Source ExMustache (ex_mustache v0.2.0)

ExMustache is a fast mustache templating library for Elixir.

ExMustache supports everything except lambda from mustache spec.

Summary

Functions

Parse the binary and create template which can be used to render

Renders template by interpolating map data. Map keys must be string type.

Types

@type t() :: %ExMustache{partials: map(), template: any()}

Functions

Link to this function

parse(template, opts \\ [])

View Source
@spec parse(
  String.t(),
  keyword()
) :: t()

Parse the binary and create template which can be used to render

Options

  • :dir - directory where partial templates are located.
Link to this function

render(ex_mustache, map)

View Source
@spec render(t(), map()) :: iodata()

Renders template by interpolating map data. Map keys must be string type.

Returns iodata.