Module:Infobox/doc

This module implements all of the infoboxes. Individual infoboxes are defined on subpages of this page, and MUST be marked translatable, or you will get an error when trying to use them, as the module reads the translations exclusively.

Functions
Expands to the infobox defined by the subpage. When creating the template wrappers, supply  instead of the parameters directly. This will cause the infobox to take its parameters from the ones supplied to the wrapper.

Expands to a documentation page for boxname.

List the parameters available in a suitable form for template documentation. Note that Module:Infobox/thing defines a bunch that aren't listed by this, because they're generated programmatically.

Produce an infobox with all the parameter names shown.

Format of infobox definitions
Please note that any translatable text MUST use multiline string syntax with at least one = in it. That is, rather than, do. This is because the translate extension inserts linebreaks, which are not compatible with quotes, and the  syntax breaks if it contains any wikitext links.

Fields listed as wikitext are strings, but ones in which it is reasonable to put wikitext. Templates should work in most of them.

Each definition is a Lua module, so it has to return a table. Typically this is done by: local box = {} -- box definition is here return box

The contents of this table are as following: Wikitext Lead section of the documentation (the hatnote and "This template is used to create an infobox..." text are inserted for you). Wikitext Text immediately preceding the parameter list (the "an empty infobox..." text is also inserted automatically) Wikitext Text immediately following the parameter list. Format table Details of the infobox (see the next section) Table of examples Examples to place in the documentation. Each example is a table containing an optional description in the  key, and some wikitext to use as an example in the first indexed entry. For example: { text="Demonstration of hatnote", "" }

Format of infobox details
This is also a table, containing a list of sections; a section is the part of the infobox that is headed by a blue header. Each section is a table, with the following contents. "Argument" denotes a field that can be either an argument table (see below), or wikitext.

String Name that appears as a header in the documentation. Consecutive sections with identical names will be merged into one in the documentation. Argument Mandatory. The heading for a section (ie, the bit that appears in the blue bar). Wikitext Optional. Explanatory text which will appear in the documentation for this section. Boolean Optional. If present, don't show this section in the documentation at all. Boolean Optional. If present, this section is not treated as part of the infobox, but documentation is still shown for it. Indexed Subsection table  The subsections to display. You need at least one of these.

Subsections can contain    and   keys, and contain a list of rows (again, you need at least one). Rows can also contain those three keys, and contain one or two Arguments as indexed entries. If one, then it will be centered across the width of the infobox, using the colspan parameter in the generated cell.

Format of Arguments
An argument which is not a string is a table referring to a template parameter supplied to an invocation of, the value of this parameter being used as if it had been given in place of the table. Templates Always String or table of strings The name of the template parameter. If you give a table here, its indexed parameters will be used as synonyms, with the first being the canonical name. One of:

How the argument will be interpreted. is just wikitext. will treat it as the name of an image. will look it up in the  parameter. will also add to if an invalid value is given for the parameter (but not none at all). String CSS to insert in the table cell's   attribute. Number Maximum size of an   in pixels. Omit the, it will be added for you. String Additional parameters to add to the image. Use pipes to separate them, as you would in wikitext (but you don't need to start or end with one). Table of strings Permitted values for a. Mandatory for switches, pointless otherwise. The value given as a template parameter will be used as a key into this table, and the value will be displayed. A listing of keys and values will be entered into the documentation. Wikitext (no templates) Description to displayed in the listing of parameters in the documentation. If omitted, then no entry will be displayed at all. Boolean If present, the argument will not be mentioned in the documentation. Overrides the presence of.