Content deleted Content added
test |
test |
||
(24 intermediate revisions by the same user not shown) | |||
Line 1:
local p = {}
function p.main(frame)
local output = {}
Line 8 ⟶ 11:
output[2] = ''
end
output[3] = '
if frame.args[1] then
output[4] = frame.args[1]
Line 28 ⟶ 31:
end
local thisframe = mw.getCurrentFrame()
if thisframe then
output[8] = "<br />mw.getCurrentFrame():getTitle(): "
output[9] = thisframe:getTitle()
thisframe = thisframe:getParent()
if thisframe then
output[10] = "<br />mw.getCurrentFrame():getParent():getTitle(): "
output[11] = thisframe:getTitle()
thisframe = thisframe:getParent()
output[12] = "<br />mw.getCurrentFrame():getParent():getParent():getTitle(): "
output[13] = thisframe:getTitle()
end▼
end▼
end▼
return table.concat(output)
end
function p.
local boolean = (frame.args.boolean or frame:getParent().args.boolean) == 'true'
▲ local args = {[0]={}}
if type(s) == 'string' and mw.getContentLanguage():parseFormattedNumber( s ) then
▲ for k,v in pairs(frame:getParent().args) do
return boolean and 1 or s
▲ if not args[loc] then
args[loc] = {}▼
▲ end
▲ end
end
return boolean and 0 or ''
for k, v in pairs(args[0]) do▼
table.insert(output, "| " .. k .. " = " .. v)▼
▲ end
function error(frame, key)
return "Error! Missing function " .. key
metatable = {['__index'] = error}
setmetatable(p, metatable)
▲ end
function p.dots()
return dots
end
function p.prefix(frame)
if k ~= '_prefix' and k ~= '_template' then
end
end
return table.
end
return setmetatable(p, {__index =
function(_, key) -- this anonymous function called as function(TABLE, KEY)
return function (frame) return error (frame, key) end; -- which in turn returns a function that calls cite() with the KEY name
end
})
|