وحدة:Autotaxobox/شرح
هذه صفحة توثيق لوحدة:Autotaxobox
This template is used on approximately 130٬000 pages. To avoid large-scale disruption and unnecessary server load, any changes to it should first be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can then be added to this page in a single edit. Please consider discussing changes on the talk page قبل تنفيذهم. |
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
Module:Autotaxobox (talk⧼dot-separator⧽+/−⧼dot-separator⧽hist⧼dot-separator⧽links⧼dot-separator⧽doc⧼dot-separator⧽subpages⧼dot-separator⧽sandbox⧼dot-separator⧽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 100 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}} → transparent
- {{#invoke:Autotaxobox|taxoboxColour|Acacia}} → transparent
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}} |}
→
أصنوفة غير معروفة (أصلحها): | الحياة |
مملكة: | الحيوانية |
Phylum: | حبليات |
Class: | الثدييات |
تحت فصيلة: | قطية |
الجنس: | القط Linnaeus, 1758 |
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}} |}
→
Bold ranks show taxa that will be shown in taxoboxes
because rank is principal or always_display=yes
.
callTaxonomyKey
This function prepares for, and then calls, {{Taxonomy key}} to display a taxonomy
template page. It does this by building up the information the template
requires, following one same_as
link if present, and then calling it.
Usage:
{{#invoke:Autotaxobox|callTaxonomyKey
|parent=
|rank=
|extinct=
|always_display=
|link_target=value of 'link' parameter in the taxonomy template
|link_text=value of unnamed parameter in the taxonomy template
|same_as=
}}
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. The function would normally be used externally via {{Taxon info}}.
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:
- {{#invoke:Autotaxobox|taxonInfo|Felis|rank}} → الجنس
- {{#invoke:Autotaxobox|taxonInfo|Aves/skip|same_as}} → Template:Taxonomy/Aves/skip
- {{#invoke:Autotaxobox|taxonInfo|Aves/skip|parent}} → Template:Taxonomy/Aves/skip
taxonLink
Returns a wikilink to a taxon, if required including '†' before it and ' (?)' after it, and optionally italicized or bolded without a wikilink. It would normally be used via {{Taxon link}}. Some parameters can, under some circumstances, be omitted.
Usage:
{{#invoke:Autotaxobox|taxonLink
(having '/?' at the end triggers the output of ' (?)')
|taxon=
('yes' or 'true' trigger the output of '†')
|extinct=
('yes' makes the core output bold and not wikilinked)
|bold=
('yes' makes the core output italic)
|italic=
(without †, italics, etc.)
|link_target=target for the wikilink
|plain_link_text= text of the wikilink
}}
Examples:
- {{#invoke:Autotaxobox|taxonLink|taxon=Felis|italic=yes}} → Felis
- {{#invoke:Autotaxobox|taxonLink|taxon=Incertae sedis/Animalia}} → incertae sedis
- {{#invoke:Autotaxobox|taxonLink|link_target=Pterosaur|plain_link_text=Pterosauromorpha|extinct=yes}} → †Pterosauromorpha
- {{#invoke:Autotaxobox|taxonLink|taxon=Dinosauria/?|link_target=Dinosaur|plain_link_text=Dinosauria|extinct=yes}} → †Dinosauria (?)
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}}
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}} → الوحوش الحقيقية
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}} → 39
- {{#invoke:Autotaxobox|nLevels|Pteranodon}} → 1
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, حقيقيات النوى-domain, حديثة_الجدران-فوق مملكة, الحياة-
- {{#invoke:Autotaxobox|listAll|Felis}} → Felis-الجنس, Felinae-تحت فصيلة, سنوريات-الفصيلة, شبيهات_القطط-subordo, آكلات_اللحوم-الرتبة, أشباه_آكلات_اللحوم-غير مرتبة, الأوابد-غير مرتبة, الحيوانات_المحبوبة-غير مرتبة, الأوابد_المجنحة-غير مرتبة, الأوابد_الظلفية-غير مرتبة, وحوش لوراسيا-فوق رتبة, الوحوش_الحقيقية_الشمالية-رتبة عظمى, المشيميات_غير_الأفريقية-تحت فرقة, المشيميات-تحت صف, الوحوش الحقيقية-clade, Mammalia-classis, أشباه_الثدييات/skip-الفرع الحيوي , مندمجات_الأقواس-الفرع الحيوي, Amniota-clade, Reptiliomorpha-clade, Tetrapoda-superclassis, Teleostomi-clade, Eugnathostomata-clade, Gnathostomata-infraphylum, Vertebrata-subphylum, Craniata-clade, Cephalochordata-subphylum, Chordata-phylum, Deuterostomia-superphylum, Nephrozoa-clade, Bilateria-clade, Eumetazoa-subregnum, Animalia-regnum, Filozoa-unranked, Holozoa-unranked, Opisthokonta-unranked, Unikonta-unranked, Eukaryota-domain, الحياة-