Module:SwitchTableDocumentation

local p = {}

function p.switchTableDocumentation( frame ) if frame == mw.getCurrentFrame then args = require( 'Module:ProcessArgs' ).merge( true ) else frame = mw.getCurrentFrame end local printthistable = mw.loadData('Module:' .. args[1]) local text = {} local sortthis = {} text[#text+1] = '{|class="wikitable"' text[#text+1] = '\n! ' .. (args["key"] or "Key") .. " || " .. (args["value"] or "Value") for key, value in pairs(printthistable) do sortthis[#sortthis+1] = "\n|-\n| " .. key .. " || " .. value end table.sort(sortthis) return table.concat(text) .. table.concat(sortthis) .. "\n|}"

end

return p