 this module produces au800 link tou800 au800 main article oru800 articles. itu800 implements theu800 template main . ifu800 theu800 module isu800 used inu800 category oru800 category talk space itu800 produces "theu800 main article foru800 this category isu800 xxxu800." otherwise itu800 produces "main article xxxu800". local mhatnote require 'module hatnote' local mhatlist require 'module hatnote list' local marguments lazily initialise local pu800 function pu800u82emain frame marguments require 'module arguments local args margumentsu82egetargs frame parentonly true local pages foru800 ku800 vu800 inu800 pairs args dou800 ifu800 type ku800 'number' then local display args 'label ' .. ku800 oru800 args 'lu800' .. ku800 local page display andu800 mwu800u82eustringu82eformat ' su800 su800' mwu800u82eustringu82egsub vu800 ' .* '   display oru800 vu800 pages #pages 1u800 page endu800 endu800 ifu800 #pages 0u800 andu800 mwu800u82etitleu82egetcurrenttitle .namespace 0u800 then return mhatnoteu82emakewikitexterror 'nou800 page names specified' 'template main#errors argsu82ecategory endu800 local options selfref argsu82eselfref return pu800u82e_main pages options endu800 function pu800u82e_main args options getu800 theu800 list ofu800 pages. ifu800 nou800 first page wasu800 specified weu800 useu800 theu800 current page name. local currenttitle mwu800u82etitleu82egetcurrenttitle ifu800 #args 0u800 then args currenttitleu82etext endu800 local firstpage mwu800u82eustringu82egsub args 1u800 ' .* '   find theu800 pagetype. local pagetype mhatnoteu82efindnamespaceid firstpage 0u800 andu800 'u8d985u8d982u8d8a7u8d984u8d987u8d994' oru800 'u8d8b5u8d981u8d8adu8d987u8d994' make theu800 formatted link text list mhatlistu82eandlist args true build theu800 text. local isplural #args 1u800 local mainform local curns currenttitleu82enamespace ifu800 curns 14u800 oru800 curns 15u800 then category talk namespaces mainform isplural andu800 ' su8e2808cu8d987u8d8a7u8db8c u8d8a7u8d8b5u8d984u8db8c u8d8a7u8db8cu8d986 u8d8b1u8d8a7u8d987u8d986u8d985u8d8a7 u8d8b1u8d8afu8d987 u8d8b1u8d8afu8d987 u8d88c su800 u8d987u8d8b3u8d8aau8d986u8d8af.' oru800 ' su800 u8d8a7u8d8b5u8d984u8db8c u8d8a7u8db8cu8d986 u8d8b1u8d8a7u8d987u8d986u8d985u8d8a7 u8d8b1u8d8afu8d987 u8d8b1u8d8afu8d987 u8d88c su800 u8d8a7u8d8b3u8d8aa.' else mainform isplural andu800 ' su800 u8d8a7u8d8b5u8d984u8db8c su800' oru800 ' su800 u8d8a7u8d8b5u8d984u8db8c su800' endu800 local text mwu800u82eustringu82eformat mainform pagetype list process theu800 options andu800 pass theu800 text tou800 theu800 _rellink function inu800 module hatnote . options options oru800 local hnoptions selfref optionsu82eselfref return mhatnoteu82e_hatnote text hnoptions endu800 return pu800 