robin/maivi
a tiny cute lua web framework
git clone https://git.robinwobin.dev/robin/maivi
a31ba2f
push-srxvuswpkqxx
1---@class H 2---@overload fun(tag: string, children: Displayable|Children): Element 3---@overload fun(children: Displayable|Children): Element 4local h ={} 5 6h . document =maivi . elem ( "!DOCTYPE html" , { close =false } ) 7h . raw =maivi . elem ( nil , { raw =true } ) 8h . comment =function ( str ) 9str =maivi . str . escape ( str ) 10return h . raw ( string . format ( "<!-- %s -->" , str )) 11end 12 13-- svg 14h . path =maivi . elem ( "path" , { empty =true } ) 15 16h . stylesheet =function ( args ) 17args . rel ="stylesheet" 18args . type ="text/css" 19return h . link ( args ) 20end 21 22return maivi . defaulttable ( h , maivi . elem , { 23__call =function ( _ , tagorchildren , children ) 24local tag 25if not children then 26children =tagorchildren 27else 28tag =tagorchildren 29end 30 31return maivi . elem ( tag )( children ) 32end , 33} )