View Source Antikythera.TemplatePrecompiler (antikythera v0.5.1)

Definition of macro to precompile HAML templates.

Each gear's template module (web/template.ex) must use this module as follows:

defmodule YourGear.Template do
  use Antikythera.TemplatePrecompiler
end

HAML files whose paths match web/template/**/*.html.haml are loaded and converted into function clauses at compile time. To render HAML files in controller actions, use Antikythera.Conn.render/5.

As all macro-generated function clauses of content_for/2 reside in YourGear.Template, you can, for example, put alias before use Antikythera.TemplatePrecompiler so that it takes effect in all HAML templates.