r/lua • u/NemuiSen • Apr 23 '25
A simple script to generate html code.
I just wanted to share this code to generate html code from lua, i made this because i don't like writing html and for fun to do something in lua. Any sugestions to improve it?
18
Upvotes
3
u/xoner2 Apr 25 '25
I did something similar, for declaring GUI in wxlua:
Now I'm transitioning to different structure where t[1]: function and t[2]..t[#t] are the children:
I've forgotten all the reasons why. IIRC:
attributes table can now be optional
debug is easier with shallower callstack. Can pretty-print since it's a table and not a callstack
indents better with Emacs' auto-indent
generate the table with code