 this module implements catu800 main . local mhatnote require 'module hatnote' local yesno require 'module yesno' local mtabletools lazily initialise local marguments lazily initialise local pu800 function pu800u82ecatmain frame mtabletools require 'module tabletools marguments require 'module arguments local args margumentsu82egetargs frame wrappers 'u8d8a7u8d984u8daafu8d988 u8d8a7u8d8b5u8d984u8db8c u8d8b1u8d8afu8d987' local pages mtabletoolsu82ecompresssparsearray args local options article argsu82earticle selfref argsu82eselfref return pu800u82e_catmain options unpack pages endu800 function pu800u82e_catmain options ... options options oru800 getu800 theu800 links table. local links mhatnoteu82eformatpages ... ifu800 notu800 links 1u800 then local page mwu800u82etitleu82egetcurrenttitle .text links 1u800 mhatnoteu82e_formatlink page endu800 foru800 iu800 link inu800 ipairs links dou800 links iu800 stringu82eformat "  su800 " link endu800 getu800 theu800 pagetype. local pagetype ifu800 yesno optionsu82earticle false then pagetype 'u8d985u8d982u8d8a7u8d984u8d987' else pagetype 'u8d8b5u8d981u8d8adu8d987' endu800 work outu800 whether weu800 need tou800 beu800 singular oru800 plural. local stringtoformat ifu800 #links 1u800 then stringtoformat ' su8e2808cu8d987u8d8a7u8db8c u8d8a7u8d8b5u8d984u8db8c u8d8a7u8db8cu8d986 u8d8b1u8d8a7u8d987u8d986u8d985u8d8a7 u8d8b1u8d8afu8d987 u8d8b1u8d8afu8d987 su800 u8d987u8d8b3u8d8aau8d986u8d8af.' else stringtoformat ' su8d994 u8d8a7u8d8b5u8d984u8db8c u8d8a7u8db8cu8d986 u8d8b1u8d8a7u8d987u8d986u8d985u8d8a7 u8d8b1u8d8afu8d987 u8d8b1u8d8afu8d987 su800 u8d8a7u8d8b3u8d8aa.' endu800 getu800 theu800 text. local text stringu82eformat stringtoformat pagetype mwu800u82etextu82elisttotext links pass itu800 through tou800 module hatnote. local hnoptions hnoptionsu82eselfref optionsu82eselfref hnoptionsu82eextraclasses 'relarticle mainarticle' return mhatnoteu82e_hatnote text hnoptions endu800 return pu800 