# Module htmlgen

This module implements a simple XML and HTML code generator. Each commonly used HTML tag has a corresponding macro that generates a string with its HTML representation.

Example:

    var nim = "Nimrod"
    echo h1(a(href="http://nimrod-code.org", nim))

Writes the string:

    <h1><a href="http://nimrod-code.org">Nimrod</a></h1>

# Imports

macros, strutils

# Consts

    coreAttr* = " id class title style "

    eventAttr* = " onclick ondblclick onmousedown onmouseup " &
        "onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup "

    commonAttr* = coreAttr & eventAttr

# Procs

    proc xmlCheckedTag*(e: PNimrodNode; tag: string; optAttr = ""; reqAttr = "";
                        isLeaf = false): PNimrodNode {.compileTime.}

  use this procedure to define a new XML tag

# Macros

    macro a*(e: expr): expr {.immediate.}

  generates the HTML `a` element.

    macro acronym*(e: expr): expr {.immediate.}

  generates the HTML `acronym` element.

    macro address*(e: expr): expr {.immediate.}

  generates the HTML `address` element.

    macro area*(e: expr): expr {.immediate.}

  generates the HTML `area` element.

    macro b*(e: expr): expr {.immediate.}

  generates the HTML `b` element.

    macro base*(e: expr): expr {.immediate.}

  generates the HTML `base` element.

    macro big*(e: expr): expr {.immediate.}

  generates the HTML `big` element.

    macro blockquote*(e: expr): expr {.immediate.}

  generates the HTML `blockquote` element.

    macro body*(e: expr): expr {.immediate.}

  generates the HTML `body` element.

    macro br*(e: expr): expr {.immediate.}

  generates the HTML `br` element.

    macro button*(e: expr): expr {.immediate.}

  generates the HTML `button` element.

    macro caption*(e: expr): expr {.immediate.}

  generates the HTML `caption` element.

    macro cite*(e: expr): expr {.immediate.}

  generates the HTML `cite` element.

    macro code*(e: expr): expr {.immediate.}

  generates the HTML `code` element.

    macro col*(e: expr): expr {.immediate.}

  generates the HTML `col` element.

    macro colgroup*(e: expr): expr {.immediate.}

  generates the HTML `colgroup` element.

    macro dd*(e: expr): expr {.immediate.}

  generates the HTML `dd` element.

    macro del*(e: expr): expr {.immediate.}

  generates the HTML `del` element.

    macro dfn*(e: expr): expr {.immediate.}

  generates the HTML `dfn` element.

    macro `div`*(e: expr): expr {.immediate.}

  generates the HTML `div` element.

    macro dl*(e: expr): expr {.immediate.}

  generates the HTML `dl` element.

    macro dt*(e: expr): expr {.immediate.}

  generates the HTML `dt` element.

    macro em*(e: expr): expr {.immediate.}

  generates the HTML `em` element.

    macro fieldset*(e: expr): expr {.immediate.}

  generates the HTML `fieldset` element.

    macro form*(e: expr): expr {.immediate.}

  generates the HTML `form` element.

    macro h1*(e: expr): expr {.immediate.}

  generates the HTML `h1` element.

    macro h2*(e: expr): expr {.immediate.}

  generates the HTML `h2` element.

    macro h3*(e: expr): expr {.immediate.}

  generates the HTML `h3` element.

    macro h4*(e: expr): expr {.immediate.}

  generates the HTML `h4` element.

    macro h5*(e: expr): expr {.immediate.}

  generates the HTML `h5` element.

    macro h6*(e: expr): expr {.immediate.}

  generates the HTML `h6` element.

    macro head*(e: expr): expr {.immediate.}

  generates the HTML `head` element.

    macro html*(e: expr): expr {.immediate.}

  generates the HTML `html` element.

    macro hr*(e: expr): expr {.immediate.}

  generates the HTML `hr` element.

    macro i*(e: expr): expr {.immediate.}

  generates the HTML `i` element.

    macro img*(e: expr): expr {.immediate.}

  generates the HTML `img` element.

    macro input*(e: expr): expr {.immediate.}

  generates the HTML `input` element.

    macro ins*(e: expr): expr {.immediate.}

  generates the HTML `ins` element.

    macro kbd*(e: expr): expr {.immediate.}

  generates the HTML `kbd` element.

    macro label*(e: expr): expr {.immediate.}

  generates the HTML `label` element.

    macro legend*(e: expr): expr {.immediate.}

  generates the HTML `legend` element.

    macro li*(e: expr): expr {.immediate.}

  generates the HTML `li` element.

    macro link*(e: expr): expr {.immediate.}

  generates the HTML `link` element.

    macro map*(e: expr): expr {.immediate.}

  generates the HTML `map` element.

    macro meta*(e: expr): expr {.immediate.}

  generates the HTML `meta` element.

    macro noscript*(e: expr): expr {.immediate.}

  generates the HTML `noscript` element.

    macro `object`*(e: expr): expr {.immediate.}

  generates the HTML `object` element.

    macro ol*(e: expr): expr {.immediate.}

  generates the HTML `ol` element.

    macro optgroup*(e: expr): expr {.immediate.}

  generates the HTML `optgroup` element.

    macro option*(e: expr): expr {.immediate.}

  generates the HTML `option` element.

    macro p*(e: expr): expr {.immediate.}

  generates the HTML `p` element.

    macro param*(e: expr): expr {.immediate.}

  generates the HTML `param` element.

    macro pre*(e: expr): expr {.immediate.}

  generates the HTML `pre` element.

    macro q*(e: expr): expr {.immediate.}

  generates the HTML `q` element.

    macro samp*(e: expr): expr {.immediate.}

  generates the HTML `samp` element.

    macro script*(e: expr): expr {.immediate.}

  generates the HTML `script` element.

    macro select*(e: expr): expr {.immediate.}

  generates the HTML `select` element.

    macro small*(e: expr): expr {.immediate.}

  generates the HTML `small` element.

    macro span*(e: expr): expr {.immediate.}

  generates the HTML `span` element.

    macro strong*(e: expr): expr {.immediate.}

  generates the HTML `strong` element.

    macro style*(e: expr): expr {.immediate.}

  generates the HTML `style` element.

    macro sub*(e: expr): expr {.immediate.}

  generates the HTML `sub` element.

    macro sup*(e: expr): expr {.immediate.}

  generates the HTML `sup` element.

    macro table*(e: expr): expr {.immediate.}

  generates the HTML `table` element.

    macro tbody*(e: expr): expr {.immediate.}

  generates the HTML `tbody` element.

    macro td*(e: expr): expr {.immediate.}

  generates the HTML `td` element.

    macro textarea*(e: expr): expr {.immediate.}

  generates the HTML `textarea` element.

    macro tfoot*(e: expr): expr {.immediate.}

  generates the HTML `tfoot` element.

    macro th*(e: expr): expr {.immediate.}

  generates the HTML `th` element.

    macro thead*(e: expr): expr {.immediate.}

  generates the HTML `thead` element.

    macro title*(e: expr): expr {.immediate.}

  generates the HTML `title` element.

    macro tr*(e: expr): expr {.immediate.}

  generates the HTML `tr` element.

    macro tt*(e: expr): expr {.immediate.}

  generates the HTML `tt` element.

    macro ul*(e: expr): expr {.immediate.}

  generates the HTML `ul` element.

    macro `var`*(e: expr): expr {.immediate.}

  generates the HTML `var` element.

Generated: 2012-09-23 21:47:54 UTC