slime v0.15.0 Slime.Renderer

Transform Slime templates into HTML.

Summary

Functions

Compile Slime template to valid EEx HTML

Takes a Slime template as a string as well as a set of bindings, and renders the resulting HTML

Functions

precompile(input)

Compile Slime template to valid EEx HTML.

Examples

iex> Slime.Renderer.precompile(~s(input.required type="hidden"))
"<input class=\"required\" type=\"hidden\">"
render(slime, bindings \\ [])

Takes a Slime template as a string as well as a set of bindings, and renders the resulting HTML.

Note that this method of rendering is substantially slower than rendering precompiled templates created with Slime.function_from_file/5 and Slime.function_from_string/5.