Module ce_html

Library of utilities for HTML.

Description

Library of utilities for HTML.

Function Index

escape_html/1Embeds HTML in HTML by escaping HTML metacharacters.
from_list/3Translates an Erlang term into HTML and sends it to a socket.
table/4Generates an HTML table from a list of lists of terms.

Function Details

escape_html/1

escape_html(H::string()) -> string()

Embeds HTML in HTML by escaping HTML metacharacters. (Mainly <, > and &).

from_list/3

from_list(Socket::socket(), Module::module(), Tail::html_list()) -> ok

Translates an Erlang term into HTML and sends it to a socket. The html_list is a list which starts with an atom, may be followed by zero or more {option, value} tuples, may be followed by zero or more text strings or html_lists. e.g. [html, [body, [h1, "Hello"], [p, {align,right}, "Hi"]]]. Before expanding an atom into an HTML tag, the module is checked and if it has an arity 2 function by the name of the atom, it is invoked instead with the socket as the first argument and the remainder of the list as the second argument.

table/4

table(Headings::[term()], Aligns::[align()], Contents::[[term()]], Options::[option()]) -> string()

Generates an HTML table from a list of lists of terms. If the table would be empty, returns an empty string. Options are any options that can be inserted into the table tag (width, border, cellpadding, etc.) The first option may be the tuple {compressed, true}, in which case empty columns will be elided from the table. Note that the string returned by this function is not flattened.


Generated by EDoc, Dec 25 2007, 02:37:29.