Difference between revisions of "Module:Sandbox/Ahecht/sandbox"
< Module:Sandbox | Ahecht
Jump to navigation
Jump to search
blackwiki>Ahecht (update) |
blackwiki>Ahecht (update) |
||
| Line 10: | Line 10: | ||
local spaceName = v.name | local spaceName = v.name | ||
if v.name ~= (v.displayName or v.canonicalName) then spaceName = spaceName .. (v.displayName or (' (' .. v.canonicalName .. ')')) end | if v.name ~= (v.displayName or v.canonicalName) then spaceName = spaceName .. (v.displayName or (' (' .. v.canonicalName .. ')')) end | ||
| − | nameSpaces = nameSpaces .. '**' .. v.id .. ': ' .. spaceName | + | nameSpaces = nameSpaces .. '\n**' .. v.id .. ': ' .. spaceName |
end | end | ||
| − | 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' .. | + | local siteStats = '' |
| + | for k,v in pairs(mw.site.stats) do if type(v) ~= 'function' then siteStats = siteStats .. '\n**' .. k .. ': ' .. v end end | ||
| + | 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: ' .. nameSpaces .. '\n*mw.site.stats: ' .. siteStats | ||
return output | return output | ||
end | end | ||
return p | return p | ||
Revision as of 16:35, 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 nameSpaces = ''
for _, v in pairs(mw.site.namespaces) do
local spaceName = v.name
if v.name ~= (v.displayName or v.canonicalName) then spaceName = spaceName .. (v.displayName or (' (' .. v.canonicalName .. ')')) end
nameSpaces = nameSpaces .. '\n**' .. v.id .. ': ' .. spaceName
end
local siteStats = ''
for k,v in pairs(mw.site.stats) do if type(v) ~= 'function' then siteStats = siteStats .. '\n**' .. k .. ': ' .. v end end
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: ' .. nameSpaces .. '\n*mw.site.stats: ' .. siteStats
return output
end
return p