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.
localcontent={}functioncontent.main(call)localarray,extract,text=call.include("array","extract","text");-- Extend the call variable with messages that are specific to the type of the objects book includescall.message.PROGRESS=call.include(call.language_path.."/Progress");call.content={};call.content.wikipedia=false;call.content.wikijunior=false;ifcall.referencethenifarray.search(call.reference,"wikipedia")thencall.message.WIKIPEDIA=call.include(call.language_path.."/Wikipedia");call.content.wikipedia=true;endifarray.search(call.reference,"wikijunior")thencall.message.WIKIJUNIOR=call.include(call.language_path.."/Wikijunior");call.content.wikijunior=true;endif(call.title==nilortype(call.title)~='string'orcall.title=="")thencall.title=call.caller;endendcall.content.book={}localtext_strings={}fori,sinipairs(call.unnamed)doifsands~=""thentable.insert(text_strings,text.trim(s))endendcall.content.text=text_stringscall.content.bookshelf={};call.content.bookshelf.image="";call.content.bookshelf.link="";call.content.bookshelf.book={};localbookshelf_name=call.message.OBJECT.BOOKSHELF;ifcall.collection[1]thencall.content.bookshelf.link=text.trim(call.collection[1]);localwiki_bookshelf=mw.title.new(bookshelf_name..":"..call.content.bookshelf.link);ifwiki_bookshelfthenlocalsource_parameters=extract.parameter(wiki_bookshelf:getContent(),call.message.TEMPLATENAME,call.message.PARAM.SOURCE,call);ifsource_parametersandsource_parameters[1]and#source_parameters[1]>0thencall.content.bookshelf.image=mw.ustring.format('[[image:%s|30px]] ',source_parameters[1])endlocalcollection_parameters=extract.parameter(wiki_bookshelf:getContent(),call.message.TEMPLATENAME,call.message.PARAM.COLLECTION,call);ifcollection_parametersandcollection_parameters[1]thencall.content.bookshelf.link=mw.ustring.format('[[%s:%s|%s]]',bookshelf_name,collection_parameters[1],call.content.bookshelf.link);endlocaltitle_parameters=extract.parameter(wiki_bookshelf:getContent(),call.message.TEMPLATENAME,call.message.PARAM.TITLE,call);iftitle_parametersandtitle_parameters[1]thencall.content.bookshelf.link=mw.ustring.format('[[%s:%s|%s]]',bookshelf_name,collection_parameters[1],title_parameters[1]);endlocalpart_parameters=extract.parameter(wiki_bookshelf:getContent(),call.message.TEMPLATENAME,call.message.PARAM.PART,call);ifpart_parametersandpart_parameters[1]thenlocalparts=text.split(part_parameters[1],true);fori,bookinipairs(parts)doifbookandbook~=""thentable.insert(call.content.bookshelf.book,extract.book_progress(book,call));endendendendendcall.content.max_number_of_book_title_lines=0call.content.max_number_of_book_chapters=0fori,bookinipairs(call.part)doifbookandbook~=""thenbook=mw.text.trim(book)localbook_title_lines=select(2,book:gsub('­',''))+1ifbook_title_lines>call.content.max_number_of_book_title_linesthencall.content.max_number_of_book_title_lines=book_title_linesendlocalformatted_book=book:gsub(" ­","­")formatted_book=formatted_book:gsub("­ ","­")formatted_book=formatted_book:gsub(" "," ")formatted_book=formatted_book:gsub("­","<br>")book=book:gsub("­","")localnew_book={}new_book.name=booknew_book.number=inew_book.caption='Boek'new_book.subelements={}localcurrentPageTitle=mw.title.getCurrentTitle().prefixedText;localbook_text=mw.ustring.format('[[%s|%s]]',book,formatted_book)localwiki_book=mw.title.new(book)ifwiki_bookthenbook_text=mw.ustring.format('[[%s|%s]]',wiki_book.prefixedText,formatted_book)localpart_parameters=extract.parameter(wiki_book:getContent(),call.message.TEMPLATENAME,call.message.PARAM.PART,call)ifpart_parametersandpart_parameters[1]thenlocalsubelements=text.split(part_parameters[1],true);new_book.subelements={};fori,subelementinipairs(subelements)donew_book.subelements[i]=mw.ustring.format('[[%s/%s|%s]]',wiki_book.prefixedText,subelement:gsub("­",""),subelement)endlocalaantal_chapters=#new_book.subelementsifaantal_chapters>call.content.max_number_of_book_chaptersthencall.content.max_number_of_book_chapters=aantal_chaptersendendendnew_book.text=book_text;new_book.button=call.message.BUTTON.READ;ifwiki_bookthennew_book.button=mw.ustring.format('[[%s|%s]]',wiki_book.prefixedText,new_book.button);endtable.insert(call.content.book,new_book);endendreturncall;endreturncontent;