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 Lua Scribunto beschikbaar.
-- This submodule checks all the values in the parameters of the call to the module Layout. -- It will warn the user if any mistakes are made.localfrisk={};-- Private variableslocalprotocol={};functionfrisk.collection(call)returnprotocol.pagelist(call,"collection");end-- This function checks the color parameterfunctionfrisk.color(call)-- The functions from other modules that are used in this functionlocaltext,color=call.include("text","color");localcolors=text.split(call.color);if#colors>3ornotcolor.valid(colors)thenreturncall.message.MISTAKE.WRONG.COLOR,tostring(call.color),tostring(call.color),call.style.BLUE,call.style.ORANGE,call.style.PURPLE;endreturnfalse;endfunctionfrisk.definition(call)returnfalse;endfunctionfrisk.description(call)returnfalse;end-- format is a reseverd function only for string so we can use it safelyfunctionfrisk.format(call)returnprotocol.enum(call,"format");endfunctionfrisk.object(call)returnprotocol.enum(call,"object");endfunctionfrisk.orientation(call)returnprotocol.enum(call,"orientation");endfunctionfrisk.part(call)returnprotocol.pagelist(call,"part");end-- Convert if the progress is correct into an integer or to 0 if an mistake occured.functionfrisk.progress(call)ifcall.progress==falsethenreturnfalse;end-- The functions from other modules that are used in this functionlocaltext=call.include("text");localprogress=text.trim(tostring(call.progress));ifstring.sub(progress,-1)=="%"thenprogress=string.sub(progress,1,-2)endprogress=tonumber(progress);ifprogress==nilorprogress<0orprogress>100thenreturncall.message.MISTAKE.WRONG.PROGRESS,call.progress,call.progress;endreturnfalse;endfunctionfrisk.reference(call)returnfalse;endfunctionfrisk.source(call)returnfalse;endfunctionfrisk.support(call)returnprotocol.enum(call,"support");endfunctionfrisk.title(call)returnfalse;end-- This function checks parameters that are restricted by "enumeration" ( "enum" )-- and only are allowed to take one of the predefined values.functionprotocol.enum(call,parameter)-- The functions from other modules that are used in this functionlocaltext,array=call.include("text","array");-- If the parameter is defaulted then no frisk is needed.ifnotcall.named[parameter]orcall.named[parameter]==""thenreturnfalse;endifnotcall[parameter]andcall.message.HOOK[string.upper(parameter)]~=nilthenreturncall.message.MISTAKE.WRONG[string.upper(parameter)],text.capitalize_first(call.named[parameter]),call.named[parameter],table.concat(call.message.HOOK[string.upper(parameter)],", ");endreturnfalse;end-- This function checks if a string containing a list of wikipages is correctfunctionprotocol.pagelist(call,parameter)-- The functions from other modules that are used in this functionlocaltext,valid=call.include("text","validation");localsplit=text.split(call[parameter]);for_,valueinipairs(split)doifnotvalid.title(value)thenreturncall.message.MISTAKE.WRONG.PAGENAMELIST,value,text.capitalize_first(parameter),pagestring;endendreturnfalse;endreturnfrisk;