transmute v0.1.0 Transmute.Plugin.Html

Link to this section Summary

Link to this section Functions

Link to this function

attributes(attrs)

Link to this function

context(arg1, ctx)

Callback implementation for Transmute.Plugin.Behaviour.context/2.

Callback implementation for Transmute.Plugin.Behaviour.key/0.

Link to this function

root_context(opts)

Callback implementation for Transmute.Plugin.Behaviour.root_context/1.

Link to this function

transform(node, ctx)

Transforms a tag into an IO list.

iex> alias Transmute.Logic
...> node = {:tag, %{name: "a", attrs: [href: "/home"]}, "Hi"}
...> ctx = %{depth: 2, indent: "  "}
...> transform(node, ctx) |> Logic.to_iodata() |> IO.iodata_to_binary()
~s(    <a href="/home">\n      Hi\n    </a>\n)