Wikipedia:Automated taxobox system/map

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Automated taxobox system

Taxonomy templates

Taxobox templates

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[edit]

Updated: 13 January 2017

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}}, {{Automatic taxobox}}, etc.
    Generate a taxobox for all taxa from the rank of species upwards. They use the parameter taxon, or the page name if this parameter is omitted, to construct the name of the taxon which is the target of the automated taxobox. They then invoke {{Taxobox/core}} with |parent=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.
    • {{Taxobox/core}}
      Generates an automatic taxobox, but only when passed the parameter parent. (Otherwise it generates a manual taxobox.) It creates the structure of a taxobox and handles all the taxobox-related parameters, other than parent, that are passed to it.
      • Module:Autotaxobox|taxoboxColour
        First, the system has to find the correct colour for the taxobox. The Lua function taxoboxColour searches up the taxonomic hierarchy for the first taxon that sets a taxobox colour according to {{Taxobox colour}}.
      • Module:Autotaxobox|taxoboxList
        Second, the system has to generate the list of taxa shown in the taxobox. The Lua function taxoboxList makes a list of all the parent taxa of the target taxon, based on the taxonomy templates.
        • {{Taxobox/showtaxon}}
          Each taxon in the list is then processed by {{Taxobox/showtaxon}}, which outputs 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 a "major rank", how many immediately higher ranks are to be displayed, and whether |always_display=yes is set in the taxonomy template.

Detailed map[edit]

Updated 17 January 2017

Top level[edit]

The following templates can be used in articles to create an automated taxobox:

Displaying an automated taxobox[edit]

The top level automated taxobox templates begin by calling {{Taxobox/core}} with |parent=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.

Displaying a taxonomy template[edit]

The first line of every taxonomy template begins

{{Don't edit this line {{{machine code|}}} ...

When a taxonomy template is viewed as a page, {{Don't edit this line }} is invoked, since machine code 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.

Obtaining information from a taxonomy template[edit]

Ultimately, information is obtained from a taxonomy template, via {{Taxonomy/taxon|machine code=item}}, which in turn uses one of the {{Don't edit this line item}} variants, where item = parent, rank, etc. However, these templates should never be used directly; in a template, they must always be called via {{Taxon info}} (in Lua access to taxonomy templates is coded in taxonInfo, callTaxonomyKey and getTaxonInfoItem). 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.

  • {{Taxon info}} – wrapper for the Lua function taxonInfo
    • Module:Autotaxobox|taxonInfo – gets parameter values for the Lua function getTaxonInfoItem
      • Module:Autotaxobox|getTaxonInfoItem – obtains an item of information from a taxonomy template, following one "same as" link

Preload templates[edit]

When a taxonomy template is created, "preload templates" provide an introduction and can pre-fill the template.

Support templates[edit]

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
Templates used to generate |subdivision_ranks= if it is missing but needed

See also[edit]