Module:Sandbox/Ahecht/sandbox: Difference between revisions

Content deleted Content added
update
simplify
 
(5 intermediate revisions by the same user not shown)
Line 6:
 
function p.main(frame)
local nameSpacesmwSite = ''
for _k, v in pairs(mw.site.namespaces) do
mwSite = mwSite .. '\n*mw.site.' .. k .. ': '
local spaceName = v.name
if type(v) == 'string' or type(v) == 'number' then
if v.name ~= (v.displayName or v.canonicalName) then spaceName = spaceName .. (v.displayName or (' (' .. v.canonicalName .. ')')) end
mwSite = mwSite .. v
nameSpaces = nameSpaces .. '**' .. v.id .. ': ' .. spaceName .. '\n'
elseif type(v) == 'table' then
for kk,vv in pairs(v) do if type(vv) == 'string' or type(vv) == 'number' then mwSite = mwSite .. '\n**mw.site.' .. k .. '.' .. kk .. ': ' .. vv end end
end
end
return outputmwSite
local output = '*Version: ' .. mw.site.currentVersion .. '\n*$wgScriptPath: ' .. mw.site.scriptPath .. '\n*$wgServer: ' .. mw.site.server .. '\n*$wgSitename: ' .. mw.site.siteName .. '\n*$wgStylePath: ' .. mw.site.stylePath .. '\n*mw.site.namespaces: \n' .. nameSpaces
return output
end