markaby v0.1.0 Markaby

Markaby is clone of Markaby for Elixir and is compatible with Phoenix views.

Nesting

Tag macros use do blocks to nest content and the result of every expression becomes part of the the html output. No output is generated on nil values. Unsafe content can be embedded with the raw function.

Compatible

The iodata output stream uses the same :safe tagging as Phoenix and can be directly called in views without escape_html.

Example

iex> import Kernel, except: [div: 2]
...> import Markaby
...> div do
...>    h1 do "Markaby" end
...>    h2 do "|> Elixir" end
...> end
...> |> escape_html
...> |> IO.iodata_to_binary
"<div><h1>Markaby</h1><h2>|&gt; Elixir</h2></div>"

Available tags

Summary

Functions

Escapes textual content into HTML safe output

Embed unsafe content directly in output

Generate a tag with attributes and use the do block for nesting content

Functions

escape_html(arg1)

Escapes textual content into HTML safe output.

raw(raw)

Embed unsafe content directly in output.

tag(tag, attrs \\ %{}, list)

Generate a tag with attributes and use the do block for nesting content.