Module:PropertyCategoryList

local member_link = require('Module:MemberLink')

local p = {}

--% This function generates a list of properties by category. --: (string) the list of properties function p.list_properties_by_category local categories = {} local uncategorized_properties = {} for _, class in ipairs(require("Module:APIClasses")) do       for _, member in ipairs(class.Members) do            if member.MemberType == "Property" then if member.Category then if not categories[member.Category] then categories[member.Category] = {} end table.insert(categories[member.Category], {class.Name, member}) else table.insert(uncategorized_properties, {class.Name, member}) end end end end local sorted_categories = {} for category in pairs(categories) do       table.insert(sorted_categories, category) end table.sort(sorted_categories) local output = "" for _, category in ipairs(sorted_categories) do       output = output .. "== " .. category .. " ==\n" for _, class_member in ipairs(categories[category]) do           local class_name, member = class_member[1], class_member[2] output = output .. "* " .. member_link.make_member_link_with_icon(class_name, member) .. "\n" end end return output end

return p