Wikipedia:Automated taxobox system/map

This page provides a map of the templates which act together to create a taxobox in the automated taxobox system. It is meant to assist editors maintaining the system.

Note that it may not always be up to date.

Overview
Updated: 14 March 2020

The core part of the automatic taxobox system displays a taxonomy for a target taxon by retrieving the taxonomic hierarchy stored in "Taxonomy/taxon" templates. Module:Autotaxobox provides key support for the system. In particular, all traversals of the taxonomic hierarchy are coded in Lua in this module to avoid the expansion depth issues that were previously caused by using the template language. The main functions and templates involved in this process are outlined below.


 * Speciesbox and Automatic taxobox Generate a taxobox for all non-virus taxa from the rank of species upwards. They use the parameter  to determine the name of the taxon which is the target of the automated taxobox. They then invoke Taxobox/core with target_taxon, passing on any other taxobox-related parameters. Speciesbox retrieves the taxonomic hierarchy using only the genus name; Automatic taxobox uses the full name of the taxon. (The function of Automatic taxobox is implemented in Module:Automated taxobox.)
 * Taxobox/core Generates an automatic taxobox, but only when passed the parameter . (Otherwise it generates a manual taxobox.) It creates the structure of a taxobox and handles all the taxobox-related parameters, other than , that are passed to it.
 * Module:Autotaxobox| First, the system has to find the correct colour for the taxobox. The Lua function  searches up the taxonomic hierarchy for the first taxon that sets a taxobox colour according to Taxobox colour.
 * Module:Autotaxobox| Second, the system has to generate the list of taxa shown in the taxobox. The Lua function  makes a list of all the parent taxa of the target taxon, based on the taxonomy templates.
 * Module:Autotaxobox| Each taxon in the list is then processed by, which outputs a row for a single taxon if it is to be shown in the taxobox. The output consists of the name of the rank, the name of the taxon (italicized if required) and the authority if this was passed as a parameter. The template decides whether to display or omit a taxon based on various criteria: whether it is at a "principal rank", how many immediately higher ranks are to be displayed, and whether yes is set in the taxonomy template.

Configuration
The following templates and functions configure the system in some way:
 * Module:Autotaxobox| – defines which taxa act as the very top level of the taxonomic hierarchy (e.g. "Life")
 * Taxobox colour – defines which taxa set the taxobox colour and what those colours are (also used in manual taxoboxes)
 * Anglicise rank – converts the Latin form that is used in taxonomy templates to the English equivalent (also used in manual taxoboxes)
 * Principal rank – defines the Linnaean principal ranks that are shown by default
 * Is italic taxon – defines which ranks cause taxon names to be italicized
 * Module:Autotaxobox|getRankTable – gives ranks an arbitrary numerical value that is used to decide whether a taxonomic hierarchy defined in taxonomy templates has consistent ranks or not

Detailed map
Updated 25 December 2018

Generally only those functions in Module:Autotaxobox that interact externally are shown below.

Top level
The following templates can be used in articles to create an automated taxobox:
 * Automatic taxobox – cases other than those below
 * Hybridbox – animal hybrid species in the same genus
 * Ichnobox – trace fossils
 * Infraspeciesbox – plant ranks below species (subspecies, varieties)
 * Oobox – egg fossils
 * Speciesbox – species
 * Subspeciesbox – animal subspecies
 * Virusbox – virus taxa at all ranks

Displaying an automated taxobox
The top level automated taxobox templates begin by calling Taxobox/core with target-taxon. Only those templates particularly concerned with an automated taxobox are shown below. The points marked "§" are where information is obtained from a taxonomy template – see Obtaining information from a taxonomy template below.
 * Taxobox/core
 * Edit taxonomy – produces the edit link at the top of the taxobox (a red pencil icon, as of December 2018)
 * Taxon info §
 * Module:Autotaxobox|taxoboxColour – determines the taxobox colour automatically
 * Module:Autotaxobox|getTaxonInfoItem §
 * Taxobox colour
 * Taxobox/Error colour
 * Module:Autotaxobox|taxoboxList – traverses the taxonomic hierarchy, displaying it line by line
 * Module:Autotaxobox|showTaxon – shows one line of the taxonomic hierarchy
 * Create taxonomy – creation
 * Module:Autotaxobox|getTaxonInfoItem §
 * Principal rank – is it a rank that is always displayed or not?
 * Anglicise rank – gets the English version of the rank
 * Module:Autotaxobox|getTaxonLink – sets up the taxon name, appropriately italicized, wikilinked, etc.
 * Module:Autotaxobox|getTaxonInfoItem
 * Is italic taxon

