Module:Live song: Difference between revisions
MusikAnimal (talk | contribs) No edit summary |
MusikAnimal (talk | contribs) No edit summary |
||
Line 7: | Line 7: | ||
out = out .. name | out = out .. name | ||
else | else | ||
out = out .. | out = out .. name .. '|' .. title | ||
end | end | ||
Revision as of 22:15, 3 August 2020
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 .. name .. '|' .. title
end
return out .. ']]'
end
function p._entry(name, title, note, cover, tease, abandoned, length)
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
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
if length ~= '' then
out = out .. '[' .. length .. ']'
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]
local length = frame.args[7]
return p._entry(name, title, note, cover, tease, abandoned, length)
end
return p