モジュール:Distinguish
ナビゲーションに移動
検索に移動
このモジュールについての説明文ページを モジュール:Distinguish/doc に作成できます
local p = {}
function p.distinguish(frame)
local template = frame.args[1]
local args = frame:getParent().args
local noDlcIcon = args.noDlcIcon or ''
local links = {}
for i, v in ipairs(args) do
local s = trim(args[i])
if #s > 0 then
table.insert(links, frame:expandTemplate{title = template, args = { s, noDlcIcon = noDlcIcon } })
end
end
if args[2] ~= nil and args[3] == nil then
return mw.text.listToText( links, '、', '、' )
else
return mw.text.listToText( links, '、', '、' )
end
end
function trim(s)
return (s:gsub("^%s*(.-)%s*$", "%1"))
end
return p