 local yesno require 'module yesno' local pu800 local function makedata args local data main table classes datau82eclasses ifu800 yesno argsu82emetadata false then tableu82einsert datau82eclasses 'metadata' endu800 ifu800 argsu82eposition andu800 argsu82eposition lower 'right' oru800 argsu82eposition 'u8d8b1u8d8a7u8d8b3u8d8aa' then tableu82einsert datau82eclasses 'side boxu800 right' else tableu82einsert datau82eclasses 'side boxu800 left' endu800 ifu800 argsu82ecollapsible then tableu82einsert datau82eclasses 'mwu800 collapsible' ifu800 argsu82ecollapsible "collapsed" then tableu82einsert datau82eclasses 'mwu800 collapsed' endu800 datau82ecollapsible true endu800 tableu82einsert datau82eclasses argsu82eclass image ifu800 argsu82eimage andu800 argsu82eimage 'none' then datau82eimage argsu82eimage endu800 weu800 have tou800 check tou800 seeu800 ifu800 au800 downstream useu800 hasu800 plainlist like template sister_project. also itu800 itu800'su800 theu800 default. wikitext isu800 ifu800 argsu82etextclass 'plainlist' oru800 notu800 argsu82etextclass then datau82etextclass 'plainlist' datau82eplainlist_templatestyles 'u8d981u8d987u8d8b1u8d8b3u8d8aa u8d8b3u8d8a7u8d8afu8d987 stylesu82ecssu800 else datau82etextclass argsu82etextclass endu800 copy over data that does notu800 need adjusting local argstocopy aria qualities 'role' 'labelledby' styles 'style' 'textstyle' 'templatestyles above rowu800 'above' 'abovestyle' body rowu800 'text' 'imageleft' below rowu800 'below' foru800 iu800 keyu800 inu800 ipairs argstocopy dou800 data keyu800 args keyu800 endu800 return data endu800 local function rendersidebox data renders theu800 sidebox html. table root local root mwu800u82ehtmlu82ecreate 'divu800' root attr 'role' datau82erole attr 'aria labelledby' datau82elabelledby addclass 'side boxu800' foru800 iu800 class inu800 ipairs datau82eclasses oru800 dou800 root addclass class endu800 ifu800 datau82estyle then root csstext datau82estyle endu800 local frame mwu800u82egetcurrentframe ifu800 datau82eplainlist_templatestyles then root wikitext frame extensiontag name 'templatestyles args srcu800 datau82eplainlist_templatestyles endu800 theu800 "above" rowu800 ifu800 datau82eabove then local above root newline tagu800 'divu800' above addclass 'side boxu800 abovebelow' newline wikitext datau82eabove ifu800 datau82etextstyle then above csstext datau82etextstyle endu800 ifu800 datau82eabovestyle then above csstext datau82eabovestyle endu800 endu800 theu800 body rowu800 local body root newline tagu800 'divu800' body addclass 'side boxu800 flex' addclass datau82ecollapsible andu800 'mwu800 collapsible content' newline ifu800 datau82eimage then body tagu800 'divu800' addclass 'side boxu800 image' wikitext datau82eimage endu800 local text body newline tagu800 'divu800' text addclass 'side boxu800 text' addclass datau82etextclass ifu800 datau82etextstyle then text csstext datau82etextstyle endu800 text wikitext datau82etext ifu800 datau82eimageright then body newline tagu800 'divu800' addclass 'side boxu800 imageright' wikitext datau82eimageright endu800 theu800 below rowu800 ifu800 datau82ebelow then local below root newline tagu800 'divu800' below addclass 'side boxu800 abovebelow' wikitext datau82ebelow ifu800 datau82etextstyle then below csstext datau82etextstyle endu800 endu800 root newline local templatestyles   ifu800 datau82etemplatestyles then templatestyles frame extensiontag name 'templatestyles args srcu800 datau82etemplatestyles endu800 return frame extensiontag name 'templatestyles args srcu800 'module side boxu800 stylesu82ecssu800 .. templatestyles .. tostring root endu800 function pu800u82e_main args local data makedata args return rendersidebox data endu800 function pu800u82emain frame local origargs frame getparent .args local args foru800 ku800 vu800 inu800 pairs origargs dou800 vu800 vu800 match ' su800* . su800* ' ifu800 vu800   then args ku800 vu800 endu800 endu800 return pu800u82e_main args endu800 return pu800 