Module:Crew

local util_link = require('Module:LinkUtil') local util_text = require('Module:TextUtil') local p = {} --p stands for package -- local h = {} --h stands for helper (not currently needed)

function p.generateCredit(frame) local parentFrame = frame:getParent local args = frame.args local parentArgs = parentFrame.args local outputString = "" local credit = util_text.titleCase(args["credit"]) local varname = args["varname"] or args["credit"] if parentArgs[varname] then outputString = "" .. util_link.stripDab(credit) .. " - " .. util_link.stripDab(parentArgs[varname]) .. "" local done = false local count = 2 while not done do if parentArgs[varname .. tostring(count)] then outputString = outputString .. ", " .. util_link.stripDab(parentArgs[varname .. tostring(count)]) .. "" count = count + 1 else done = true end end end return outputString end

return p