danm v0.1.4 Danm.HtmlWriter

Provide helper functions to write html programatically into a chardata all functions in this module put more data in a chardata

Link to this section Summary

Functions

helper macro to maintain flow of the pipe operator

build a void-element, which is an element that should not have inner text. It may have attributes though. Don't call this unless you are making a custom element; use the element specific funcions instead.

build a non-void element, which is an element that may have inner text. It may also have attributes. Don't call this unless you are making a custom element; use the element specific funcionsinstead.

export the data in the correct order

Invoke the func with s. This is used to keep the pipe flowing

start with minimum boilerplate

This is basically Enum.reduce with first 2 argument switched

Just add some text

Link to this section Functions

Link to this function

a(s, inner, attrs \\ [])

Link to this macro

bind_to(value, name)

(macro)

helper macro to maintain flow of the pipe operator

Link to this function

body(s, inner, attrs \\ [])

Link to this function

br(s, attrs \\ [])

Link to this function

div(s, inner, attrs \\ [])

Link to this function

element(s, tag, attrs)

build a void-element, which is an element that should not have inner text. It may have attributes though. Don't call this unless you are making a custom element; use the element specific funcions instead.

tag is the tag name. attr are a keyword list of attrbutes, each can be a string, an list of strings, or nil

Link to this function

element(s, tag, text, attrs)

build a non-void element, which is an element that may have inner text. It may also have attributes. Don't call this unless you are making a custom element; use the element specific funcionsinstead.

tag is the tag name. inner can be nil, a string or a function with arity of 1 that build inner text attr are a keyword list of attrbutes, each can be a string, an list of strings, or nil

export the data in the correct order

Link to this function

h1(s, inner, attrs \\ [])

Link to this function

h2(s, inner, attrs \\ [])

Link to this function

h3(s, inner, attrs \\ [])

Link to this function

h4(s, inner, attrs \\ [])

Link to this function

h5(s, inner, attrs \\ [])

Link to this function

h6(s, inner, attrs \\ [])

Link to this function

head(s, inner, attrs \\ [])

Link to this function

hr(s, attrs \\ [])

Link to this function

html(s, inner, attrs \\ [])

Link to this function

img(s, attrs \\ [])

Link to this function

invoke(s, func)

Invoke the func with s. This is used to keep the pipe flowing

Link to this function

li(s, inner, attrs \\ [])

Link to this function

link(s, attrs \\ [])

Link to this function

meta(s, attrs \\ [])

start with minimum boilerplate

Link to this function

p(s, inner, attrs \\ [])

Link to this function

roll_in(s, enum, function)

This is basically Enum.reduce with first 2 argument switched

Link to this function

script(s, inner, attrs \\ [])

Link to this function

style(s, inner, attrs \\ [])

Link to this function

table(s, inner, attrs \\ [])

Link to this function

td(s, inner, attrs \\ [])

Just add some text

Link to this function

th(s, inner, attrs \\ [])

Link to this function

title(s, inner, attrs \\ [])

Link to this function

tr(s, inner, attrs \\ [])

Link to this function

ul(s, inner, attrs \\ [])