diff options
| author | frosty <gabriel@bwaaa.monster> | 2026-09-19 23:10:06 -0400 |
|---|---|---|
| committer | frosty <gabriel@bwaaa.monster> | 2026-09-19 23:10:06 -0400 |
| commit | ca4732f7c6e3d0c735cb0977c505db52b99ff688 (patch) | |
| tree | 250b36e991a24835b50cfa209523b0935ee2a381 /examples | |
| parent | 9b34d3cb8ea7d7651fc65d264b0dcfd867cc044b (diff) | |
feat: support variadic html.element children
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/site/build.lua | 11 |
1 files changed, 5 insertions, 6 deletions
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"), "." } |
