Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Infobox after talk: Difference between revisions

From Sekaipedia
Content added Content deleted
(Created page with "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' } } :...")
 
No edit summary
Line 1: Line 1:
local InfoboxBuilder = require('Module:InfoboxBuilder')
local InfoboxBuilder = require('Module:InfoboxBuilder')
local DisplayFns = require('Module:DisplayFunctions')


local p = {}
local p = {}

Revision as of 17:21, 18 May 2024

Documentation for this module may be created at Module:Infobox after talk/doc

local InfoboxBuilder = require('Module:InfoboxBuilder')
local DisplayFns     = require('Module:DisplayFunctions')

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
Cookies help us deliver our services. By using our services, you agree to our use of cookies.