มอดูล:Autotaxobox/doc

Module:Autotaxobox 
The purpose of this module is to provide support for the automated taxobox system (including templates such as Speciesbox and Automatic taxobox), avoiding Mediawiki template expansion depth errors in the traversal of the taxonomic hierarchies encoded in taxonomy templates.
Currently, processing is arbitrarily limited to hierarchies containing at most getMaxSearchLevels levels.
See the automated taxobox system map for information on how the module's functions are used in the system.

**taxoboxColour**
Given a taxon name, this function returns the correct colour of an automated taxobox for that taxon. It does so by searching up the taxonomic hierarchy for a 'real' taxon (i.e. not incertae sedis) that sets the taxobox colour, and then returning that colour. If no 'real' taxon is found, then if an incertae sedis taxon was found, the incertae sedis colour is returned, otherwise "transparent" is returned. (If the taxonomic hierarchy is too deep to process, the error colour is returned.)
Usage:
#invoke:Autotaxobox|taxoboxColour|taxon_name
Parameters:
The unnamed parameter should be the name of a taxon for which "Template:Taxonomy/taxon_name" exists.
Examples:
 → Felis
 → Acacia

**taxoboxList**
Given the name of a taxon, this function returns the rows of taxa in an automated taxobox, based on the taxonomic
hierarchy for the supplied taxon. If the lowest taxon displayed in the taxobox is below the rank of genus, the 
supplied taxon will usually be at a higher rank than the taxobox's target taxon, so that there is an offset to be
taken into account.
Usage:
#invoke:Autotaxobox|taxonomyList|taxon_name
Parameters:
The unnamed parameter should be the name of a taxon for which "Template:Taxonomy/taxon_name" exists.
Examples:
Felis →

**callTaxonomyKey**
This function prepares for, and then calls, Taxonomy key to display a taxonomy
template page (which in turn invokes taxonomyList from this module). It does this by building up the information the template
requires, following one same_as link if present, and then calling it.
It is used by Don't edit this line.
Usage:
#invoke:Autotaxobox|showRefs|taxon_name|refs
Examples:
#invoke:Autotaxobox|showRefs|Incertae sedis/Characidae| → 

**taxonLink**
Returns a wikilink to a taxon, if required including '†' before it and
' (?)' after it, and optionally italicized or bolded without a wikilink.
It can be used externally via Taxon link. Some parameters can, under
some circumstances, be omitted.
Usage:
→ italic=yes
 → taxon=Incertae sedis/Animalia
 → extinct=yes
 → extinct=yes

**taxonInfo**
Given the names of a taxon and the required item of information stored in the taxon's taxonomy template, this function returns the value of the item, following one "same as" link if available and the value would otherwise be the empty string.
Usage:
#invoke:Autotaxobox|taxonInfo|taxon_name|item_name
Parameters:
The first unnamed parameter should be the name of a taxon for which "Template:Taxonomy/taxon_name" exists.
The possible values of the second unnamed parameter are given at Taxon info/doc.
Examples:
 → rank
 → same_as
 → parent

**Utilities**
These functions are intended to be used only in analysing and understanding the automated taxobox system, including the taxonomic hierarchies encoded in taxonomy templates – for example in testing and debugging. They are not part of the functioning of the automated taxobox system.

**getMaxSearchLevels**
Returns the maximum number of levels of a taxonomic hierarchy encoded in taxonomy templates that the system will search.
Usage:
#invoke:Autotaxobox|getMaxSearchLevels → getMaxSearchLevels

**showRankTable**
Returns a sortable wikitable containing the ranks and corresponding numerical values defined in getRankTable() and used in checking the consistency of a taxonomic hierarchy. If a taxon has a value in the rank table, it should always be lower than one higher in the taxonomic hierarchy.
Usage:
#invoke:Autotaxobox|showRankTable

**find**
Given a taxon name and a rank, this function returns the taxon's ancestor of the given rank.
Usage:
#invoke:Autotaxobox|find|taxon_name|rank
Parameters:
The first unnamed parameter should be the name of a taxon for which "Template:Taxonomy/taxon_name" exists.
The second unnamed parameter should be the Latinized name of a rank.
Examples:
#invoke:Autotaxobox|find|Felis|ordo  → ordo
#invoke:Autotaxobox|find|Felis|classis  → classis
#invoke:Autotaxobox|find|Pteranodon|phylum → phylum
#invoke:Autotaxobox|find|Pteranodon|classis → classis

**nth**
Given a taxon name, this function returns the nth taxon above it in the taxonomic hierarchy.
Usage:
#invoke:Autotaxobox|nth|taxon_name|n=integer
Parameters:
The unnamed parameter should be the name of a taxon for which "Template:Taxonomy/taxon_name" exists.
n is the level whose taxon is to be found
Examples:
 → n=1
 → n=15

**nLevels**
Given a taxon name, this function returns the number of levels at and above it in the taxonomic hierarchy.
Usage:
#invoke:Autotaxobox|nLevels|taxon_name
Parameters:
The unnamed parameter should be the name of a taxon for which "Template:Taxonomy/taxon_name" exists.
Examples:
 → Felis
 → Pteranodon

**listAll**
Given a taxon name, this function returns a comma-separated list of all the levels at and above it in the taxonomic hierarchy.
Usage:
#invoke:Autotaxobox|listAll|taxon_name
Parameters:
The unnamed parameter should be the name of a taxon for which "Template:Taxonomy/taxon_name" exists.
Examples:
 → Plantae
 → Felis

**removeQualifier**
Given a taxon name, this function returns the name with any qualifier (i.e. any part after a "/") removed.
Usage:
#invoke:Autotaxobox|removeQualifier|taxon_name
Examples:
 → Eukaryota/display
 → Felis