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>|> Elixir</h2></div>"
Available tags
- a, abbr, address, area, article, aside, audio, b, base, bdi, bdo, blockquote, body, br, button, canvas, caption, cite, code, col, colgroup, command, datalist, dd, del, details, dfn, div, dl, dt, em, embed, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, head, header, hgroup, hr, html, i, iframe, img, input, ins, kbd, keygen, label, legend, li, link, map, mark, menu, meta, meter, nav, noscript, object, ol, optgroup, option, output, p, param, pre, progress, q, rp, rt, ruby, s, samp, script, section, select, small, source, span, strong, style, sub, summary, sup, table, tbody, td, textarea, tfoot, th, thead, time, title, tr, track, u, ul, var, video, wbr
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