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 module checks, converts and adds an inventory to the parameters.localinventory={};functioninventory.collection(call)localtext=call.include("text");returntext.split(call.collection);endfunctioninventory.color(call)-- The functions from other modules that are used in this functionlocalconvert,text,color=call.include("convert","text","color");-- If a user did not set any of all the three needed colors then we use the default oneslocaldefault_colors={call.style.BLUE,call.style.ORANGE,call.style.PURPLE};localcolors={};ifnotcall.colorthencolors=default_colors;elsecolors=text.split(call.color);end-- Extend the call.color parameter from hex code with rgb code, shades and tints for each of the three colorslocalnew_color={};forindex,valueinipairs(default_colors)doifcolors[index]thencolors[index]=text.trim(colors[index]);-- If the color is set we use it in stead of the default colorifcolors[index]~=""thenifstring.sub(colors[index],1,1)~="#"thenvalue="#"..colors[index];elsevalue=colors[index];endendendlocalr,g,b=convert.hex_to_rgb(value:sub(2));new_color[index]={};new_color[index].hex=value;new_color[index].rgb={r,g,b};new_color[index].shades=color.shades(r,g,b,call.tones);new_color[index].tints=color.tints(r,g,b,call.tones);endreturnnew_color;endfunctioninventory.object(call)-- The functions from other modules that are used in this functionlocalarray,text=call.include("array","text");-- If the object parameter is not set, check if it is the first unnamed parameterif(notcall.object)and(call.unnamed[1]~=nil)andarray.search(call.message.HOOK.OBJECT,text.capitalize_first(call.unnamed[1]))then-- Convert the value of the first unnamed parameter in the installed language to the internal versions and set caal.object with itcall.object=call.hook.OBJECT[array.search(call.message.HOOK.OBJECT,text.capitalize_first(call.unnamed[1]))];-- Because the first unnamed parameter is in fact the object parameter, it should be removed from the unnamed parameter array.table.remove(call.unnamed,1);endifnotcall.objectthenlocaltitle=mw.title.getCurrentTitle();if(title.nsText=="Module")thencall.object="module"elseif(title.nsText=="Sjabloon")thencall.object="template"elseif(title.isContentPageandtitle.isSubpage)thencall.object="chapter"elsecall.object="book";endendreturncall.object;endfunctioninventory.orientation(call)ifcall.object=="chess"andnotcall.orientationthenlocalrank=nil;fori,vinipairs(call.unnamed)dolocalranknumber=tonumber(v);ifrank==nilandranknumber~=nilandranknumber>=1andranknumber<=8thenrank=ranknumber;endendifrank==1thencall.orientation="black";elsecall.orientation="white";endendreturncall.orientation;endfunctioninventory.part(call)localtext=call.include("text");returntext.split(call.part);end-- Convert the progress into an integer.functioninventory.progress(call)-- The functions from other modules that are used in this functionlocaltext=call.include("text");call.progress=text.trim(tostring(call.progress));ifstring.sub(call.progress,-1)=="%"thencall.progress=string.sub(call.progress,1,-2)endreturntonumber(call.progress);endfunctioninventory.reference(call)localtext=call.include("text");returntext.split(call.reference,true);endfunctioninventory.support(call)ifnotcall.supportthencall.support="ignore";endreturncall.support;endreturninventory;