Jump to content

Module:Sandbox/Ahecht/sandbox

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ahecht (talk | contribs) at 17:09, 21 March 2018 (update). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {}

local function _main(args)
	return true
end

function p.main(frame)
	local mwSite = ''
	for k,v in pairs(mw.site) do
		mwSite = mwSite .. '\n*mw.site.' .. k .. ': '
		if type(v) == 'string' or type(v) == 'number' then
			mwSite = mwSite .. v
		elseif type(v) == 'table' then
			for kk,vv in pairs(v) do
				if type(vv) == 'table' then vv = '[table]' end
				if type(vv) ~= 'function' then
					mwSite = mwSite .. '\n**mw.site.' .. k .. '.' .. kk .. ': ' .. vv
				end
			end
		end
	end
	return mwSite
end

return p