{% local function isKindExpandable(kind) return kind ~= "Manual" end local function isSectionEmpty(mod, sections) if type(sections) == "table" then for _, v in pairs(mod.items) do for _, section in pairs(sections) do if v.section_id == section then return false end end end else local section = sections for _, v in pairs(mod.items) do if v.section_id == section then return false end end end return true end local function kinds() local kinds = {"Manual", "Code", "Enum"} local kindIndices = {} for i, v in pairs(kinds) do kindIndices[v] = i end local t = {} for kind, mods, type in ldoc.kinds() do local entry = {kind, mods, type} local idx = kindIndices[kind] if idx then t[idx] = entry else t[#t + 1] = entry end end local idx return function(t, i) i = i + 1 local v = t[i] if v then return i, table.unpack(v) end end, t, 0 end %}