ag_html

The Html module provides functions for building data structures mapping a DOM. These values can be rendered to string HTML output.

Types

Html represents the nested structure of DOM elements.

pub opaque type Html

Functions

pub fn a(children: List(Html), attributes: List(Attribute)) -> Html
pub fn abbr(children: List(Html), attributes: List(Attribute)) -> Html
pub fn acronym(children: List(Html), attributes: List(Attribute)) -> Html
pub fn address(children: List(Html), attributes: List(Attribute)) -> Html
pub fn applet(children: List(Html), attributes: List(Attribute)) -> Html
pub fn area(children: List(Html), attributes: List(Attribute)) -> Html
pub fn article(children: List(Html), attributes: List(Attribute)) -> Html
pub fn audio(children: List(Html), attributes: List(Attribute)) -> Html
pub fn b(children: List(Html), attributes: List(Attribute)) -> Html
pub fn base(children: List(Html), attributes: List(Attribute)) -> Html
pub fn basefont(children: List(Html), attributes: List(Attribute)) -> Html
pub fn bdi(children: List(Html), attributes: List(Attribute)) -> Html
pub fn bdo(children: List(Html), attributes: List(Attribute)) -> Html
pub fn big(children: List(Html), attributes: List(Attribute)) -> Html
pub fn blink(children: List(Html), attributes: List(Attribute)) -> Html
pub fn br(attributes: List(Attribute)) -> Html
pub fn button(children: List(Html), attributes: List(Attribute)) -> Html
pub fn canvas(children: List(Html), attributes: List(Attribute)) -> Html
pub fn caption(children: List(Html), attributes: List(Attribute)) -> Html
pub fn center(children: List(Html), attributes: List(Attribute)) -> Html
pub fn cite(children: List(Html), attributes: List(Attribute)) -> Html
pub fn code(children: List(Html), attributes: List(Attribute)) -> Html
pub fn col(children: List(Html), attributes: List(Attribute)) -> Html
pub fn colgroup(children: List(Html), attributes: List(Attribute)) -> Html
pub fn content(children: List(Html), attributes: List(Attribute)) -> Html
pub fn data(children: List(Html), attributes: List(Attribute)) -> Html
pub fn datalist(children: List(Html), attributes: List(Attribute)) -> Html
pub fn dd(children: List(Html), attributes: List(Attribute)) -> Html
pub fn del(children: List(Html), attributes: List(Attribute)) -> Html
pub fn details(children: List(Html), attributes: List(Attribute)) -> Html
pub fn dfn(children: List(Html), attributes: List(Attribute)) -> Html
pub fn dialog(children: List(Html), attributes: List(Attribute)) -> Html
pub fn dir(children: List(Html), attributes: List(Attribute)) -> Html
pub fn div(children: List(Html), attributes: List(Attribute)) -> Html
pub fn dl(children: List(Html), attributes: List(Attribute)) -> Html
pub fn dt(children: List(Html), attributes: List(Attribute)) -> Html
pub fn element(children: List(Html), attributes: List(Attribute)) -> Html
pub fn em(children: List(Html), attributes: List(Attribute)) -> Html
pub fn embed(children: List(Html), attributes: List(Attribute)) -> Html
pub fn fieldset(children: List(Html), attributes: List(Attribute)) -> Html
pub fn figcaption(children: List(Html), attributes: List(
    Attribute,
  )) -> Html
pub fn figure(children: List(Html), attributes: List(Attribute)) -> Html
pub fn footer(children: List(Html), attributes: List(Attribute)) -> Html
pub fn form(children: List(Html), attributes: List(Attribute)) -> Html
pub fn frame(children: List(Html), attributes: List(Attribute)) -> Html
pub fn frameset(children: List(Html), attributes: List(Attribute)) -> Html
pub fn h1(children: List(Html), attributes: List(Attribute)) -> Html
pub fn h2(children: List(Html), attributes: List(Attribute)) -> Html
pub fn h3(children: List(Html), attributes: List(Attribute)) -> Html
pub fn h4(children: List(Html), attributes: List(Attribute)) -> Html
pub fn h5(children: List(Html), attributes: List(Attribute)) -> Html
pub fn h6(children: List(Html), attributes: List(Attribute)) -> Html
pub fn head(children: List(Html), attributes: List(Attribute)) -> Html
pub fn header(children: List(Html), attributes: List(Attribute)) -> Html
pub fn hgroup(children: List(Html), attributes: List(Attribute)) -> Html
pub fn hr(attributes: List(Attribute)) -> Html
pub fn html(children: List(Html), attributes: List(Attribute)) -> Html
pub fn i(children: List(Html), attributes: List(Attribute)) -> Html
pub fn img(children: List(Html), attributes: List(Attribute)) -> Html
pub fn input(attributes: List(Attribute)) -> Html
pub fn ins(children: List(Html), attributes: List(Attribute)) -> Html
pub fn isindex(children: List(Html), attributes: List(Attribute)) -> Html
pub fn kbd(children: List(Html), attributes: List(Attribute)) -> Html
pub fn keygen(children: List(Html), attributes: List(Attribute)) -> Html
pub fn label(children: List(Html), attributes: List(Attribute)) -> Html
pub fn legend(children: List(Html), attributes: List(Attribute)) -> Html
pub fn li(children: List(Html), attributes: List(Attribute)) -> Html
pub fn link(attributes: List(Attribute)) -> Html
pub fn listing(children: List(Html), attributes: List(Attribute)) -> Html
pub fn main(children: List(Html), attributes: List(Attribute)) -> Html
pub fn map(children: List(Html), attributes: List(Attribute)) -> Html
pub fn mark(children: List(Html), attributes: List(Attribute)) -> Html
pub fn menu(children: List(Html), attributes: List(Attribute)) -> Html
pub fn menuitem(children: List(Html), attributes: List(Attribute)) -> Html
pub fn meta(attributes: List(Attribute)) -> Html
pub fn meter(children: List(Html), attributes: List(Attribute)) -> Html
pub fn nav(children: List(Html), attributes: List(Attribute)) -> Html
pub fn node(name: String, children: List(Html), attributes: List(
    Attribute,
  )) -> Html

