This module depends on the following other modules: |
To generate {{Infobox seiyuu}}, invoke using the main function.
--------------------------
-- Module for [[Template:Infobox seiyuu]]
------------------------
local getArgs = require('Module:Arguments').getArgs
local InfoboxBuilder = require('Module:InfoboxBuilder')
local DisplayFns = require('Module:DisplayFunctions')
local p = {}
function p.main(frame)
local args = getArgs(frame)
local infobox = InfoboxBuilder.new()
infobox:setName('Infobox seiyuu')
:setParams{
{ name = 'name', default = mw.title.getCurrentTitle().text },
{ name = 'image' },
{ name = 'japanese' },
{ name = 'romaji' },
{ name = 'gender' },
{ name = 'birth date' },
{ name = 'occupation' },
{ name = 'blood type' },
{ name = 'wikipedia' },
{ name = 'ann' },
{ name = 'mal' },
{ name = 'twitter' },
{ name = 'instagram' },
{ name = 'blog' },
{ name = 'website' }
}
:setArgs(args)
:processArgs()
infobox
:addHeader({ tag = 'argth', content = 'name' })
: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' }
})
:addHeader({ tag = 'th', content = 'Information' }, { subheader = true })
:addRow({
{ tag = 'th', content = 'Gender' },
{ tag = 'argtd', content = 'gender' }
})
:addRow({
{ tag = 'th', content = 'Born' },
{ tag = 'argtd', content = 'birth date' }
})
:addRow({
{ tag = 'th', content = 'Occupation' },
{ tag = 'argtd', content = 'occupation' }
})
:addRow({
{ tag = 'th', content = 'Blood Type' },
{ tag = 'argtd', content = 'blood type' }
})
:addHeader({ tag = 'th', content = 'Links' }, { subheader = true })
:addRow({
{ tag = 'th', content = 'Wikipedia' },
{ tag = 'argtd', content = 'wikipedia' }
})
:addRow({
{ tag = 'th', content = 'AnimeNewsNetwork' },
{ tag = 'argtd', content = 'ann' }
})
:addRow({
{ tag = 'th', content = 'MyAnimeList' },
{ tag = 'argtd', content = 'mal' }
})
:addRow({
{ tag = 'th', content = 'Twitter' },
{ tag = 'argtd', content = 'twitter' }
})
:addRow({
{ tag = 'th', content = 'Instagram' },
{ tag = 'argtd', content = 'instagram' }
})
:addRow({
{ tag = 'th', content = 'Blog' },
{ tag = 'argtd', content = 'blog' }
})
:addRow({
{ tag = 'th', content = 'Website' },
{ tag = 'argtd', content = 'website' }
})
local categories = ""
if mw.title.getCurrentTitle().namespace == 0 then
categories = "[[Category:Seiyuus]]" .. categories
end
return infobox:tostring() .. categories
end
return p