Displaying a taxonomy template
The first line of every taxonomy template begins

When a taxonomy template is viewed as a page, Don't edit this line is invoked, since  defaults to the empty string. It shows the taxonomy encoded by the taxonomy template in the form of two tables: the left-hand table displays the taxonomy template itself; the right-hand table shows the taxonomic hierarchy starting from the taxon described by the taxonomy template. See, e.g., Template:Taxonomy/Pteranodon.
 * Don't edit this line – displays a taxonomy template page
 * Module:Autotaxobox|callTaxonomyKey – gathers the information needed to use Taxonomy key
 * Taxonomy key
 * right-hand table
 * Module:Autotaxobox|taxoboxColour – finds the taxobox colour
 * Module:Autotaxobox|taxonomyList – creates the table showing the taxonomic hierarchy
 * Module:Autotaxobox|getTaxonInfoItem §
 * Module:Autotaxobox|getTaxonLink
 * Module:Autotaxobox|getTaxonInfoItem §
 * Is italic taxon
 * Module:Autotaxobox|createTaxonTableRow – prepares display of a single line/taxon in the table
 * Anglicise rank – gets the English version of the rank
 * Edit a taxon – creates a link to taxonomy template for the taxon
 * Create taxonomy/link
 * Taxonomy key/missing template
 * left-hand table
 * Create taxonomy/link
 * Anglicise rank
 * Is italic taxon
 * Module:Autotaxobox|taxonLink
 * Taxon info §
 * Module:Autotaxobox|showRefs
 * Create taxonomy/link

Obtaining information from a taxonomy template
Ultimately, information is obtained from a taxonomy template, via, which in turn uses one of the   variants, where  ,  , etc. This is perhaps an unusual way of using the template coding language: the name of the template to be used next is constructed via a parameter. Thus  expands via Taxonomy/Acacia to , which then yields "Acacieae".

Taxonomy templates should never be used directly to access the taxonomic hierarchy ; in a template, they must always be called via ; in the Lua module access to taxonomy templates is coded in. Then if same_as is present, this link is followed to fill in any information missing from the taxonomy template. Direct use of the taxonomy template does not follow a "same as" link. The exception is when viewing a taxonomy template, since the left-hand table has to show the actual parameter values in the template; these are accessed directly by.


 * Taxon info – wrapper for the Lua function
 * Module:Autotaxobox|taxonInfo – gets parameter values for the Lua function
 * Module:Autotaxobox|getTaxonInfoItem – obtains an item of information from a taxonomy template, following one "same as" link
 * Template:Taxonomy/taxon with item
 * Template:Don't edit this line item – gets an item of information from a taxonomy template, using the following templates:
 * Don't edit this line rank
 * Don't edit this line parent
 * Don't edit this line link text
 * Don't edit this line always display
 * Don't edit this line dagger
 * Don't edit this line refs
 * Don't edit this line same as

Preload templates
When a taxonomy template is created, "preload templates" provide an introduction and can pre-fill the template.
 * Taxonomy preload – helps to select one of the following preload templates


 * Automatic taxobox/editintro/preload → Taxonomy/preload – default case
 * Automatic taxobox/editintro/preload/? → Taxonomy/preload/? – queried taxon
 * Automatic taxobox/editintro/preload/?? → Taxonomy/preload/?? – taxon and parent(s) queried
 * Automatic taxobox/editintro/preload/incertae sedis → Taxonomy/preload/incertae sedis – incertae sedis taxon
 * Automatic taxobox/editintro/sameas → Taxonomy/sameas – same as taxon

Support templates
Various "support templates" can be used in both automated and manual taxoboxes. Some are listed below.
 * Templates to generate special symbols
 * Extinct – generates the † symbol with no italic or bold formatting
 * Hybrid – generates the × symbol with no italic formatting
 * Templates to produce lists of taxa, including:
 * Taxon list
 * Linked taxon list
 * Species list
 * Bold species list
 * Linked species list
 * Templates used to generate subdivision_ranks if it is missing but needed
 * Children rank
 * Child rank
 * Pluralise rank

List of taxobox-related templates
Most templates related to taxoboxes are used either only in automated taxoboxes, or in both manual and automated taxoboxes. The few templates used only in manual taxoboxes are highlighted in this colour below. Transclusion counts were with some high-use counts updated, but note that the tool did not correctly count calls from modules. Higher transclusion counts are highlighted from yellow to red.

Transclusion count summary
Templates in Category:Taxobox templates can be used in three "systems": manual taxoboxes, automated taxoboxes (excluding taxonomy templates), and taxonomy templates. , counts were approximately: