Jump to content

Module:Autotaxobox/doc

From Simple English Wikipedia, the free encyclopedia
Revision as of 19:51, 1 January 2017 by Peter coxhead (talk | changes) (update count of transclusions)

This is the documentation page for Module:Autotaxobox

Module:Autotaxobox (talk · edit · hist · links · doc · subpages · sandbox · testcases)

The purpose of this module is to provide support for automated taxobox templates (such as {{Automatic taxobox}} or {{Speciesbox}}), 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 Script error: No such module "Autotaxobox/sandbox". levels.

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:

{{#invoke:Autotaxobox|taxoboxColour|Felis}} → rgb(235,235,210)
{{#invoke:Autotaxobox|taxoboxColour|Acacia}} → rgb(180,250,180)

taxoboxList

Given a taxon name, this function returns the rows of taxa in an automated taxobox, based on the taxonomic hierarchy for the supplied taxon.

Usage:

{{#invoke:Autotaxobox|taxoboxList|taxon_name
|display_taxa = the number of taxa above taxon_name to force to be displayed
|authority = taxonomic authority for taxon_name
|parent_authority = taxonomic authority for taxon_name's parent
|gparent_authority = taxonomic authority for taxon_name's grandparent
|ggparent_authority = taxonomic authority for taxon_name's greatgrandparent
|ggparent_authority = taxonomic authority for taxon_name's greatgreatgrandparent
|bold_first = bold to embolden taxon_name in its row
}}

Parameters:

The unnamed parameter should be the name of a taxon for which "Template:Taxonomy/taxon_name" exists. The others are explained above.

Examples:

{| class="wikitable"
{{#invoke:Autotaxobox|taxoboxList|Felis|authority=Linnaeus, 1758}}
|}

Script error: No such module "Autotaxobox/sandbox".

taxonomyList

Given a taxon name, this function returns the rows of the taxonomy table displayed on the "Template:Taxonomy/taxon_name" page, based on the taxonomic hierarchy for the supplied taxon name.

When descending the taxonomic hierarchy, if a rank is found that is either at the same level or higher than a rank already encountered (e.g. a family is found below a subfamily), the cell displaying the rank is given a reddish background. The numerical values defined in getRankTable() are used to determine the correct sequence of ranks.

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:

{| class="wikitable"
{{#invoke:Autotaxobox|taxonomyList|Felis}}
|}

Script error: No such module "Autotaxobox/sandbox".

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. A taxon should always have a lower numerical value than one higher in the taxonomic hierarchy.

Usage:

{{#invoke:Autotaxobox|showRankTable}}

Utilities

These functions are intended to be used only in analysing taxonomic hierarchies, e.g. in testing and debugging, and not for direct use in templates used in the automated taxobox system.

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:

{{#invoke:Autotaxobox|nth|Felis|n=1}} → Felis
{{#invoke:Autotaxobox|nth|Felis|n=15}} → Boreoeutheria

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:

{{#invoke:Autotaxobox|nLevels|Felis}} → 41
{{#invoke:Autotaxobox|nLevels|Pteranodon}} → 42

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:

{{#invoke:Autotaxobox|listAll|Plantae}} → Plantae-regnum, Archaeplastida-clade, CAM-clade, Diaphoretickes-cladus, Eukaryota-domain, Life-
{{#invoke:Autotaxobox|listAll|Felis}} → Felis-genus, Felinae-subfamilia, Felidae-familia, Feloidea-superfamilia, Aeluroidea-clade, Feliformia-subordo, Carnivora-ordo, Carnivoraformes-clade, Carnivoramorpha-clade, Pan-Carnivora-clade, Ferae-mirordo-mb, Ferungulata-grandordo-mb, Scrotifera-clade, Laurasiatheria-superordo, Boreoeutheria-magnordo, Placentalia-infraclassis, Eutheria-clade, Theria/skip-subclassis, Mammalia/skip-classis, Amniota-clade, Reptiliomorpha-clade, Tetrapoda-cladus, Teleostomi-clade, Eugnathostomata-clade, Gnathostomata-infraphylum, Vertebrata-subphylum, Olfactores-clade, Chordata-phylum, Deuterostomia-superphylum, Nephrozoa-clade, Bilateria-clade, ParaHoxozoa-cladus, Eumetazoa-subregnum, Animalia-regnum, Filozoa-clade, Holozoa-clade, Opisthokonta-clade, Obazoa-cladus, Amorphea-cladus, Eukaryota/displayed-domain, Life-