local getArgs = require('Module:Arguments').getArgs
local p = {}
local function makeInvokeFunction(funcName)
-- makes a function that can be returned from #invoke, using
-- [[Module:Arguments]].
return function (frame)
local args = getArgs(frame, {parentOnly = true})
return p[funcName](args)
end
end
local styles = {
['r1'] = '\n|-\n!style="background:#000;color:#fff;"|',
['r2'] = '\n!style="background:#000;color:#fff;"|',
}
p.row = makeInvokeFunction('_row')
function p._row(args)
local row = args[1] or args.row
if row == '1' then row = styles['r1'] else row = styles['r2'] end
return row
end
return p