slime v1.2.0 Slime.Renderer View Source

Transform Slime templates into HTML.

Link to this section 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

Link to this section Functions

Compile Slime template to valid EEx HTML.

Examples

iex> Slime.Renderer.precompile(~s(input.required type="hidden"))
"<input class=\"required\" type=\"hidden\">"
Link to this function render(slime, bindings \\ [], opts \\ []) View Source

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.