Current section
Files
Jump to
Current section
Files
lib/trot/template/engine.ex
defmodule Trot.Template.Engine do
@moduledoc """
Defines the API for rendering a template format.
Both the `compile/1` and `full_compile/1` must specified. `compile/1` is
used to partial render a template while allowing it to be changed on disk
without recompiling the application. `full_compile/1` is intended for
production usage and should output the full quoted version of the template.
"""
use Behaviour
@doc """
Return a quoted expression used to render a file from disk.
"""
defcallback compile(template_file :: binary) :: Macro.t
@doc """
Return a quoted expression of a fully rendered template which only needs to have
variables assigned.
"""
defcallback full_compile(template_file :: binary) :: Macro.t
end