Sablon.Context (sablon v0.4.3)

Copy Markdown View Source

Turns the user supplied context into the shape the renderer expects.

Keys are stringified and nested hashes and lists are transformed recursively. A key of the form "type:name" builds a typed content value for name, so "html:body" => "<p>..</p>" is the same as body: Sablon.content(:html, "<p>..</p>").

Summary

Functions

The pattern used to detect typed context keys.

Transforms a user supplied context map.

Functions

content_regex()

@spec content_regex() :: Regex.t()

The pattern used to detect typed context keys.

transform(context)

@spec transform(map() | keyword()) :: map()

Transforms a user supplied context map.