Module:Name Ref

local Franchise = require("Module:Franchise") local utilsArg = require("Module:UtilsArg") local utilsMarkup = require("Module:UtilsMarkup") local utilsTable = require("Module:UtilsTable")

local p = {}

function p.GamesToCategories(frame) local args, err = utilsArg.parse(frame:getParent.args, p.Templates["Name Ref"]) local categories = p.gamesToCategories(args.games) if err then categories = utilsTable.concat(categories, err.categories) end return utilsMarkup.categories(categories) end

function p.gamesToCategories(games) local categories = utilsTable.map(games or {}, p.gameToCategory) table.insert(categories, 1, "Articles Lacking Name References") return categories end

function p.gameToCategory(game) return Franchise.shortName(game) .. " Articles Lacking Name References" end

p.Templates = { ["Name Ref"] = { purpose = "Use this template as a placeholder for missing term references.", format = "inline", params = { [1] = {				name = "games", placeholder = "game1, game2, ..., gameN", type = "string", enum = Franchise.enum, desc = "A comma-separated list of game codes indicating specific games lacking references for a given term.", split = true, sortAndRemoveDuplicates = true, }		},		examples = { {},			{"OoT"}, {"OoT, BotW"}, {"fakeGame"}, {"BotW, BotW, OoT, fakeGame"}, }	} }

return p