diff options
Diffstat (limited to 'lib/html.server.moon')
| -rw-r--r-- | lib/html.server.moon | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/html.server.moon b/lib/html.server.moon deleted file mode 100644 index 3a7b537..0000000 --- a/lib/html.server.moon +++ /dev/null @@ -1,33 +0,0 @@ -import opairs from require 'lib.ordered' - -element = (element) -> (...) -> - children = { ... } - - -- attributes are last arguments but mustn't be a ReactiveVar - attributes = children[#children] - if 'table' == (type attributes) and not attributes.node - table.remove children - else - attributes = {} - - b = "<#{element}" - for k,v in opairs attributes - if k == 'style' and 'table' == type v - tmp = '' - for kk, vv in opairs v - tmp ..= "#{kk}: #{vv}; " - v = tmp - b ..= " #{k}=\"#{v}\"" - - -- if there is only one argument, - -- children can be in attributes table too - if #children == 0 - children = attributes - - b ..= ">" .. table.concat children, '' - b ..= "</#{element}>" - b - -setmetatable {}, __index: (name) => - with val = element name - @[name] = val |
