模組:Autotaxobox/doc
此頁面為 Module:Autotaxobox 的說明文件
此模組使用Lua語言: |
此模組文件被引用於約181,000個頁面。 為了避免造成大規模的影響,所有對此模組文件的編輯應先於沙盒或測試樣例上測試。 測試後無誤的版本可以一次性地加入此模組文件中,但是修改前請務必於討論頁發起討論。 模板引用數量會自動更新。 |
此模組文件已被保護。此為高度可見模組文件,其已用於大量條目或被頻繁替換引用。由於破壞或失誤會影響諸多頁面,即便細小的改動也可能導致大量伺服器負載,因此已被保護,不可編輯。 |
Module:Autotaxobox (talk · · hist · links · doc · subpages · sandbox · testcases)
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 100 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:
- {{#invoke:Autotaxobox|taxoboxColour|Felis}} → rgb(235,235,210)
- {{#invoke:Autotaxobox|taxoboxColour|Acacia}} → rgb(180,250,180)
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|taxoboxList
|the name of taxon upwards from which the taxonomic hierarchy is to be displayed by this function
|display_taxa = the number of taxa above taxon to force to be displayed
|authority = taxonomic authority for the lowest level taxon in the taxobox (the taxobox_target) (see also offset below)
|parent_authority = taxonomic authority for taxobox_target's parent
|gparent_authority = taxonomic authority for taxobox_target's grandparent
|ggparent_authority = taxonomic authority for taxobox_target's greatgrandparent
|gggparent_authority = taxonomic authority for taxobox_target's greatgreatgrandparent
|bold_first = bold to embolden taxon in its row
|offset = the offset of taxon from taxobox_target – the number of steps from taxobox_target to taxon
}}
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}} |}
→
界: | 動物界 Animalia |
門: | 脊索動物門 Chordata |
綱: | 哺乳綱 Mammalia |
目: | 食肉目 Carnivora |
科: | 貓科 Felidae |
演化級: | 假貓級 Pseudaelurus |
亞科: | 貓亞科 Felinae |
屬: | 貓屬 Felis 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 at either the same or a higher level than a rank already encountered (e.g. a family is found below a subfamily), the cell displaying the rank is given a reddish background; if it's the supplied taxon, the article is put into the tracking category Category:Taxonomy templates showing anomalous ranks. The numerical values defined in getRankTable()
are used to determine the correct sequence of ranks. Ranks without values in this table do not have their order checked.
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:
{{#invoke:Autotaxobox|taxonomyList|Felis}}
→
粗體層級代表主要層級或者已被設置
為「總是顯示」(always_display=yes
)
上級分類單元 | |||
---|---|---|---|
域: | 真核域 Eukaryota | [檢視 · 編輯] | |
演化支: | 單鞭毛生物 Amorphea | [檢視 · 編輯] | |
演化支: | OBA 超類群 Obazoa | [檢視 · 編輯] | |
演化支: | 後鞭毛生物 Opisthokonta | [檢視 · 編輯] | |
總界: | 動物總界 Holozoa | [檢視 · 編輯] | |
演化支: | 蜷絲動物 Filozoa | [檢視 · 編輯] | |
演化支: | 領鞭毛動物 Choanozoa | [檢視 · 編輯] | |
界: | 動物界 Animalia | [檢視 · 編輯] | |
亞界: | 真後生動物亞界 Eumetazoa | [檢視 · 編輯] | |
演化支: | 副同源異形基因動物 ParaHoxozoa | [檢視 · 編輯] | |
演化支: | 兩側對稱動物 Bilateria | [檢視 · 編輯] | |
演化支: | 腎管動物 Nephrozoa | [檢視 · 編輯] | |
總門: | 後口動物總門 Deuterostomia | [檢視 · 編輯] | |
門: | 脊索動物門 Chordata | [檢視 · 編輯] | |
..... | ..... | ||
綱: | 哺乳綱 Mammalia | /skip | [檢視 · 編輯] |
演化支: | 獸形類 Theriimorpha | [檢視 · 編輯] | |
演化支: | 獸型類 Theriiformes | [檢視 · 編輯] | |
演化支: | Trechnotheria | [檢視 · 編輯] | |
演化支: | 歧獸類 Cladotheria | [檢視 · 編輯] | |
演化支: | 原磨楔齒類 Prototribosphenida | [檢視 · 編輯] | |
演化支: | Zatheria | [檢視 · 編輯] | |
演化支: | 磨楔齒類 Tribosphenida | [檢視 · 編輯] | |
亞綱: | 獸亞綱 Theria | [檢視 · 編輯] | |
下綱: | 真獸下綱 Eutheria | [檢視 · 編輯] | |
演化支: | 有胎盤類 Placentalia | [檢視 · 編輯] | |
高目: | 北方真獸高目 Boreoeutheria | [檢視 · 編輯] | |
總目: | 勞亞獸總目 Laurasiatheria | [檢視 · 編輯] | |
演化支: | 有陰囊類 Scrotifera | [檢視 · 編輯] | |
大目: | 猛獸有蹄大目 Ferungulata | [檢視 · 編輯] | |
上目: | 猛獸上目 Ferae | [檢視 · 編輯] | |
演化支: | 泛食肉類 Pan-Carnivora | [檢視 · 編輯] | |
演化支: | 食肉形類 Carnivoramorpha | [檢視 · 編輯] | |
演化支: | 食肉型類 Carnivoraformes | [檢視 · 編輯] | |
目: | 食肉目 Carnivora | [檢視 · 編輯] | |
亞目: | 貓型亞目 Feliformia | [檢視 · 編輯] | |
總科: | 貓總科 Feloidea | [檢視 · 編輯] | |
科: | 貓科 Felidae | [檢視 · 編輯] | |
演化級: | 假貓級 Pseudaelurus | /grade | [檢視 · 編輯] |
亞科: | 貓亞科 Felinae | [檢視 · 編輯] | |
屬: | 貓屬 Felis | [檢視 · 編輯] |
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.
It is used by {{Don't edit this line}}.
Usage:
{{#invoke:Autotaxobox|callTaxonomyKey
|taxon=
|parent=
|rank=
|extinct=
|always_display=
|link_target=value of the 'link' parameter in the taxonomy template
|link_text=value of the unnamed parameter in the taxonomy template
|refs=
|same_as=
}}
showRefs
Shows the refs field in a taxonomy template, handing incertae sedis taxa and using '–' for absent refs.
Usage:
- {{#invoke:Autotaxobox|showRefs|taxon_name|refs}}
Examples:
- {{#invoke:Autotaxobox|showRefs|Neoscona|{{Taxon info|Neoscona|refs}}}} → –
- {{#invoke:Autotaxobox|showRefs|Incertae sedis/Characidae|}} → not applicable (incertae sedis)
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:
{{#invoke:Autotaxobox|taxonLink
(having '/?' at the end triggers the output of ' (?)')
|taxon=
('yes' or 'true' triggers 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 (?)
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.
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}}
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:
- {{#invoke:Autotaxobox|taxonInfo|Felis|rank}} → genus
- {{#invoke:Autotaxobox|taxonInfo|Aves/skip|same_as}} → Aves
- {{#invoke:Autotaxobox|taxonInfo|Aves/skip|parent}} → Chordata
getMaxSearchLevels
Returns the maximum number of levels of a taxonomic hierarchy encoded in taxonomy templates that the system will search.
Usage:
{{#invoke:Autotaxobox|getMaxSearchLevels}}
→ 100
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}}
→ Carnivora{{#invoke:Autotaxobox|find|Felis|classis}}
→ Mammalia/skip{{#invoke:Autotaxobox|find|Pteranodon|phylum}}
→ Chordata{{#invoke:Autotaxobox|find|Pteranodon|classis}}
→ Sauropsida
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}} → 52
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-cladus, CAM-cladus, Diaphoretickes-cladus, Eukaryota-domain, Life-
- {{#invoke:Autotaxobox|listAll|Felis}} → Felis-genus, Felinae-subfamilia, Pseudaelurus/grade-grade, Felidae-familia, Feloidea-superfamilia, Feliformia-subordo, Carnivora-ordo, Carnivoraformes-cladus, Carnivoramorpha-cladus, Pan-Carnivora-cladus, Ferae-mirordo-mb, Ferungulata-grandordo-mb, Scrotifera-cladus, Laurasiatheria-superordo, Boreoeutheria-magnordo, Placentalia-cladus, Eutheria-infraclassis, Theria-subclassis, Tribosphenida-cladus, Zatheria-cladus, Prototribosphenida-cladus, Cladotheria-cladus, Trechnotheria-cladus, Theriiformes-cladus, Theriimorpha-cladus, Mammalia/skip-classis, Chordata-phylum, Deuterostomia-superphylum, Nephrozoa-cladus, Bilateria-cladus, ParaHoxozoa-cladus, Eumetazoa-subregnum, Animalia-regnum, Choanozoa-cladus, Filozoa-cladus, Holozoa-superregnum, Opisthokonta-cladus, Obazoa-cladus, Amorphea-cladus, Eukaryota-domain, Life-