Module:CharaInfo
From Little Tail Wiki
The CharaInfo infobox is dedicated to quickly listing off basic information about the article's featured character.
Infoboxes are put together via Capiunto, which calls upon a Lua-based module. This keeps infoboxes clean and easy to form.
In source editor, excluding any optional row will make that row not render. Leaving out any required fields will throw an error over the page. HTML tags can be used within the infobox if necessary.
Specific Rows
Some rows are specifically made for certain characteristics that not all characters share.
Mecha - For those who possess Robos or other mechas as seen in Tail Concerto or Solatorobo.
Weapon Class - Refers to Fuga's weapon class system. Applies to all playable crew mates.
Vehicle - Specifically for characters in Fuga who commandeer tanks, military aircraft, etc..
Usage
{{CharaInfo | headerstyle = (defaults to background-color:grey) | image = [[File:Waffle.png|200px]] | caption = An example image (IMAGE REQUIRED) | ("Bio.") | age = Optional | gender = Optional | species = Optional | namesake = Optional | height = Optional | relatives = Optional | residence = Optional | mecha = Optional | weapclass = Optional | vehicle = Optional | voiceactor = Optional }}
local capiunto = require 'capiunto'
local p = {}
function p.main(frame)
local args = frame:getParent().args
local headerStyle
if args.headerstyle and args.headerstyle ~= '' then
headerStyle = string.format('background-color:%s;', args.headerstyle)
else
headerStyle = 'background-color:grey;'
end
local retval = capiunto.create( {
title = tostring(mw.title.getCurrentTitle()) ,
headerStyle = headerStyle,
} )
:addImage( args.image, args.caption )
:addHeader( 'Info.' )
if args.namesake then retval:addRow( 'Age', args.age ) end
if args.namesake then retval:addRow( 'Gender', args.gender ) end
if args.namesake then retval:addRow( 'Species', args.species ) end
if args.namesake then retval:addRow( 'Namesake', args.namesake ) end
if args.height then retval:addRow( 'Height', args.height ) end
if args.relatives then retval:addRow( 'Relatives', args.relatives ) end
if args.residence then retval:addRow( 'Residence', args.residence ) end
if args.mecha then retval:addRow( 'Mecha', args.mecha ) end
if args.weapclass then retval:addRow( 'Weapon Class', args.weapclass ) end
if args.vehicle then retval:addRow( 'Vehicle', args.vehicle ) end
if args.voiceactor then retval:addRow( 'Voice Actor', args.voiceactor ) end
return retval
end
return p