Documentation for the automated taxobox system

Taxonomy templates

Taxobox templates

Notes for "old hands"[edit]

Major changes to the automated taxobox system were made from the middle of 2016 onwards. There were two motivations:

  1. to remove expansion depth overflows, caused by the constant addition of clades to some taxonomic hierarchies, especially dinosaur taxa
  2. to clarify and simplify the system, both for maintaining editors and for editors creating and editing taxonomy templates.

Use of Lua

All traversals of the taxonomic hierarchy are now coded in Lua, in Module:Autotaxobox. This completely removes the need for clever tricks to get round the absence of iteration and recursion in the template language, as well as expansion depth issues caused by these tricks. Hierarchies with 100 levels can now be handled without problems (a figure that can probably be increased).

See Detailed map for a map of the code as it is now.

Taxonomy templates simplified

"Duplicate" templates – templates with essentially the same function but different names – were previously needed to avoid loops forbidden in the template language. These are no longer necessary. This allows a major simplification to taxonomy templates. Previously, a variant taxonomy template that obtained some of its information from another taxonomy template (the "same as" taxonomy template) had to contain a different internal template (such as Taxon variant rather than Don't edit this line).

(Had both the variant and "same as" taxonomy templates contained Don't edit this line (({machine code|))}, then to obtain, for example, the value of parent for a variant taxonomy template would have involved the variant taxonomy template calling Don't edit this line parent, which then called Don't edit this line parent again, this time from the "same as" taxonomy template. This would have created a loop, which is forbidden. By converting to Lua, the loop problem has been avoided.)

((Don't edit this line (({machine code|))}
Hence /skip and /? templates are now coded using Don't edit this line and same_as.