From 9855e635835716c638ab72c844d5dac08288a20c Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 22 May 2022 02:35:53 -0500 Subject: initial commit --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 README.md (limited to 'README.md') 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">`). 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. -- cgit v1.2.1