Module:ClassTagList

local class_link = require('Module:Superclass')._class_link

local p = {}

--% This function generates a list of classes by their tags. --: (string) the list of classes function p.list_classes_by_tags local tags = {} for _, class in pairs(mw.loadData("Module:APIDump").data.Classes) do       if class.Tags then for _, tag in pairs(class.Tags) do               if not tags[tag] then tags[tag] = {} end table.insert(tags[tag], class.Name) end end end local sorted_tags = {} for tag in pairs(tags) do       table.insert(sorted_tags, tag) end table.sort(sorted_tags) local output = "" for _, tag in ipairs(sorted_tags) do       output = output .. "== " .. tag .. " ==\n" table.sort(tags[tag]) for _, class_name in ipairs(tags[tag]) do           output = output .. "* " .. class_link{class=class_name} .. "\n" end end return output end

return p