Module:Bold list: Difference between revisions
en>PerfectSoundWhatever (Written by User:Ahecht in response to a thread at WP:VPI) |
en>Ahecht (frame.args→frame:getParent().args) |
||
Line 2: | Line 2: | ||
return { main = function(frame) | return { main = function(frame) | ||
args = {} | args = {} | ||
for i, v in ipairs(frame.args) do table.insert(args, v) end | for i, v in ipairs(frame:getParent().args) do table.insert(args, v) end | ||
conj = "'''" .. (#args > 2 and ", " or " ") .. (args.conj or "or") .. " '''" | conj = "'''" .. (#args > 2 and ", " or " ") .. (args.conj or "or") .. " '''" | ||
return "'''"..mw.text.listToText(args, "''', '''", conj).."'''" | return "'''"..mw.text.listToText(args, "''', '''", conj).."'''" | ||
end } | end } |
Revision as of 20:20, 25 April 2022
Documentation for this module may be created at Module:Bold list/doc
-- Written by User:Ahecht in response to a thread at [[WP:VPI]]
return { main = function(frame)
args = {}
for i, v in ipairs(frame:getParent().args) do table.insert(args, v) end
conj = "'''" .. (#args > 2 and ", " or " ") .. (args.conj or "or") .. " '''"
return "'''"..mw.text.listToText(args, "''', '''", conj).."'''"
end }