Module:CategoryList

local p = {}

function p.getPageList (category, frame)

local opts = [[

category = ]] .. category .. [[

shownamespace = true mode = inline-bullets ordermethod = sortkey order    = ascending ]]

return frame:extensionTag('DynamicPageList', opts) end

-- We need this hack until categories accessible: https://phabricator.wikimedia.org/T50175 function p.getCategoryList (category, frame) local opts = [[

category = ]] .. category .. [[

namespace = Category shownamespace = false mode = inline-bullets ordermethod = sortkey order    = ascending raw      = true ]]	local tag = frame:extensionTag('DynamicPageList', opts) -- return #(mw.text.split(tag, 'ed')) -- not working for some reason unless empty string return (mw.ustring.find(tag, 'e'))

--local catTable = {} --for cat in string.gmatch(tag, '.') do   --	table.insert(catTable, cat) --end --return #catTable end

function p.main (frame) local category = frame.args[1] local depth = frame.args[2] or 3

-- return table.concat(p.getCategoryList(category, frame), '==') -- .. p.getPageList('Body systems', frame) return p.getCategoryList(category, frame) end return p