Documentation for this module may be created at Module:Infobox after talk/doc
local InfoboxBuilder = require('Module:InfoboxBuilder')
local p = {}
function p.main(frame)
local args = frame:getParent().args
local infobox = InfoboxBuilder.new()
infobox:setName('Infobox after talk')
:setParams {
{ name = 'title', default = mw.title.getCurrentTitle().text },
{ name = 'japanese' },
{ name = 'romaji' },
{ name = 'english' },
{ name = 'length', fn = ProcessingFns.stringToNumber },
{ name = 'date' },
{ name = 'feat' }
}
:setArgs(args)
:processArgs()
infobox
:addHeader({ tag = 'argth', content = 'title' })
:addRow(
{
{ tag = 'th', content = 'Japanese' },
{ tag = 'argtd', content = 'japanese' }
},
{ hideIfEmpty = { 'japanese' } }
)
:addRow(
{
{ tag = 'th', content = 'Romaji' },
{ tag = 'argtd', content = 'romaji' }
},
{ hideIfEmpty = { 'romaji' } }
)
:addRow(
{
{ tag = 'th', content = 'English' },
{ tag = 'argtd', content = 'english' }
},
{ hideIfEmpty = { 'english' } }
)
:addHeader({ tag = 'th', content = 'Stream Information' }, { subheader = true })
:addRow(
{
{
tag = 'th',
content = 'Length'
},
{
tag = 'argtd',
content = 'length',
fn = DisplayFns.minutesAndSeconds
}
},
{ hideIfEmpty = { 'length' } }
)
:addRow(
{
{ tag = th, 'Release date' },
{ tag = argtd, 'date' }
},
{ hideIfEmpty = { 'date' } }
)
:addRow(
{ tag = th, 'Featuring' },
{ tag = argtd, 'feat' }
)
end
return p