Module:Sandbox/Sameboat/m1: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
local getArgs = require('Module:Arguments').getArgs
local p = {}
 
local function p.linkmakeInvokeFunction(framefuncName)
-- makes a function that can be returned from #invoke, using
local pframe = frame:getParent()
-- [[Module:Arguments]].
local config = frame.args -- arguments from the template definition
return function (frame)
local args = pframe.args -- arguments from the page calling the template
local fargs = getArgs(frame.args[1], {parentOnly = true})
return p[funcName](args)
if not f then f = 1 end
end
for i = 5, 11, 0.5 do
f=tonumber(f)*i
return i .. "," .. f
end
 
local p = {}
 
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 = style['r2'] end
return row
end