Difference between revisions of "Module:Sandbox/Ahecht/sandbox"
< Module:Sandbox | Ahecht
Jump to navigation
Jump to search
blackwiki>Ahecht (update) |
blackwiki>Ahecht (update) |
||
Line 6: | Line 6: | ||
function p.main(frame) | function p.main(frame) | ||
− | local mwSite | + | local mwSite = '' |
− | for k,v in pairs(mw.site) do | + | 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 | end | ||
return p | return p |
Revision as of 17:09, 21 March 2018
Documentation for this module may be created at Module:Sandbox/Ahecht/sandbox/doc
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