Skip to content

Instantly share code, notes, and snippets.

@DarkWiiPlayer
Created July 25, 2019 06:40
Show Gist options
  • Save DarkWiiPlayer/48f1249a639c6ffa9161822a57956597 to your computer and use it in GitHub Desktop.
Save DarkWiiPlayer/48f1249a639c6ffa9161822a57956597 to your computer and use it in GitHub Desktop.
local function element(name)
return function(tab)
return function()
print('<'..name..'>')
if type(tab) == 'table' then
for key, value in ipairs(tab) do
value()
end
elseif type(tab) == 'string' then
print(tab)
end
print('</'..name..'>')
end
end
end
local function text(content)
return function()
print(content)
end
end
local template =
element 'html' {
element 'head' {
text 'Hello World!'
}
}
template()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment