模組:Look from
外观
local p={}
function p._main(args, frame)
local title = args['1'] or tostring(mw.title.getCurrentTitle())
local ns = args['2'] or ''
local title_ns = frame:callParserFunction{name = "NAMESPACE", args = title}
local page = frame:callParserFunction{name = "PAGENAME", args = title}
if ((title_ns == '') == 0) and ((ns == '') == 0) then
title = ns .. ':' .. page
else
ns = title_ns
end
local text = args['3'] or '以「-{' ..title ..'}-」開頭的' .. frame:expandTemplate{title = "NS1", args = {["2"]=ns}}
return '<span class="selfreference">[[Special:PrefixIndex/' .. title .. '|' .. text .. ']]</span>'
end
function p.main(frame)
local args = frame:getParent().args
return p._main(args, frame)
end
return p