View Source jhn_mustache (jhn_stdlib v5.1.0)

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

-type context() :: jhn_plist:plist() | map().
-type option() :: binary | iolist.
-type template() :: binary().

Functions

Link to this function

render(Template, Context)

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

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

Link to this function

render(Template, Context, _)

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

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