Module:Distinguish
Jump to navigation
Jump to search
Documentation
This is a helper module for Template:Distinguish.
return {
distinguish = function ( frame )
local template = frame.args[1]
local args = frame:getParent().args
local noDlcIcon = args.noDlcIcon or ''
local links = {}
for _, value in ipairs( args ) do
local text = mw.text.trim( value )
if #text > 0 then
links[#links + 1] = frame:expandTemplate{
title = template,
args = { text, noDlcIcon = noDlcIcon }
}
end
end
if args[2] ~= nil and args[3] == nil then
return mw.text.listToText( links, ', ', ' or ' )
else
return mw.text.listToText( links, ', ', ', or ' )
end
end
}