15 lines
326 B
Elixir
15 lines
326 B
Elixir
defmodule Temple.LiveViewEngine do
|
|
@behaviour Phoenix.Template.Engine
|
|
|
|
@moduledoc false
|
|
|
|
def compile(path, _name) do
|
|
require Temple
|
|
|
|
ast = path |> File.read!() |> Code.string_to_quoted!(file: path)
|
|
|
|
Temple.temple(ast)
|
|
|> EEx.compile_string(engine: Phoenix.LiveView.Engine, file: path, line: 1)
|
|
end
|
|
end
|