跳转到内容

模組:Autotaxobox/doc

维基百科,自由的百科全书

这是本页的一个历史版本,由白布飘扬留言 | 贡献2017年6月3日 (六) 06:30编辑。这可能和当前版本存在着巨大的差异。

这是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 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}} → 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}}
|}

界: 动物界 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 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}}
|}

粗體層級代表主要層級或者已被設置
為“總是顯示”(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.

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}} → genus
{{#invoke:Autotaxobox|taxonInfo|Avialae/skip|same_as}} →
{{#invoke:Autotaxobox|taxonInfo|Avialae/skip|parent}} → Theropoda/skip

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
|taxon=
(having '/?' at the end triggers the output of ' (?)')
|extinct=
('yes' or 'true' trigger the output of '†')
|bold=
('yes' makes the core output bold and not wikilinked)
|italic=
('yes' makes the core output italic)
|link_target=target for the wikilink
|plain_link_text= text of the wikilink
(without †, italics, etc.)
}}

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. 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}} → 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-