Module:Layout/Production/Library/Box

Uit Wikibooks
 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.

Controleer op scriptfouten of opmaak notificaties.

Tests

Deze functionaliteit wordt getest in Module:Layout/Test/Box:

N 5 tests mislukt.

NameExpectedActual
Ntest_Box_Logo/nilLua error -- Module:Layout/Production/Test/Box:18: attempt to call field 'logo' (a nil value)
Ntest_Box_Progress/nilLua error -- Module:Layout/Production/Test/Box:29: attempt to call field 'progress' (a nil value)
Ntest_Box_Wikijunior/nilLua error -- Module:Layout/Production/Test/Box:36: attempt to call field 'wikijunior' (a nil value)
Ntest_Box_Wikipedia/nilLua error -- Module:Layout/Production/Test/Box:43: attempt to call field 'wikipedia' (a nil value)
Ntest_Box_Wikiproject/nilLua 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;
Informatie afkomstig van https://nl.wikibooks.org Wikibooks NL.
Wikibooks NL is onderdeel van de wikimediafoundation.