Module:Crew

local util_link = require('Module:LinkUtil') local p = {} --p stands for package local h = {} --h stands for helper

function h.generateCredit(frame, credit, num, varname) local outputString = "{{#if:{{{" .. varname .. "|}}}|" .. util_link.stripDab(credit) .. " - {{{" .. varname .. "}}}"	if count ~= 1 then for count = 2, num do outputString = outputString .. "{{#if:{{{" .. varname .. count .. "|}}}|, {{{" .. varname .. count .. "}}}"		end end for count = 1, num do outputString = outputString .. "|}}"	end return frame:preprocess(outputString) end

function p.generateCredit(frame) local frame = frame:getParent local args = frame.args if not args.varname then args.varname = args.credit end if not args.num then args.num = 1 end return h.generateCredit(frame, args.credit, args.num, args.varname) end

return p