Module:Icon List

local p = {}

local Franchise = require("Module:Franchise") local TermList = require("Module:Term List") local utilsArg = require("Module:UtilsArg")

function p.Main(frame) local args, err = utilsArg.parse(frame:getParent.args, p.Templates["Icon List"]) if err then return err.categoryText end local termLinks, terms = TermList.termList(args.game, args.items, {		link = true	}) local html = mw.html.create("ol") :addClass("zw-icon-list plainlist") for i in ipairs(termLinks) do		local file = string.format("", args.game, terms[i]) html:tag("li") :addClass("zw-icon-list__item") :tag("span") :addClass("zw-icon-list__icon") :wikitext(file) :done :tag("span") :addClass("zw-icon-list__text") :wikitext(termLinks[i]) :done end return tostring(html) end

p.Templates = { ["Icon List"] = { description = "Displays a list of items alongside their icons.", purpose = "Displays lists of items alongside their icons.", params = { [1] = {				name = "game", required = true, enum = Franchise.enum, type = "string", desc = "A game code.", trim = true, nilIfEmpty= true, },			[2] = {				name = "items", required = true, type = "content", desc = "A comma-separated list of items.", tim = true, nilIfEmpty = true, split = true, },		},		examples = { {				desc = "Hateno Dye materials", args = {"BotW", "Chillshroom, Blue Nightshade, Winterwing Butterfly, Cold Darner, Hearty Lizard, Sapphire, Icy Lizalfos Tail, Ice Keese Wing"}, },			{				desc = "Monster Parts", args = {"BotW", "Ancient Screw, Bokoblin Horn, Chuchu Jelly, Hinox Toenail, Keese Wing, Lizalfos Horn, Moblin Horn, Octo Balloon, Octorok Tentacle"} },		},	}, }

return p