jhn_mustache (jhn_stdlib v5.10.3)

View Source

Mustache template rendering.

The context is given either as a property list or a map with the keys being the tags as atoms. The partials are realised by recursively call rendering until no tags remain.

Summary

Functions

Renders a mustache template, the same as render(Template, Context, iolist).

Renders a mustache template. Option is: binary -> a binary is returned iolist -> an iolist is returned (default)

Types

context/0

-type context() :: jhn_plist:plist() | map().

option/0

-type option() :: binary | iolist.

template/0

-type template() :: binary().

Functions

render(Template, Context)

-spec render(template(), context()) -> iolist().

Renders a mustache template, the same as render(Template, Context, iolist).

render(Template, Context, _)

-spec render(template(), context(), option()) -> iolist() | binary().

Renders a mustache template. Option is: binary -> a binary is returned iolist -> an iolist is returned (default)