Create any DOM node. All functions in this library are based on this function.

Examples

node(“div”, [text(“hello”)], [])

pub fn noembed(children: List(Html), attributes: List(Attribute)) -> Html
pub fn noscript(children: List(Html), attributes: List(Attribute)) -> Html
pub fn object(children: List(Html), attributes: List(Attribute)) -> Html
pub fn ol(children: List(Html), attributes: List(Attribute)) -> Html
pub fn open_node(name: String, attributes: List(Attribute)) -> Html

Create an open DOM node. Some functions in this library are based on this function.

Examples

open_node(“br”, [class(“ruler”)])

pub fn optgroup(children: List(Html), attributes: List(Attribute)) -> Html
pub fn option(children: List(Html), attributes: List(Attribute)) -> Html
pub fn output(children: List(Html), attributes: List(Attribute)) -> Html
pub fn p(children: List(Html), attributes: List(Attribute)) -> Html
pub fn param(children: List(Html), attributes: List(Attribute)) -> Html
pub fn path(children: List(Html), attributes: List(Attribute)) -> Html
pub fn plaintext(children: List(Html), attributes: List(Attribute)) -> Html
pub fn polygon(children: List(Html), attributes: List(Attribute)) -> Html
pub fn pre(children: List(Html), attributes: List(Attribute)) -> Html
pub fn progress(children: List(Html), attributes: List(Attribute)) -> Html
pub fn q(children: List(Html), attributes: List(Attribute)) -> Html
pub fn render(content: Html) -> String

Render an Html value to a plain string.

Example

render(p([text(“Hello”)], [])) “

Hello

pub fn render_document(content: Html) -> String

Render an Html value to a plain string as a full document, including the document type.

Example

render_document(p([text(“Hello”)], [])) “<!doctype html>

Hello

pub fn rp(children: List(Html), attributes: List(Attribute)) -> Html
pub fn rt(children: List(Html), attributes: List(Attribute)) -> Html
pub fn rtc(children: List(Html), attributes: List(Attribute)) -> Html
pub fn ruby(children: List(Html), attributes: List(Attribute)) -> Html
pub fn s(children: List(Html), attributes: List(Attribute)) -> Html
pub fn samp(children: List(Html), attributes: List(Attribute)) -> Html
pub fn script(children: List(Html), attributes: List(Attribute)) -> Html
pub fn section(children: List(Html), attributes: List(Attribute)) -> Html
pub fn select(children: List(Html), attributes: List(Attribute)) -> Html
pub fn shadow(children: List(Html), attributes: List(Attribute)) -> Html
pub fn small(children: List(Html), attributes: List(Attribute)) -> Html
pub fn source(children: List(Html), attributes: List(Attribute)) -> Html
pub fn spacer(children: List(Html), attributes: List(Attribute)) -> Html
pub fn span(children: List(Html), attributes: List(Attribute)) -> Html
pub fn strike(children: List(Html), attributes: List(Attribute)) -> Html
pub fn strong(children: List(Html), attributes: List(Attribute)) -> Html
pub fn style(children: List(Html), attributes: List(Attribute)) -> Html
pub fn sub(children: List(Html), attributes: List(Attribute)) -> Html
pub fn summary(children: List(Html), attributes: List(Attribute)) -> Html
pub fn sup(children: List(Html), attributes: List(Attribute)) -> Html
pub fn svg(children: List(Html), attributes: List(Attribute)) -> Html
pub fn table(children: List(Html), attributes: List(Attribute)) -> Html
pub fn tbody(children: List(Html), attributes: List(Attribute)) -> Html
pub fn td(children: List(Html), attributes: List(Attribute)) -> Html
pub fn template(children: List(Html), attributes: List(Attribute)) -> Html
pub fn text(text: String) -> Html

Create plain text in the DOM. The given string value will be escaped.

Examples

text(“Hello”)

pub fn textarea(children: List(Html), attributes: List(Attribute)) -> Html
pub fn tfoot(children: List(Html), attributes: List(Attribute)) -> Html
pub fn th(children: List(Html), attributes: List(Attribute)) -> Html
pub fn thead(children: List(Html), attributes: List(Attribute)) -> Html
pub fn time(children: List(Html), attributes: List(Attribute)) -> Html
pub fn title(children: List(Html), attributes: List(Attribute)) -> Html
pub fn tr(children: List(Html), attributes: List(Attribute)) -> Html
pub fn track(children: List(Html), attributes: List(Attribute)) -> Html
pub fn tt(children: List(Html), attributes: List(Attribute)) -> Html
pub fn u(children: List(Html), attributes: List(Attribute)) -> Html
pub fn ul(children: List(Html), attributes: List(Attribute)) -> Html
pub fn var(children: List(Html), attributes: List(Attribute)) -> Html
pub fn video(children: List(Html), attributes: List(Attribute)) -> Html
pub fn wbr(attributes: List(Attribute)) -> Html
pub fn xmp(children: List(Html), attributes: List(Attribute)) -> Html
Search Document