local archiveList = require('Module:Archive list')
-- A table of the archives to display.local archives =
-- Gets wikitable rows filled with archive links, using-- .local function getLinks(funcArgs) if type(funcArgs) ~= 'table' then error('Invalid input to getLinks', 2) end funcArgs.sep = '\n| ' funcArgs.linesep = '\n|-\n| ' return mw.ustring.format('|-\n| %s', archiveList.main(funcArgs))end
-- Returns a Lua table with value being a list of archive links-- for one of the noticeboards listed in the archives table-- at the top of the module.local function getLinksTable(all) local t = for board, archive in pairs(archives) do local funcArgs = archive if not all then local archiveMax = archiveList.count(funcArgs) if type(archiveMax)
-- Build the wikitable using mw.ustring.format.local function buildWikitable(args) local t = getLinksTable(args.all) local frame = mw.getCurrentFrame
-- The navbar needs to be preprocessed before it can be put into -- mw.ustring.format. local navbar = frame:preprocess("") -- The following are defined here for convenience, as they recur frequently -- in the wikitable. local headerStyle = 'style="font-size: 111%; line-height: 1.25em;" colspan="10"' local openSpan = '
' local closeSpan = '' local searchLink = "search" -- The inputbox plus header. We define it here as it is optional. local inputbox = if args.search]) end return mw.ustring.format([==[ <div style="float: right; clear: right; margin: 0 0 1em 1em; text-align: right"> <span style="float: left">'''Noticeboard archives'''</span> %s {| class="navbox noprint" style="font-size:88%%; line-height:1.2em; margin:0; width:auto; text-align:center" |- ! %s | [[Wikipedia:Edit filter noticeboard|Edit filter]] %s(archives, %s)%s%s%s|-! %s |Other links|-|colspan="10" class="hlist" style="text-align: center;"|
|}
function makeWrapper(all) return function(frame) -- If we are being called from #invoke, get the args from #invoke -- if they exist, or else get the arguments passed to the parent -- frame. Otherwise, assume the arguments are being passed directly -- in from another module or from the debug console. local origArgs if frame