summaryrefslogtreecommitdiff
path: root/README.md
blob: 1509a9348be11ae03d519e6e4f4ff0bd725a57c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
marigold-cgi
============

A Lua CGI scripting toolkit.

usage
-----

### retrieving meta-variables

`marigold.get_metavars()` - returns a table. The keys are the (lowercase) names of the meta-variables described in section 4.1 of RFC 3875 and are associated with their (string) values.

### generating html

`marigold.h(tag, attributes_and_children)` - returns a `marigold.html` table. `tag` is a string; `attributes_and_children` is a table containing, uh, tag attributes and children. Attributes are string keys with string values and represent the tag's attributes (e.g. `{id='tag1', class='large blinking'}` converts to `<[tag] id="tag1" class="large blinking"></[tag]>`). Children are the array elements of the table and should contain `marigold.html` tables as values.

The only thing that is special about `marigold.html` tables is that they can be passed to `marigold.render_html(tbl, indent_level=0)` in order to produce actual string output.