Module:Card/Maintenance

-- Libraries of functions --

-- stands for High Frequency local HF = require('Module:HF') -- Parses invocation and template parameters, trims whitespace, and removes blanks. local getArgs = require('Dev:Arguments').getArgs -- Parses template parameters, trims whitespace, and removes blanks. --_G.t = getArgs(frame, { trim = true, removeBlanks = true, parentOnly = true }) -- Gives the name of the current page. It's expensive, so we only do it once. -- The _G then makes it global, available to all page functions. --_G.page_title = mw.title.getCurrentTitle.text --_G.pagename = HF.NP(page_title)

-- Operation data --

local categories = { [t['name'] or false] = "Hello, Maintenance.",-- HF.Category('Card table parameter tracking (name)'), [(t['name'] and t['name'] == pagename) or false] = HF.Category('Pages with an unnecessary name parameter'), [(t['name'] and t['name']:match(' ')) or false] = HF.Category('Pages with superscript in name parameter'), [t['cardgame'] or false] = HF.Category('Card table parameter tracking (cardgame)'), [(t['cardgame'] and t['cardgame'] == pagename) or false] = HF.Category('Pages with an unnecessary cardgame parameter'), [t['image'] and t['image']:match('-VG.') or false] = HF.Category('((CardTable2)) transclusions using video game images'), [t['image'] and t['image']:match('VG-') or false] = HF.Category('((CardTable2)) transclusions using video game images'), [t['image'] and (t['image']:match('VG-') and (not t['image']:match('-VG-'))) or false] = HF.Category('((CardTable2)) transclusions needing renamed images'), [t['image'] and t['image']:match('-OW.') or false] = HF.Category('((CardTable2)) transclusions using OW images'), [t['image'] and t['image']:match('-Sample') or false] = HF.Category('((CardTable2)) transclusions using sample images'), [t['image'] and t['image']:match('-Back') or false] = HF.Category('((CardTable2)) transclusions using card backings'), }

local semantic_props = { } -- -- Public functions (called from a Template or article) -- -- local maintenance = { --   ['categories'] = categories, }

function maintenance.run (frame) return categories:add(t) end

-- Internal functions (used in this and other Modules --

function categories:add( t ) local o = { } for condition, result in pairs( self ) do       if condition ~= false and type(result) == 'string' then table.insert(o, result) end end return table.concat( o ) end

return maintenance