Module:Logo

local p = {}

local Franchise = require("Module:Franchise") local utilsArg = require("Module:UtilsArg") local utilsMarkup = require("Module:UtilsMarkup") local utilsPage = require("Module:UtilsPage")

function p.Main(frame) local args, err = utilsArg.parse(frame:getParent.args, p.Templates.Logo) local result = p.main(args.game) if err and not args.nocat then result = result .. utilsMarkup.categories(err.categories) end return result end

function p.main(game) local filename = game and Franchise.logo(game) or "" return utilsPage.stripNamespace(filename) end

p.Templates = { Logo = { purpose = "Given a game code, returns the filename of the logo for that game. A tool for other templates.", format = "inline", params = { [1] = {				name = "game", required = true, desc = "A valid code for a game, book, or TV show (or ).", enum = Franchise.enum({					includeSeries = true,					includeGroups = true,					includeNonfiction = true,				}), trim = true, nilIfEmpty = true, },			[2] = {				name = "nocat", camOmit = true, type = "boolean", desc = "Enter  here to avoid generating any validation categories.", },		},		examples = { {"BotW"}, {"FPTRR"}, {"E"}, {"SSB4"}, {"Series"}, {""},			{"fakeGame"}, {"fakeGame", "-"}, },	}, }

return p