From ca4732f7c6e3d0c735cb0977c505db52b99ff688 Mon Sep 17 00:00:00 2001 From: frosty Date: Sat, 19 Sep 2026 23:10:06 -0400 Subject: feat: support variadic html.element children --- examples/site/build.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/site/build.lua b/examples/site/build.lua index f3b07e1..e18124e 100644 --- a/examples/site/build.lua +++ b/examples/site/build.lua @@ -11,7 +11,7 @@ local features = { local feature_list = assert(html.find_by_class(page, "feature-list")) for _, feature in ipairs(features) do - table.insert(feature_list.children, html.element("li", nil, { feature })) + table.insert(feature_list.children, html.element("li", nil, feature)) end local entries = {} @@ -25,10 +25,9 @@ summary.text = tostring(#entries) .. " entries" local file_list = assert(html.find_by_class(page, "file-list")) for _, entry in ipairs(entries) do - table.insert(file_list.children, html.element("li", nil, { - html.element("code", nil, { entry.path }), - " (", entry.type, ")" - })) + table.insert(file_list.children, html.element("li", nil, + html.element("code", nil, entry.path), + " (", entry.type, ")")) end local build_summary = assert(html.find_by_class(page, "build-summary")) @@ -38,7 +37,7 @@ local mixed = assert(html.find_by_class(page, "mixed-content")) mixed.children = { { kind = "comment", text = "generated by Lua" }, "Text with ", - html.element("strong", nil, { "an element" }), + html.element("strong", nil, "an element"), "." } -- cgit v1.3