Html

:= []
text : Str -> Node

Create an escaped text node. Characters with special meaning in HTML are encoded when the node is rendered.

raw : Str -> Node

Insert trusted HTML without escaping it.

Prefer text for all user-controlled or plain-text content. Use raw only for trusted markup, such as SSG.parse_markdown! output when the source Markdown is trusted.

element : Str -> List(Attribute), List(Node) -> Node

Define a non-standard HTML Element

You can use this to add elements that are not already supported. For example, you could bring back the obsolete <blink> element, and add some 90's nostalgia to your web page!

blink : List Attribute, List Node -> Node blink = element "blink"

html = blink [] [ text "This text is blinking!" ]

render_document : Node -> Str

Render a complete HTML document, including the <!DOCTYPE html> prefix.

The output has no whitespace inserted between nodes.

html : ElementBuilder
base : VoidBuilder
head : ElementBuilder
link : VoidBuilder
meta : VoidBuilder
body : ElementBuilder
h1 : ElementBuilder
h2 : ElementBuilder
h3 : ElementBuilder
h4 : ElementBuilder
h5 : ElementBuilder
h6 : ElementBuilder
main : ElementBuilder
nav : ElementBuilder
dd : ElementBuilder
div : ElementBuilder
dl : ElementBuilder
dt : ElementBuilder
hr : VoidBuilder
li : ElementBuilder
menu : ElementBuilder
ol : ElementBuilder
p : ElementBuilder
pre : ElementBuilder
ul : ElementBuilder
a : ElementBuilder
abbr : ElementBuilder
b : ElementBuilder
bdi : ElementBuilder
bdo : ElementBuilder
br : VoidBuilder
cite : ElementBuilder
code : ElementBuilder
data : ElementBuilder
dfn : ElementBuilder
em : ElementBuilder
i : ElementBuilder
kbd : ElementBuilder
mark : ElementBuilder
q : ElementBuilder
rp : ElementBuilder
rt : ElementBuilder
ruby : ElementBuilder
s : ElementBuilder
samp : ElementBuilder
span : ElementBuilder
sub : ElementBuilder
sup : ElementBuilder
time : ElementBuilder
u : ElementBuilder
var_ : ElementBuilder
wbr : VoidBuilder
area : VoidBuilder
img : VoidBuilder
map : ElementBuilder
svg : ElementBuilder
math : ElementBuilder
del : ElementBuilder
ins : ElementBuilder
col : VoidBuilder
td : ElementBuilder
th : ElementBuilder
tr : ElementBuilder
form : ElementBuilder
slot : ElementBuilder

Node

Html.Node :: # (opaque)