Documentation for this module may be created at Module:Live song/doc
local p = {}
local function link(name, title)
local out = '[['
if title == '' then
out = out .. name
else
out = out .. title .. '|' .. name
end
return out .. ']]'
end
function p._entry(name, title, note, cover, tease, abandoned)
local out = '"'
if cover ~= '' and (tease ~= '' or abandoned ~= '') then
local mw_title = mw.title.makeTitle(0, name)
if mw_title.exists then
out = out .. link(name, title)
else
out = out .. name
end
else
out = out .. link(name, title)
end
if not(cover ~= '' and (tease ~= '' or abandoned ~= '')) then
out = out .. ']]'
end
out = out .. '" '
if cover ~= '' then
out = out .. '[' .. cover .. '] '
end
if tease ~= '' and abandoned ~= '' then
out = out .. '(tease / abandoned) '
elseif tease ~= '' then
out = out .. '(tease) '
elseif abandoned ~= '' then
out = out .. '(abandoned) '
end
if note ~= '' then
out = out .. '(' .. note .. ')'
end
return out
end
function p.entry(frame)
local name = frame.args[1]
local title = frame.args[2]
local note = frame.args[3]
local cover = frame.args[4]
local tease = frame.args[5]
local abandoned = frame.args[6]
return p._entry(name, title, note, cover, tease, abandoned)
end
return p