Module skooma.dom

Simple DOM generation library

Functions

render (node) Renders a dom node
next_attribute (node, previous) Like next, but for node attributes (string keys).
attributes (node) like pairs but for node attributes (string keys).
insert (node, subtree) Inserts a subtree into a node.
node (name, format) Creates a new DOM node.

Tables

node Table representing a DOM node.


Functions

render (node)
Renders a dom node

Parameters:

next_attribute (node, previous)
Like next, but for node attributes (string keys).

Parameters:

  • node
  • previous
attributes (node)
like pairs but for node attributes (string keys).

Parameters:

  • node
insert (node, subtree)
Inserts a subtree into a node. Non-table values and nodes are inserted as-is. Tables are iterated and their integer keys are inserted into the given node in order while string keys are set as attributes.

Parameters:

  • node
  • subtree
node (name, format)
Creates a new DOM node.

Parameters:

  • name string Tag name of the new node
  • format string Serialisation format of the new node (html, xml, etc.). Defaults to whatever is set in the environment, or ‘xml’ if nothing is set.

Tables

node
Table representing a DOM node. Integer keys are child elements. String keys are properties. The special tokens dom.name and dom.format serve as keys for the nodes name and its format (html, xml, etc.) respectively.
generated by LDoc 1.4.6 Last updated 2022-12-26 00:16:42