Module:Gallery

local p = {} function p.create(f) local args, filename, filetype, output = f:getParent.args, "", "", {} mw.log(args) for k, v in pairs(args) do       mw.log("---") mw.log(k) mw.log(v) if type(k) == "number" and (not args.dynamic or k % 2 == 1) then filename, filetype = mw.text.trim(v), mw.text.trim(tostring(args[k + 1] or "")) output[k] = (args.prefix or "") .. filename .. "." .. (args.dynamic and filetype or args.gif and "gif" or "png") .. "|link=" .. (args.noimagelink and "" or filename).. "|" .. (args.notext and "" or (args.nocount and "" or (args.dynamic and (k + 1) / 2 or k) .. ". ") .. (args.noimagelink and filename or "" .. filename .. "")) else output[k] = "" end end return f:callParserFunction{name="#tag:gallery", args={table.concat(output, "\n"), class="pixel-image"}} end return p