 u8d8a8u8d8b1u8d8a7u8db8c u8d981u8d8a7u8d8b1u8d8b3u8db8cu8e2808cu8d8b3u8d8a7u8d8b2u8db8c u8d8a8u8d987u8d8aau8d8b1u8d88c u8d8a8u8d8aeu8d8b4u8db8c u8d8a7u8d8b2 u8d8a7u8db8cu8d986 u8d9beu8d988u8d8afu8d985u8d8a7u8d986 u8d8aau8d8bau8db8cu8db8cu8d8b1u8db8cu8d8a7u8d981u8d8aau8d987 u8d8a7u8d8b3u8d8aa u8daa9u8d987 u8d8afu8d8b1 u8d987u8d985u8d8a7u8d986u8e2808cu8d8acu8d8a7 u8d8a8u8d987 u8d981u8d8a7u8d8b1u8d8b3u8db8c u8d8b0u8daa9u8d8b1 u8d8b4u8d8afu8d987u8e2808cu8d8a7u8d8b3u8d8aa. u8d984u8d8b7u8d981u8d8a7u8d98b u8d987u8d986u8daafu8d8a7u8d985 u8d8aau8d8bau8db8cu8db8cu8d8b1 u8d9beu8d988u8d8afu8d985u8d8a7u8d986 u8d8afu8d982u8d8aa u8daa9u8d986u8db8cu8d8af. this module outputs different kinds ofu800 lists. atu800 theu800 moment bulleted unbulleted horizontal ordered andu800 horizontal ordered lists areu800 supported. local libutil require 'libraryutil' local checktype libutilu82echecktype local mtabletools require 'module tabletools local pu800 local num_con require 'module numeral converter' .convert local listtypes 'bulleted' true 'unbulleted' true 'horizontal' true 'ordered' true 'horizontal_ordered' true function pu800u82emakelistdata listtype args constructs au800 data table tou800 beu800 passed tou800 pu800u82erenderlist. local data classes andu800 templatestyles u8d981u8d987u8d8b1u8d8b3u8d8aa u8d8b3u8d8a7u8d8afu8d987 stylesu82ecssu800 u8d8a8u8d8a7u8db8cu8d8af u8d981u8d8a7u8d8b1u8d8b3u8db8c u8d8a8u8d8a7u8d8b4u8d8af datau82eclasses datau82etemplatestyles   ifu800 listtype 'horizontal' oru800 listtype 'horizontal_ordered' then tableu82einsert datau82eclasses 'hlist' datau82etemplatestyles mwu800u82egetcurrentframe extensiontag name 'templatestyles args srcu800 'hlist stylesu82ecssu800 elseif listtype 'unbulleted' then tableu82einsert datau82eclasses 'plainlist' datau82etemplatestyles mwu800u82egetcurrentframe extensiontag name 'templatestyles args srcu800 'u8d981u8d987u8d8b1u8d8b3u8d8aa u8d8b3u8d8a7u8d8afu8d987 stylesu82ecssu800 endu800 tableu82einsert datau82eclasses argsu82eclass main divu800 style datau82estyle argsu82estyle indent foru800 horizontal lists ifu800 listtype 'horizontal' oru800 listtype 'horizontal_ordered' then local indent tonumber argsu82eindent indent indent andu800 indent * 1u800u82e6u800 oru800 0u800 ifu800 indent 0u800 then u8d8a8u8d8b1u8d8a7u8db8c u8d981u8d8a7u8d8b1u8d8b3u8db8cu8e2808cu8d8b3u8d8a7u8d8b2u8db8c u8d8a8u8d987u8d8aau8d8b1u8d88c u8d986u8d8a7u8d985 u8d985u8d8aau8d8bau8db8cu8d8b1 u8d8b2u8db8cu8d8b1 u8d8a7u8d8b2 marginleft u8d8a8u8d987 marginright u8d8aau8d8bau8db8cu8db8cu8d8b1 u8d8afu8d8a7u8d8afu8d987 u8d8b4u8d8afu8d987u8e2808cu8d8a7u8d8b3u8d8aa datau82emarginright indent .. 'emu800' endu800 endu800 list style types foru800 ordered lists this could beu800 "1u800 2u800 3u800" "au800 bu800 cu800" oru800 au800 number ofu800 others. theu800 list style type isu800 either setu800 byu800 theu800 "type" attribute oru800 theu800 "list style type" cssu800 property. ifu800 listtype 'ordered' oru800 listtype 'horizontal_ordered' then datau82eliststyletype argsu82elist_style_type oru800 args 'list style type' datau82etype args 'type' detect invalid type attributes andu800 attempt tou800 convert them tou800 list style type cssu800 properties. ifu800 datau82etype andu800 notu800 datau82eliststyletype andu800 notu800 tostring datau82etype find ' su800* 1aaii su800* ' then datau82eliststyletype datau82etype datau82etype nilu800 endu800 endu800 list tagu800 type ifu800 listtype 'ordered' oru800 listtype 'horizontal_ordered' then datau82elisttag 'olu800' else datau82elisttag 'ulu800' endu800 start number foru800 ordered lists datau82estart num_con "enu800" argsu82estart twou800 newu800 persian translation foru800 theu800 start parameter ifu800 args 'u8d8a2u8d8bau8d8a7u8d8b2' then datau82estart num_con "enu800" args 'u8d8a2u8d8bau8d8a7u8d8b2' endu800 ifu800 args 'u8d8b4u8d8b1u8d988u8d8b9' then datau82estart num_con "enu800" args 'u8d8b4u8d8b1u8d988u8d8b9' endu800 ifu800 listtype 'horizontal_ordered' then apply fixu800 tou800 getu800 start numbers working with horizontal ordered lists. local startnum tonumber datau82estart ifu800 startnum then datau82ecounterreset 'listitem ' .. tostring startnum 1u800 endu800 endu800 list style ul_style andu800 ol_style areu800 included foru800 backwards compatibility. nou800 distinction isu800 made foru800 ordered oru800 unordered lists. datau82eliststyle argsu82elist_style list items li_style isu800 included foru800 backwards compatibility. item_style wasu800 included tou800 beu800 easier tou800 understand foru800 nonu800 coders. datau82eitemstyle argsu82eitem_style oru800 argsu82eli_style datau82eitems foru800 _u800 numu800 inu800 ipairs mtabletoolsu82enumkeys args dou800 local item itemu82econtent args numu800 itemu82estyle args 'item' .. tostring numu800 .. '_style' oru800 args 'item_style' .. tostring numu800 itemu82evalue args 'item' .. tostring numu800 .. '_value' oru800 args 'item_value' .. tostring numu800 tableu82einsert datau82eitems item endu800 return data endu800 function pu800u82erenderlist data renders theu800 list html. return theu800 blank string ifu800 there areu800 nou800 list items. ifu800 type datau82eitems 'table' oru800 #datau82eitems 1u800 then return   endu800 render theu800 main divu800 tagu800. local root mwu800u82ehtmlu82ecreate 'divu800' foru800 _u800 class inu800 ipairs datau82eclasses oru800 dou800 root addclass class endu800 u8d8a8u8d8b1u8d8a7u8db8c u8d981u8d8a7u8d8b1u8d8b3u8db8cu8e2808cu8d8b3u8d8a7u8d8b2u8db8c u8d8a8u8d987u8d8aau8d8b1u8d88c u8d986u8d8a7u8d985 u8d985u8d8aau8d8bau8db8cu8d8b1 u8d8b2u8db8cu8d8b1 u8d8a7u8d8b2 marginleft u8d8a8u8d987 marginright u8d8aau8d8bau8db8cu8db8cu8d8b1 u8d8afu8d8a7u8d8afu8d987 u8d8b4u8d8afu8d987u8e2808cu8d8a7u8d8b3u8d8aa root cssu800 'margin right' datau82emarginright ifu800 datau82estyle then root csstext datau82estyle endu800 render theu800 list tagu800. local list root tagu800 datau82elisttag oru800 'ulu800' list attr start datau82estart type datau82etype cssu800 'counter reset' datau82ecounterreset 'list style type' datau82eliststyletype ifu800 datau82eliststyle then list csstext datau82eliststyle endu800 render theu800 list items foru800 _u800 tu800 inu800 ipairs datau82eitems oru800 dou800 local item list tagu800 'liu800' ifu800 datau82eitemstyle then item csstext datau82eitemstyle endu800 ifu800 tu800u82estyle then item csstext tu800u82estyle endu800 item attr value tu800u82evalue wikitext tu800u82econtent endu800 return datau82etemplatestyles .. tostring root endu800 function pu800u82erendertrackingcategories args local isdeprecated false tracks deprecated parameters. foru800 ku800 vu800 inu800 pairs args dou800 ku800 tostring ku800 ifu800 ku800 find ' item_style du800 ' oru800 ku800 find ' item_value du800 ' then isdeprecated true break endu800 endu800 local retu800   ifu800 isdeprecated then retu800 retu800 .. ' u8d8b1u8d8afu8d987 u8d8a7u8d984u8daafu8d988 u8d987u8d985u8d8b1u8d8a7u8d987 u8d9beu8d8a7u8d8b1u8d8a7u8d985u8d8aau8d8b1u8d987u8d8a7u8db8c u8d8a8u8d8afu8d8afu8d8a7u8d986u8d8b3u8d8aau8d987 ' endu800 return retu800 endu800 function pu800u82emakelist listtype args ifu800 notu800 listtype oru800 notu800 listtypes listtype then error stringu82eformat "u8d8a2u8d8b1u8daafu8d988u8d985u8d8a7u8d986 u8d8a8u8d8af #1u800 u8d8a8u8d8b1u8d8a7u8db8c u8c2abmakelistu8c2bb u8c2ab su8c2bb u8d986u8d988u8d8b9 u8d981u8d987u8d8b1u8d8b3u8d8aa u8d985u8d8b9u8d8aau8d8a8u8d8b1 u8d986u8d985u8db8cu8e2808cu8d8a8u8d8a7u8d8b4u8d8af " tostring listtype 2u800 endu800 checktype 'makelist' 2u800 args 'table' local data pu800u82emakelistdata listtype args local list pu800u82erenderlist data local trackingcategories pu800u82erendertrackingcategories args return list .. trackingcategories endu800 foru800 listtype inu800 pairs listtypes dou800 pu800 listtype function frame local marguments require 'module arguments local origargs margumentsu82egetargs frame valuefunc function keyu800 value ifu800 notu800 value oru800 notu800 mwu800u82eustringu82efind value ' su800' then return nilu800 endu800 ifu800 mwu800u82eustringu82efind value ' su800* *#; ' then return value else return value match ' su800* . su800* ' endu800 return nilu800 endu800 copy allu800 theu800 arguments tou800 au800 newu800 table foru800 faster indexing. local args foru800 ku800 vu800 inu800 pairs origargs dou800 args ku800 vu800 endu800 return pu800u82emakelist listtype args endu800 endu800 return pu800 