local p =
local scripts = mw.loadData("Module:scripts/data")
local function format(code) local name = scripts[code][1] if not name:find("[Ss]script$") then name = name .. " script" end return "[[:Category:" .. name .. "|" .. scripts[code][1] .. " <span style=\"color:green;\">(" .. code .. ")</span>]]
"end
local function dump(data, prefix) if type(data)
#data then branch = "└───" next_level = prefix .. " " end if #val
local function deep_sort(current) local result = local is_table = for key,val in pairs(current) do if type(key)
scripts[result[i]] do table.remove(result,i) end i = i + 1 end for i=1,#result do if is_table[result[i]] then local name = result[i] result[i] = deep_sort(current[result[i]]) result[i].name = name else result[i] = end end return resultend
function p.show(frame) local children = local function find_ancestors(origin,key,val) if val.parent then return end end for key,val in pairs(scripts) do local ancestors = find_ancestors(key,key,val) if ancestors then for _, ancestor in ipairs(ancestors) do if ancestor ~= key then if children[ancestor] then table.insert(children[ancestor], key) else children[ancestor] = end end end end end local function make_nested(data) local make_nil = for key,val in pairs(data) do if type(key)
" .. format(nested[i].name) .. "\n | -\n | " result = result .. dump(nested[i], " ") result = result .. "\n |
return p