Deze module is nog in ontwikkeling (versie 0.0) en wordt getest.
De Module:Layout is bedoeld om snel, consistent en uitgebreid een pagina op te maken.
Er is een op de module afgestemde handleiding over deze onderwijswiki beschikbaar.
localvalid={}-- Only allow 6-digit hexadecimal color codesfunctionvalid.color(hexcode)-- string.match( hexcode, "^#(%x%x%x)$" ) is also correct for colorcodes but not in this moduleifstring.match(hexcode,"^#(%x%x%x%x%x%x)$")thenreturntrue;endreturnfalse;endfunctionvalid.mediafile(logo)ifnotvalid.text(logo)thenreturnfalse;endlocalfile_extension=logo:match('^.+%.(%a+)$');ifnotvalid.text(file_extension)thenreturnfalse;endfile_extension=string.lower(file_extension);iffile_extension=='jpg'orfile_extension=='jpeg'orfile_extension=='png'orfile_extension=='gif'orfile_extension=='svg'orfile_extension=='ogg'orfile_extension=='webm'thenreturntrue;endreturnfalse;end-- Check if pagename fulfills the rules for a page title as described on https://www.mediawiki.org/wiki/Manual:Page_titlefunctionvalid.title(pagename)-- :booleanifnotpagenameortype(pagename)~="string"orpagename==""orstring.sub(pagename,1,1)==":"thenreturnfalse;end-- Enhance strict rules on pagename beyond that of title.new will allow.localspecial_characters={",","#","(",")",".","+","&"};fori=1,#special_charactersdoifstring.find(pagename,"%"..special_characters[i])~=nilthenreturnfalse;endendlocaltitle=mw.title.new(pagename);iftitle==nilthenreturnfalse;endreturntrue;endreturnvalid;