Content deleted Content added
m sync with live version |
test |
||
(6 intermediate revisions by the same user not shown) | |||
Line 68:
function p._check(args)
local title = args.
return string.format(
'{{#invoke:Check for unknown parameters|check|unknown=' ..
Line 91:
end
local title = args.
return string.format([[ <nowiki>{{%s
%s}}</nowiki>]], title, strMap(parameters,
function(s)
if definitions then
Line 102:
end
end))
end
function p._flatcode(args)
local parameters = extractParams(args.base)
local title = args.base or mw.title.getCurrentTitle().baseText
return string.format(' {{tlp|%s%s}}', title, strMap(parameters,
function(s)
return string.format(' |%s{{=}}<var>%s</var> ', s, s)
end)
)
end
Line 161 ⟶ 171:
function p._demo(args)
local title = args.
return string.format('{{Parameter names example%s|%s}}', title,
table.concat(extractParams(args.base), '|'))
Line 168 ⟶ 178:
function p._dlist(args)
local definitions = yesno(args.definitions, true)
local defFormat = '; %s: %s\n'
local nonDefFormat = '; %s: \n'
if args._para then
defFormat = '; {{para|%s}}: %s\n'
nonDefFormat = '; {{para|%s}}: \n'
end
return strMap(extractParams(args.base),
function(s)
if definitions then
return string.format(
DEFINITIONS[s] and DEFINITIONS[s].dlist or '')
else
return string.format(
end
end)
end
function p._dlistpara(args)
args._para = true
return p._dlist(args)
end
Line 183 ⟶ 204:
function(s) return string.format('* %s\n', s) end)
end
p.check = makeInvokeFunction('_check')
p.code = makeInvokeFunction('_code')
p.flatcode = makeInvokeFunction('_flatcode')
p.compare = makeInvokeFunction('_compare')
p.demo = makeInvokeFunction('_demo')
p.dlist = makeInvokeFunction('_dlist')
p.dlistpara = makeInvokeFunction('_dlistpara')
p.list = makeInvokeFunction('_list')
|