Module:Sandbox/Kammerer55 Explained

local function to_full_string(value) if type(value)

'table' then local result = for k, v in pairs(value) do table.insert(result, to_full_string(k) .. ' : ' .. to_full_string(v)) end return '' elseif type(value)

'string' then return "'" .. value .. "'" else return tostring(value) endend

local load_level_data = function(level) local data_page = 'User:Kammerer55/VAsections.json' local data = mw.loadJsonData(data_page) if data then return data[tonumber(level)] endend

local p = p.main = function(frame) local args = frame.args local level = args[1] local section_id = args[2] local out = local print = function (value) table.insert(out, type(value) .. ' = ' .. to_full_string(value)) end -- some code here local level_data = load_level_data(level) print(level_data) if level_data then local section_data = level_data[section_id] print(section_data) local link = section_data.link if link then return ' ' .. level .. ' / ' .. section_id .. '' end end return table.concat(out, '
') -- return outend

return p