View Source Hologram.Template.DOM (hologram v0.2.0)

Summary

Functions

Builds DOM AST from the given parsed tags.

Types

dom_node()

@type dom_node() ::
  {:component, module(), [{String.t(), t()}], t()}
  | {:element, String.t(), [{String.t(), t()}], t()}
  | {:expression, {any()}}
  | {:page, module(), [{String.t(), t()}], []}
  | {:public_comment, t()}
  | {:text, String.t()}

t()

@type t() :: dom_node() | [dom_node()]

Functions

build_ast(tags)

Builds DOM AST from the given parsed tags.

Examples

iex> tags = [{:start_tag, {"div, []}}, {:text, "abc"}, {:end_tag, "div"}]
iex> build_ast(tags)
[{:{}, [line: 1], [:element, "div", [], [{:text, "abc"}]]}]