Module:Redirect and target
Jump to navigation
Jump to search
File:Test Template Info-Icon - Version (2).svg Module documentation[view] [edit] [history] [purge]
| File:Greek lc alpha icon.svg | This module is rated as alpha. It is ready for limited use and third-party feedback. It may be used on a small number of pages, but should be monitored closely. Suggestions for new features or adjustments to input and output are welcome. |
Implements {{redirect and target}}
Usage
[edit source]{{#invoke:Redirect and target|function_name}}
local getTarget = require('Module:Redirect').getTarget
local p = {}
function p.line(frame)
local pageTitle = frame.args[1]
local target = getTarget(pageTitle, true)
if target then
return string.format('[[%s]] → [[%s]]', pageTitle, target)
end
return string.format('[[%s]] is not a redirect', pageTitle)
end
function p.report(frame)
local pageTitle = frame.args[1]
local target = getTarget(pageTitle, true)
if target then
return string.format('<i>[[%s]] (R)</i> → [[%s]]', pageTitle, target)
end
return string.format('[[%s]]', pageTitle)
end
return p