ARK: Survival Evolved Wiki
Advertisement
Template-info Documentation

This is a helper module for Template:Distinguish.


local p = {}

function p.distinguish(frame)
    local template = frame.args[1]
    local args = frame:getParent().args
    local noDlcIcon = args.noDlcIcon or ''
    local links = {}
    for i, v in ipairs(args) do 
        local s = trim(args[i])
        if #s > 0 then
            table.insert(links, frame:expandTemplate{title = template, args = { s, noDlcIcon = noDlcIcon } })
        end
    end
    
    return mw.text.listToText( links, ', ', ', or ' )
end

function trim(s)
   return (s:gsub("^%s*(.-)%s*$", "%1"))
end

return p
Advertisement