6,304
个编辑
小无编辑摘要 |
小无编辑摘要 标签:移动版编辑 移动版网页编辑 |
||
(未显示同一用户的15个中间版本) | |||
第1行: | 第1行: | ||
local getArgs = require('Module:Arguments').getArgs | |||
local p = {} | local p = {} | ||
function p.titular( | local function makeInvokeFunc(funcName) | ||
return function (frame) | |||
local args = getArgs(frame) | |||
return p[funcName](args) | |||
end | |||
end | |||
p.titular = makeInvokeFunc('_titular') | |||
function p._titular(args) | |||
local result="" | local result="" | ||
for i,k in ipairs(args) do | for i,k in ipairs(args) do | ||
result=result..'<span id="'..k..'"></span>' | result=result..'<span id="'..k..'"></span>' | ||
第10行: | 第19行: | ||
end | end | ||
function p.link( | function link(page,name) | ||
local result= '[['..page..'列表#'..name..'|'..name..']]' | |||
return result | |||
end | |||
p.link = makeInvokeFunc('_link') | |||
function p._link(args) | |||
local page,text=args[1],args[2] | |||
local a,b,c | |||
a,b = text:match('([^\s]*) (feat.*)') | |||
if a and b then | |||
return link(page,a)..' '..b | |||
end | |||
a,b,c = text:match('([^\s]*) (vs) ([^\s]*)') | |||
if a and b and c then | |||
return link(page,a)..' '..b..' '..link(page,c) | |||
end | |||
a,b,c = text:match('([^\s]*) (×) ([^\s]*)') | |||
if a and b and c then | |||
return link(page,a)..' '..b..' '..link(page,c) | |||
end | |||
a,b,c = text:match('([^\s]*) (vs.) ([^\s]*)') | |||
if a and b and c then | |||
return link(page,a)..' '..b..' '..link(page,c) | |||
end | |||
a,b,c = text:match('([^\s]*) (x) ([^\s]*)') | |||
if a and b and c then | |||
return link(page,a)..' '..b..' '..link(page,c) | |||
end | |||
a,b,c = text:match('([^\s]*) (&) ([^\s]*)') | |||
if a and b and c then | |||
return link(page,a)..' '..b..' '..link(page,c) | |||
end | |||
return link(page,text) | |||
end | end | ||
return p | return p |