slime v0.15.0 Slime
Slim-like HTML templates.
Summary
Functions
See Slime.Renderer.render/1
Macros
Generates a function definition from the file contents.
The kind (:def
or :defp
) must be given, the
function name, its arguments and the compilation options.
This function is useful in case you have templates but
you want to precompile inside a module for speed
Generates a function definition from the string.
The kind (:def
or :defp
) must be given, the
function name, its arguments and the compilation options
Functions
Macros
Generates a function definition from the file contents.
The kind (:def
or :defp
) must be given, the
function name, its arguments and the compilation options.
This function is useful in case you have templates but
you want to precompile inside a module for speed.
Examples
# sample.slim
= a + b
# sample.ex
defmodule Sample do
require Slime
Slime.function_from_file :def, :sample, "sample.slime", [:a, :b]
end
# iex
Sample.sample(1, 2) #=> "3"
Generates a function definition from the string.
The kind (:def
or :defp
) must be given, the
function name, its arguments and the compilation options.
Examples
iex> defmodule Sample do
...> require Slime
...> Slime.function_from_string :def, :sample, "= a + b", [:a, :b]
...> end
iex> Sample.sample(1, 2)
"3"