Module:Layout/Production/Library/Box
Uiterlijk
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.
De module wordt geïnitialiseerd met de configuratie in Module:Layout/Production/Configuration.
Tests
Deze functionaliteit wordt getest in Module:Layout/Test/Box:
5 tests mislukt.
Name | Expected | Actual | |
---|---|---|---|
test_Box_Logo/nil | Lua error -- Module:Layout/Production/Test/Box:18: attempt to call field 'logo' (a nil value) | ||
test_Box_Progress/nil | Lua error -- Module:Layout/Production/Test/Box:29: attempt to call field 'progress' (a nil value) | ||
test_Box_Wikijunior/nil | Lua error -- Module:Layout/Production/Test/Box:36: attempt to call field 'wikijunior' (a nil value) | ||
test_Box_Wikipedia/nil | Lua error -- Module:Layout/Production/Test/Box:43: attempt to call field 'wikipedia' (a nil value) | ||
test_Box_Wikiproject/nil | Lua error -- Module:Layout/Production/Library/Box:4: variable 'CFG' is not declared |
local box = {};
function box.wikiproject( wiki )
if ( wiki == nil or type( wiki ) ~= 'string' or wiki == "" ) then return string.format( CFG.ERROR.NO_CORRECT_DEFINITION_PARAMETER, "<leeg>" ); end
local wrapper_wikiproject = mw.html.create('div');
wrapper_wikiproject:addClass('toccolours');
wrapper_wikiproject:css({
width = '99%',
clear = 'both',
margin = '1em 0px -0.5em 0px',
});
local wikiproject = mw.html.create('div');
wikiproject:wikitext( wiki );
wrapper_wikiproject:node( wikiproject );
wrapper_wikiproject:allDone();
return tostring( wrapper_wikiproject );
end
return box;