diff options
author | sanine <sanine.not@pm.me> | 2022-05-22 02:35:53 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-05-22 02:35:53 -0500 |
commit | 9855e635835716c638ab72c844d5dac08288a20c (patch) | |
tree | e2feb87779195165818acb69d0c1a4f998dae846 /README.md |
initial commit
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..1509a93 --- /dev/null +++ b/README.md @@ -0,0 +1,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. |