Module:Autotaxobox/doc: Difference between revisions

Content deleted Content added
m taxoboxList: new line
another module that is used
 
(20 intermediate revisions by 5 users not shown)
Line 1:
{{High-risk|218790}}
{{Module rating|protected}}
{{Lua|Module:TaxonItalics|Module:Taxobox ranks}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
Line 11 ⟶ 12:
| 6 = [[Special:PrefixIndex/Module:Autotaxobox|subpages]]
| 7 = [[Module:Autotaxobox/sandbox|sandbox]]
| 8 = [[Module talk:Autotaxobox/testcases|testcases]]
}}
 
Line 45 ⟶ 46:
 
<code><nowiki>{{</nowiki>#invoke:Autotaxobox|taxoboxList<br>
|''the name of taxon upwards from which the taxonomic hierarchy is to be displayed by this function''<br>
|''taxon''<br>
|display_taxa = ''the number of taxa above taxon to force to be displayed''<br>
|authority = ''taxonomic authority for the lowest level taxon in the taxobox (the taxobox_target) (see also offset below)''<br>
|parent_authority = ''taxonomic authority for taxobox_target's parent''<br>
|gparent_authority = ''taxonomic authority for taxobox_target's grandparent''<br>
Line 53 ⟶ 54:
|gggparent_authority = ''taxonomic authority for taxobox_target's greatgreatgrandparent''<br>
|bold_first = ''bold to embolden taxon in its row''<br>
|offset = ''the offset of the taxon from taxobox_target – the number of steps from taxobox_target to taxon''<br>
}}</code>
 
Line 83 ⟶ 84:
 
Examples:
<pre>{{#invoke:Autotaxobox|taxonomyList|Felis}}</pre> →
<pre>{| class="wikitable"
{{#invoke:Autotaxobox|taxonomyList|Felis}}
|}</pre> →
{| class="wikitable"
|{{#invoke:Autotaxobox|taxonomyList|Felis}}
|}
 
== callTaxonomyKey ==
This function prepares for, and then calls, {{tl|Taxonomy key}} to display a taxonomy
template page (which in turn invokes [[#taxonomyList|<code>taxonomyList</code>]] from this module). It does this by building up the information the template
requires, following one <code>same_as</code> link if present, and then calling it.
 
Line 145 ⟶ 144:
:<nowiki>{{#invoke:Autotaxobox|taxonLink|taxon=Dinosauria/?|link_target=Dinosaur|plain_link_text=Dinosauria|extinct=yes}}</nowiki> → {{#invoke:Autotaxobox|taxonLink|taxon=Dinosauria/?|link_target=Dinosaur|plain_link_text=Dinosauria|extinct=yes}}
 
==UtilitiestaxonInfo==
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 <code>getRankTable()</code> 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:
 
:<code><nowiki>{{</nowiki>#invoke:Autotaxobox|showRankTable}}</code>
 
===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.
 
Line 169 ⟶ 158:
:<nowiki>{{#invoke:Autotaxobox|taxonInfo|Aves/skip|same_as}}</nowiki> → {{#invoke:Autotaxobox|taxonInfo|Aves/skip|same_as}}
:<nowiki>{{#invoke:Autotaxobox|taxonInfo|Aves/skip|parent}}</nowiki> → {{#invoke:Autotaxobox|taxonInfo|Aves/skip|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===
Line 240 ⟶ 232:
:<nowiki>{{#invoke:Autotaxobox|listAll|Plantae}}</nowiki> → {{#invoke:Autotaxobox|listAll|Plantae}}
:<nowiki>{{#invoke:Autotaxobox|listAll|Felis}}</nowiki> → {{#invoke:Autotaxobox|listAll|Felis}}
 
===removeQualifier===
Given a taxon name, this function returns the name with any qualifier (i.e. any part after a "/") removed.
 
Usage:
 
:<code><nowiki>{{</nowiki>#invoke:Autotaxobox|showRankTableremoveQualifier|''taxon_name''}}</code>
 
Examples:
 
:<nowiki>{{#invoke:Autotaxobox|removeQualifier|Eukaryota/display}}</nowiki> → {{#invoke:Autotaxobox|removeQualifier|Eukaryota/display}}
:<nowiki>{{#invoke:Autotaxobox|removeQualifier|Felis}}</nowiki> → {{#invoke:Autotaxobox|removeQualifier|Felis}}
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Taxobox templates]]
 
}}</includeonly>
<noinclude>
[[Category:Module documentation pages]]
</noinclude>