More actions
Content deleted Content added
No edit summary |
No edit summary |
||
(10 intermediate revisions by the same user not shown) | |||
Line 13:
:setParams {
{ name = 'title', default = mw.title.getCurrentTitle().text },
--{ name = 'image' },
{ name = 'japanese' },
{ name = 'romaji' },
{ name = 'english' },
{ name = '
{ name = 'date' },
{ name = 'feat' }
Line 24 ⟶ 25:
infobox
:addHeader({ tag = 'argth', content = 'title' })
--:addImage({
--{ tag = 'argtd', content = 'image', fn = DisplayFns.image('220px') },
--})
:addRow(
{
{ tag = 'th', content = 'Japanese' },
{ tag = 'argtd', content = 'japanese' }
}
)
:addRow(
Line 35 ⟶ 38:
{ tag = 'th', content = 'Romaji' },
{ tag = 'argtd', content = 'romaji' }
}
)
:addRow(
Line 50 ⟶ 52:
{
tag = 'th',
content = '
},
{
tag = 'argtd',
content = '
fn = DisplayFns.
}
}
)
:addRow(
Line 64 ⟶ 65:
{ tag = 'th', content = 'Release date' },
{ tag = 'argtd', content = 'date' }
}
)
:addRow(
{
{ tag = 'th', content = 'Featuring' },
{ tag = 'argtd', content = 'feat' }
}
)
|
Latest revision as of 14:58, 22 May 2024
Documentation for this module may be created at Module:Infobox after talk/doc
local getArgs = require('Module:Arguments').getArgs
local InfoboxBuilder = require('Module:InfoboxBuilder')
local DisplayFns = require('Module:DisplayFunctions')
local ProcessingFns = require('Module:ProcessingFunctions')
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 = 'image' },
{ name = 'japanese' },
{ name = 'romaji' },
{ name = 'english' },
{ name = 'duration', fn = ProcessingFns.stringToNumber },
{ name = 'date' },
{ name = 'feat' }
}
:setArgs(args)
:processArgs()
infobox
:addHeader({ tag = 'argth', content = 'title' })
--:addImage({
--{ tag = 'argtd', content = 'image', fn = DisplayFns.image('220px') },
--})
:addRow(
{
{ tag = 'th', content = 'Japanese' },
{ tag = 'argtd', content = 'japanese' }
}
)
:addRow(
{
{ tag = 'th', content = 'Romaji' },
{ tag = 'argtd', content = 'romaji' }
}
)
:addRow(
{
{ tag = 'th', content = 'English' },
{ tag = 'argtd', content = 'english' }
},
{ hideIfEmpty = { 'english' } }
)
:addHeader({ tag = 'th', content = 'Stream Information' }, { subheader = true })
:addRow(
{
{
tag = 'th',
content = 'Stream duration'
},
{
tag = 'argtd',
content = 'duration',
fn = DisplayFns.hoursAndMinutes
}
}
)
:addRow(
{
{ tag = 'th', content = 'Release date' },
{ tag = 'argtd', content = 'date' }
}
)
:addRow(
{
{ tag = 'th', content = 'Featuring' },
{ tag = 'argtd', content = 'feat' }
}
)
return infobox:tostring()
end
return p