ratchet v0.0.3 Ratchet.Html
Summary
Functions
Apply content to an element
Get the property from a list
Transform an element with data
Transform a particular scope in the view with data
Functions
Apply content to an element
iex> Html.apply({"div", [], []}, "Content")
{"div", [], ["Content"]}
iex> Html.apply({"p", [], []}, ["one", "two"])
[{"p", [], ["one"]}, {"p", [], ["two"]}]
Get the property from a list
iex> Html.get_property([:foo, :bar, {"data-prop", "wow"}])
{:ok, "wow"}
iex> Html.get_property([:foo, :bar, :baz])
:error
Transform an element with data
iex> Html.transform({"div", [], [{"p", [{"data-prop", "body"}], []}]}, %{"body" => "Hi!"})
{"div", [], [{"p", [{"data-prop", "body"}], ["Hi!"]}]}