Module:Layout


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.
De module wordt geïnitialiseerd met de configuratie in Module:Layout/Configuration.
De module Layout werkt nauw samen met het sjabloon Opmaak. Directe benadering door gebruikers van deze module wordt dan ook ontraden en ook tegengehouden waar mogelijk. Voor het gebruik van de module verwijzen we daarom naar de sjabloonbeschrijving van het sjabloon Opmaak.
Opbouw
Deze module is gebouwd om via een interface de aanroeper door te sturen naar specifieke functionaliteit behorende bij het type Opmaak gegroepeerd onder Module:Layout/System. Onder Module:Layout/Test zijn alle testfuncties gebundeld. De library Module:Layout/Library heeft verzameld alle functies die door meerdere modules worden gebruikt en niet het frame object als input hebben. Alle instellingen zoals de berichten en de structuur van deze module zijn ondergebracht bij Module:Layout/Configuration. Ook is er een ontwikkelomgeving ingericht onder Module:Layout/Sandbox. Samengevat:
- Module:Layout/System ; modules die in productie zijn.
- Module:Layout/Test ; modules die testen.
- Module:Layout/Sandbox ; modules die in ontwikkeling zijn.
- Module:Layout/Interface ; modules die de communicatie tussen de aanroepende wikipagina en de module Layout afhandelen.
- Module:Layout/Library ; modules die bouwstenen vormen voor de systeem modules.
- Module:Layout/Configuration; modules die de werking van andere modules configureren.
- Module:Layout/Language ; modules die in de taal van de gebruiker communiceren.
Aanroep
De interface van de module vindt men onderin de code en gebeurt via de aanroep {{#invoke:Layout|main|...}} en dan kiest of de gebruiker of het systeem zelf op grond van pagina-eigenschappen welke type pagina het is.
Subpagina's
- Layout/Book series
- Layout/CSS/test.css
- Layout/Configuration
- Layout/Configuration/Check
- Layout/Configuration/Check/doc
- Layout/Configuration/Default
- Layout/Configuration/Default/doc
- Layout/Configuration/Error
- Layout/Configuration/Error/doc
- Layout/Configuration/Load
- Layout/Configuration/Load/doc
- Layout/Configuration/Location
- Layout/Configuration/Location/doc
- Layout/Configuration/Media
- Layout/Configuration/Media/doc
- Layout/Configuration/Style
- Layout/Configuration/Style/Bee
- Layout/Configuration/Style/Bee/doc
- Layout/Configuration/Testable
- Layout/Configuration/Testable/doc
- Layout/Configuration/Testframe
- Layout/Configuration/doc
- Layout/Deprecated
- Layout/Dev
- Layout/Interface
- Layout/Interface/doc
- Layout/Language
- Layout/Language/EN
- Layout/Language/NL
- Layout/Language/NL/doc
- Layout/Library
- Layout/Library/Box
- Layout/Library/Box/doc
- Layout/Library/Convert
- Layout/Library/Convert/doc
- Layout/Library/ExString
- Layout/Library/ExString/doc
- Layout/Library/ExTable
- Layout/Library/ExTable/doc
- Layout/Library/Extract
- Layout/Library/Extract/doc
- Layout/Library/Heading
- Layout/Library/Heading/doc
- Layout/Library/Mediawiki
- Layout/Library/Mediawiki/doc
- Layout/Library/Pattern
- Layout/Library/Pattern/doc
- Layout/Library/Test
- Layout/Library/Test/doc
- Layout/Library/Validation
- Layout/Library/Validation/doc
- Layout/Library/doc
- Layout/Sandbox
- Layout/Sandbox/doc
- Layout/System
- Layout/System/Age
- Layout/System/Age/doc
- Layout/System/Book
- Layout/System/Book/doc
- Layout/System/Book series
- Layout/System/Book series/doc
- Layout/System/Category
- Layout/System/Category/doc
- Layout/System/Chapter
- Layout/System/Chess
- Layout/System/Chess/doc
- Layout/System/Infobox
- Layout/System/Infobox/doc
- Layout/System/Logo
- Layout/System/Logo/doc
- Layout/System/Module
- Layout/System/Module/doc
- Layout/System/Progress
- Layout/System/Progress/doc
- Layout/System/Talk
- Layout/System/Talk/doc
- Layout/System/Template
- Layout/System/Template/doc
- Layout/System/User
- Layout/System/User/doc
- Layout/System/Wikijunior
- Layout/System/Wikijunior/doc
- Layout/System/Wikipedia
- Layout/System/Wikipedia/doc
- Layout/System/doc
- Layout/Test
- Layout/Test/Box
- Layout/Test/Box/doc
- Layout/Test/Chess
- Layout/Test/Chess/doc
- Layout/Test/Convert
- Layout/Test/Convert/doc
- Layout/Test/Extract
- Layout/Test/Extract/doc
- Layout/Test/Heading/doc
- Layout/Test/Interface
- Layout/Test/Interface/doc
- Layout/Test/Library
- Layout/Test/Library/doc
- Layout/Test/Mediawiki
- Layout/Test/Mediawiki/doc
- Layout/Test/Pattern
- Layout/Test/Pattern/doc
- Layout/Test/System
- Layout/Test/System/doc
- Layout/Test/Testcases
- Layout/Test/Testcases/Corrupted Headings
- Layout/Test/Testcases/Corrupted Headings/doc
- Layout/Test/Testcases/Empty
- Layout/Test/Testcases/Empty/doc
- Layout/Test/Testcases/Empty Page
- Layout/Test/Testcases/Empty Page/doc
- Layout/Test/Testcases/Extract Parameter Multiple Parameters
- Layout/Test/Testcases/Extract Parameter Multiple Parameters/doc
- Layout/Test/Testcases/Extract Parameter Present
- Layout/Test/Testcases/Extract Parameter Present/doc
- Layout/Test/Testcases/Extract Parameter Two Hits
- Layout/Test/Testcases/Extract Parameter Two Hits/doc
- Layout/Test/Testcases/Four
- Layout/Test/Testcases/Four/doc
- Layout/Test/Testcases/One
- Layout/Test/Testcases/One/doc
- Layout/Test/Testcases/Only Text
- Layout/Test/Testcases/Only Text/doc
- Layout/Test/Testcases/Other
- Layout/Test/Testcases/Other/doc
- Layout/Test/Testcases/Ten
- Layout/Test/Testcases/Ten/doc
- Layout/Test/Testcases/doc
- Layout/Test/Validation
- Layout/Test/Validation/doc
- Layout/Test/doc
- Layout/doc
- Layout/private/doc
Tests
In Module:Layout/Test worden de tests gespecificeerd die hieronder zijn uitgevoerd.
System
2 tests mislukt.
Naam | Verwacht | Werkelijk | |
---|---|---|---|
![]() |
test_System_Book | Testing | <div>__NOTOC__</div><div style="border-bottom:1px solid grey">Dit boek is in ontwikkeling. Volg de wijzingen door bij elk hoofdstuk op de ster te klikken of gebruik de toetscombinatie [alt+shift+w]</div><div class="noprint"><span><br>Er bestaat nog geen infobox voor dit boek. Klik [[Wikibooks:Infobox/Layout|hier]] om die aan te maken.<br></span></div>FOUT: De waarde <leeg> van de <b>Bron</b> parameter is niet geldig!<div style="-webkit-border-radius:0% 0% 100% 100% / 0% 0% 8px 8px;text-align:center;-webkit-box-shadow:rgba(0, 0, 0,.30) 0 2px 3px"><div style="border-radius:3px/6px;box-shadow:1px 1px 2px #fff inset, -1px -1px 2px #fff inset;border:1px solid #ccc;margin-top:32px;height:auto;margin-bottom:32px;margin:0 auto;background:#cdd9ee"><b> </b></div></div><div style="margin-bottom:32px;text-align:center;margin-top:16px"><i></i></div><div style="width:100%;border-top:20px solid;border-bottom:20px solid;border-image:linear-gradient(to bottom, transparent, #0645ad, transparent) 20"><div style="text-align:center;color:#0645ad;border-top:20px solid linear-gradient(to bottom, transparent, #0645ad);list-style-type:none;border-bottom:20px solid linear-gradient(to top, transparent, #0645ad)">{{Boekenplank/Onderwijs}}</div></div><div style="margin:0 auto;text-align:center"><div>cSFJSHFJSHKJH</div></div><div style="width:100%;border-top:20px solid;border-bottom:20px solid;border-image:linear-gradient(to bottom, transparent, #0645ad, transparent) 20"><div style="text-align:center;color:#0645ad;border-top:20px solid linear-gradient(to bottom, transparent, #0645ad);list-style-type:none;border-bottom:20px solid linear-gradient(to top, transparent, #0645ad)">{{Opmaak/PrefixIndex|title=Vrij leren}}</div></div>FOUT: De waarde <leeg> van de <b>Definitie</b> parameter is niet geldig!FOUT: De waarde <leeg> van de <b>Definitie</b> parameter is niet geldig! |
![]() |
test_System_Template_usage | Lua error -- Module:Layout/Test/System:19: attempt to call field 'book' (a nil value) |
Library
Box
4 tests mislukt.
Naam | Verwacht | Werkelijk | |
---|---|---|---|
![]() |
test_Box_Logo | Lua error -- Module:Layout/Test/Box:16: attempt to call field 'logo' (a nil value) | |
![]() |
test_Box_Progress | Lua error -- Module:Layout/Test/Box:27: attempt to call field 'progress' (a nil value) | |
![]() |
test_Box_Wikijunior | Lua error -- Module:Layout/Test/Box:34: attempt to call field 'wikijunior' (a nil value) | |
![]() |
test_Box_Wikipedia | Lua error -- Module:Layout/Test/Box:41: attempt to call field 'wikipedia' (a nil value) | |
![]() |
test_Box_Wikiproject |
Chess
Alle tests zijn ok.
Naam | Verwacht | Werkelijk | |
---|---|---|---|
![]() |
test_Library_Chess_rank | ||
![]() |
test_Library_Chess_square | ||
![]() |
test_Library_Chess_square_color |
Convert
Alle tests zijn ok.
Naam | Verwacht | Werkelijk | |
---|---|---|---|
![]() |
test_Library_Convert_date_to_age | ||
![]() |
test_Library_Convert_template_to_table |
Mediawiki
Alle tests zijn ok.
Naam | Verwacht | Werkelijk |
---|
Pattern
Alle tests zijn ok.
Naam | Verwacht | Werkelijk | |
---|---|---|---|
![]() |
test_Library_Pattern_content_after_starting_equal_sign | ||
![]() |
test_Library_Pattern_last_segment_of_url | ||
![]() |
test_Library_Pattern_paramname | ||
![]() |
test_Library_Pattern_paramname_and_paramvalue | ||
![]() |
test_Library_Pattern_paramvalue | ||
![]() |
test_Library_Pattern_remove_last_segment_from_url | ||
![]() |
test_Library_Pattern_remove_template_definition | ||
![]() |
test_Library_Pattern_replace_in_lines_that_start_with_a_character | ||
![]() |
test_Library_Pattern_replace_inner_pipes | ||
![]() |
test_Library_Pattern_split_paramname_from_the_rest | ||
![]() |
test_Library_Pattern_template_definition_at_start_and_end |
Extract
Alle tests zijn ok.
Naam | Verwacht | Werkelijk | |
---|---|---|---|
![]() |
test_Library_Extract_content | ||
![]() |
test_Library_Extract_heading | ||
![]() |
test_Library_Extract_parameter | ||
![]() |
test_Library_Extract_template |
Validation
Alle tests zijn ok.
Naam | Verwacht | Werkelijk | |
---|---|---|---|
![]() |
test_Library_Validation_mediafile | ||
![]() |
test_Library_Validation_text |
Zie ook
- Voor meer informatie over LUA modules zie de de extensie Scribunto.
Code
-- All Scribunto libraries are located in the global table mw.
-- All variables of this module should be explicitly scoped as a local variable.
require( "strict" );
-- The configuration data is stored in the CFG variable
local CFG = require( 'Module:Layout/Configuration' );
-- A call to a module uses the parserfunction {{#invoke:...}} where ... is the modulename. In this case Layout.
-- The return value stores the functions which are given as a first argument ... when using {{#invoke:Layout|...}}
-- The variable layout collects these functions.
local layout = {};
-- Functions called by {{#invoke:}} will be passed a frame object as single parameter.
-- In this module only the main function exists and so this module can only be called by {{{{#invoke:Layout|main|...}}.
-- This Frame-object contains the parameters passed to {{#invoke:}}, and can be used to access context-specific features of the wikitext parser.
-- The interface of the Module:Layout validates the call and redirects it to the correct system for further actions.
local interface = CFG.LOAD.INTERFACE();
-- The {{#invoke:Layout|main|...}} call is checked on errors and if so the errors are returned to inform the user if the user has not turned off showing errors.
-- When no errors are found or the user has set to ignore errors, the corresponding system to the call is invoked.
function layout.main( frame )
local call = interface.call( frame );
local response = interface.no_response();
if ( #call.errors == 0 or call.errorhandling == "ignore" ) then response = interface.system( call ); end
if ( #call.errors > 0 and call.errorhandling == "show" ) then response = interface.help( call ) ; end
return response;
end
-- The module returns a Lua table containing the functions that may be called by {{#invoke:}} stored in the variable layout.
return layout;