surface v0.1.0-alpha.0 Surface.Translator behaviour View Source

Defines a behaviour that must be implemented by all HTML/Surface node translators.

This module also contains the main logic to translate Surface code.

Link to this section Summary

Functions

Translates a string written using the Surface format into a Phoenix template.

Recursively translates nodes from a parsed surface code.

Link to this section Functions

Link to this function

run(string, line_offset, caller, file \\ "nofile")

View Source
run(binary(), integer(), Macro.Env.t(), binary()) :: binary()

Translates a string written using the Surface format into a Phoenix template.

Link to this function

translate(nodes, caller)

View Source

Recursively translates nodes from a parsed surface code.

Link to this section Callbacks

Link to this callback

prepare(nodes, list)

View Source (optional)
prepare(nodes :: [any()], [{:caller, Macro.Env.t()}]) :: any()
Link to this callback

translate(node, list)

View Source
translate(node :: any(), [{:caller, Macro.Env.t()}]) :: any()