Module:CharaInfo

From Little Tail Wiki
Revision as of 23:18, 8 May 2024 by Meguumin (talk | contribs)
Module:CharaInfo

An example image (IMAGE REQUIRED)
Bio.
Age X
Gender X
Species X
Height Optional
Relatives Optional
Residence Optional
Mecha Optional
Vehicle Optional
Voice Actor Optional

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 as long as all required rows are present. Optional rows are available, but must still follow what's readily available from the module. All available rows are displayed in this page's CharaInfo infobox with optional rows marked as "Optional" and required ones marked with an X.

In source editor, excluding any optional row will make that row not render. Leaving out any required rows 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         = X
| gender      = X
| species     = X
| 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( 'Bio.' )
	:addRow( 'Age', args.age )
	:addRow( 'Gender', args.gender )
	:addRow( 'Species', args.species )
	:addRow( 'Height', args.height )
	:addRow( 'Relatives', args.relatives )
	:addRow( 'Residence', args.residence )
	:addRow( 'Mecha', args.mecha )
	:addRow( 'Vehicle', args.vehicle )
	:addRow( 'Voice Actor', args.voiceactor )
	return retval
end

return p