Module:Parameters/sandbox: Difference between revisions

Content deleted Content added
fix _flatcode
test
 
(2 intermediate revisions by the same user not shown)
Line 68:
 
function p._check(args)
local title = args._basebase or mw.title.getCurrentTitle().fullText
return string.format(
'{{#invoke:Check for unknown parameters|check|unknown=' ..
Line 91:
end
 
local title = args._basebase or mw.title.getCurrentTitle().baseText
return string.format([[ <nowiki>{{%s
%s}}</nowiki>]], title, strMap(parameters,
Line 105:
 
function p._flatcode(args)
local definitions = yesno(args.definitions)
local parameters = extractParams(args.base)
local title = args._basebase 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)
if definitions then
return string.format(' |%s{{=}}<var>%s</var>', s,
DEFINITIONS[s] and DEFINITIONS[s].dlist or s)
else
return string.format(' |%s{{=}} ', s)
end
end)
)
Line 177 ⟶ 171:
 
function p._demo(args)
local title = args._basebase and ('|_template=' .. args._basebase) or ''
return string.format('{{Parameter names example%s|%s}}', title,
table.concat(extractParams(args.base), '|'))