Module:Namespace other: Difference between revisions
Jump to navigation
Jump to search
enws>CalendulaAsteraceae No edit summary |
m (1 revision imported) |
(No difference)
|
Latest revision as of 02:55, 4 November 2024
Documentation for this module may be created at Module:Namespace other/doc
require('strict')
local p = {}
local getArgs = require('Module:Arguments').getArgs
function p._namespace_other(args)
local namespace = string.lower(args.demospace or mw.title.getCurrentTitle().nsText)
if namespace == '' then
namespace = 'main'
end
local target = string.lower(args.target or 'main')
local special_targets = {
['page index'] = {page = true, index = true}
}
if namespace == target or (special_targets[target] and special_targets[target][namespace]) then
return args[1]
else
return args[2]
end
end
function p.namespace_other(frame)
return p._namespace_other(getArgs(frame))
end
return p