მოდული:Taxobox/ინფო
Sympetrum meridionale | |||
---|---|---|---|
სისტემატიკა | |||
სამეფო | Ცხოველები | ||
ქვედა სამეფო | Პირველადპირიანები | ||
superphylum | Ecdysozoa | ||
ტიპი | Ფეხსახსრიანები | ||
კლასი | Მწერები | ||
რიგი | Ნემსიყლაპიები | ||
ოჯახი | Libellulidae | ||
გვარი | Sympetrum | ||
სახეობა | S. meridionale | ||
Ლათინური სახელი - სახეობა | |||
Sympetrum meridionale | |||
Selys, 1841 | |||
დაცვის სტატუსი | |||
|
Python Royal | |||
---|---|---|---|
systématique | |||
clade | Episquamata | ||
clade | Toxicofera | ||
clade | Ophidia | ||
sous-ordre | Serpentes | ||
infra-ordre | Alethinophidia | ||
clade | Afrophidia | ||
super-famille | Pythonoidea | ||
famille | Pythonidae | ||
genre | Python | ||
espèce | P. regius | ||
Scientific name of espèce | |||
Python regius | |||
Shaw, 1802 | |||
synonyme | |||
Range map | |||
statut de conservation UICN | |||
|
This module is still unstable. Use with your own caution and report bugs and feature requests at Module talk:Taxobox or Wikidata talk:WikiProject_Taxonomy.
Taxobox.lua is a lua module which can automatically generate taxonomy infobox and is overwritable by classic taxobox parameters like species
, unranked_ordo
etc.
This module infobox is designed to be a replacement of Wikipedia's Taxobox. It provides configuration options which can control hypernym paths, show or hide certain ranks, specify content language and its configs, and make a callback and pass parameters to "classic" taxobox.
The following code
{{Taxobox | qid=Q464424 }}
creates the taxobox on the right hand side. The item to show is given with qid.
If you want to have this taxobox show up on each Wikidata taxon item: [1]
Internal
რედაქტირებაMethod taxobox
რედაქტირება
The taxobox
method provides function runs the above example. The method itself can be invoked with
{{#invoke: Taxobox | taxobox | qid=Q464424 | config[count]=10 }}
The number of parent taxons to show is given by config[count]
.
Method callback
რედაქტირება
The callback
method provides function to retrieve all internal parameters and pass them to an external template. The method can be invoked with like this
{{#invoke: Taxobox | callback | qid=Q464424 | template=OtherTaxobox | config[count]=10 }}
callback
accepts all arguments that taxobox
accepted. It also accepts an extra argument template
to specify name of the template to be expanded.
I18n
რედაქტირებაChange the i18n messages in Module:I18n/taxobox. I18n also specifys some format strings which can be use to customize the infobox output of certain language.
message | description | example(s) | |
---|---|---|---|
rank-format
|
Format of instances of
|
, or
713623 |
. Will be passed into 2 named arguments when rendering ranks:
{link}
- Wiki link to the rank
{label}
- Display title of the rank
"[[{link}|{label}]]"
: display name and give a hyperlink to the rank, or"{label}"
only display name of the rank
rank-format-<latinrank>
This argument is similar to rank-format
but can be use to specify the format of certain rank. The "<latinrank>" is a latin name, can be a instance of
427626 |
, or
713623 |
. For example "rank-format-cladus
" for
713623 |
. It accepts same 2 named arguments like rank-format
""
: don't display anything at this rank. Can be used to hide the rank name when the taxon is a clade"<i>(clade)</i>"
: use italic style"[[{link}|<span style=\"color:gray\">{label}</span>]]"
: use link and change color
item-format-current-with-vernacular-name
Format of instances of
16521 |
or
310890 |
. current
means either the item is the main taxon (specified by module argument qid
), or the item and all taxa between the item and main taxon (if any) are all
310890 |
. with-vernacular-name
means the item's 1843 or label exists and is different from 225.
4 named arguments will be passed on redering:
{link}
- Wiki link to the taxon item
{vernacular}
- The "common name" (the value of 1843 or item label) of taxon item in current language
{scientific}
- Full scientific name
{scientificshort}
- Short scientific name, for example "P. leo" of
140 |
Note: Don't use italic style here on scientific names. This style can be set by scientific-name-pattern
, scientific-name-repl
and other related messages.
"<b>{scientificshort}</b>"
: only display the short scientific name in bold weight"<b>{vernacular} {scientificshort}</b>"
: display both vernacular and short scientific name in bold weight"[[{link}|{vernacular}]]"
: display a hyperlink to target taxon with its vernacular name as label
item-format-current-with-vernacular-name
Format of instances of
16521 |
or
310890 |
. without-vernacular-name
means either both 1843 and label (in specified language) are empty, or the vernacular name is the same as 225.
4 named arguments will be passed on rendering, and they are same to item-format-current-with-vernacular-name
.
"[[{link}|{scientificshort}]]"
: display a hyperlink to target taxon with its short scientific name as label"[[{link}|{vernacular}]] ({scientficshort})"
: display both vernacular and short scientific name, also link to target taxon on from vernacular name
scientific-name-pattern
, scientific-name-repl
Pattern replacement to generate full scientific name. Can be override per rank by scientific-name-pattern-<latinrank>
and scientific-name-repl-<latinrank>
.
Not the format of scientific-name-pattern
and other *pattern*
messages are Lua's patterns, which are similar to
125267 |
but not identical. Read the manual to know how to write ones.
- (pattern)
"^.+$"
: match all non-empty strings- (repl)
"%0"
: do nothing for replacement, or - (repl)
"<i>%0</i>"
: put the scientific name in <i> tag so it can be rendered as italic
- (repl)
short-scientific-name-pattern
, short-scientific-name-repl
Pattern replacement to generate short scientific name. Can be override per rank by short-scientific-name-pattern-<latinrank>
and short-scientific-name-repl-<latinrank>
.
scientific-name-pattern-<latinrank>
, scientific-name-repl-<latinrank>
Pattern replcacement to generate full scientific name per rank. The "<latinrank>" is a latin name, can be a instance of
427626 |
, or
713623 |
. For example "scientific-name-pattern-species
" for
7432 |
.
- (
scientific-name-pattern-genus
)nil
: fallback toscientific-name-pattern
's"^.+$"
- (
scientific-name-repl-genus
)"<i>%0</i>"
: italicize full scientific name if its rank is
- (
34740 |
short-scientific-name-pattern-<latinrank>
, short-scientific-name-repl-<latinrank>
Pattern replcacement to generate short scientific name per rank. The "<latinrank>" is a latin name, can be a instance of
427626 |
, or
713623 |
. For example "short-scientific-name-pattern-species
" for
7432 |
.
- (
short-scientific-name-pattern-species
)"^(%w)%w+ (%w+)$"
: pattern to fetch the first letter of genus name (as %1) and the whole epithet (as %2) from the binomial of a species.- (
short-scientific-name-repl-species
)"<i>%1. %2</i>"
: for example, the result for
- (
140 |
is "P. leo"
scientific-name-replaces
or short-scientific-name-replaces
Pattern replacements to apply for all full (or short) scientific names, after the name has been processed by pattern-repl pair described above.
The value for each of two messages is not a string but a table. The table contains multiple pattern-repl pairs which will be applied to scientific names.
Note: Lua's table object doesn't sort, so the replacement sequence CAN NOT be guaranteed. DON'T DEPEND ON THE SEQUENCE YOU SAW!
Input Parameters
რედაქტირებაThe "<latinrank>" below is a latin name, can be an instance of
427626 |
, or
713623 |
. For example "display[cladus]"
.
Config Options
რედაქტირებაconfig[lang]
: content language (default:en
).config[count]
: maximum count of taxon to be recursively iterated (default: 10).config[references]
: a space-separated list of item ids. The references to favor in case of alternative claims. Optional.config[usetaxa]
: a space-separated list of item ids. The taxa to favor in case of alternative claims. Optional.config[link]
: if the value is "sitelink" it will use local wiki site links instead of wikidata item links.config[dryun]
: used forcallback
method. Displaying a <pre> block contains wikitext instead of expanding and rendering the template. Dryrun can be used to find parameters to be overrided.
Examples
რედაქტირებაᲚომი | |||
---|---|---|---|
სისტემატიკა | |||
ზერიგი | Laurasiatheria | ||
რიგი | Მტაცებლები | ||
ქვერიგი | Feliformia | ||
ოჯახი | Კატისებრნი | ||
ქვეოჯახი | Დიდი კატები | ||
გვარი | Პანთერა | ||
სახეობა | Ლომი | ||
Ლათინური სახელი - სახეობა | |||
Panthera leo | |||
Linnaeus, 1758 | |||
სინონიმი (ტაქსონომია) | |||
გავრცელების არეალი | |||
დაცვის სტატუსი | |||
აუდიო | |||
|
{{#invoke: taxobox | taxobox | qid = Q140 | config[usetaxa] = Q27379 |config[count] = 7 }}
Display Options
რედაქტირებაdisplay[<latinrank>]
: if the value is "n", "no", "false" or "hide", the specified rank (in latin name or QID) will be hide. Otherwise the rank will display.
For example, to hide all clades:
Ლომი | |||
---|---|---|---|
სისტემატიკა | |||
კლასი | Ძუძუმწოვრები | ||
რიგი | Მტაცებლები | ||
ქვერიგი | Feliformia | ||
ოჯახი | Კატისებრნი | ||
ქვეოჯახი | Დიდი კატები | ||
გვარი | Პანთერა | ||
სახეობა | Ლომი | ||
Ლათინური სახელი - სახეობა | |||
Panthera leo | |||
Linnaeus, 1758 | |||
სინონიმი (ტაქსონომია) | |||
გავრცელების არეალი | |||
დაცვის სტატუსი | |||
აუდიო | |||
|
{{#invoke:taxobox |taxobox |qid=Q140 |display[cladus]=hide }}
Classic Parameters
რედაქტირება<latinrank>
: The classic taxon parameters used by most
52496 |
. All of them can be overrided manually.
<latinrank>_authority
: The classic taxon authority parameters used by most
52496 |
. All of them can be overrided manually.
unranked_<latinrank>
: The classic unranked parameters used by most
52496 |
. All of them can be overrided manually.
If there are more than one clades between two taxon ranks, you can override them by appending [<number>]
index to the unranked_<latinrank>
parameter.
For example, there are 3 clades between rank genus and rank species. You can override them like this:
{{#invoke:taxobox |taxobox |... |unranked_species[3] = Cladus closest to genus rank |unranked_species[2] = The middle clade |unranked_species[1] = Cladus closest to species rank |... }}
Output Parameters
რედაქტირებაThe best way to see all output parameters is to use the config[dryrun]
parameter:
{{#invoke:taxobox |callback |qid=Q140 |config[dryrun]=yes }}
The result:
{{Taxobox |audio = Lion raring-sound1TamilNadu178.ogg |code = 13011 |color = pink |config[dryrun] = yes |image = 002 The lion king Snyggve in the Serengeti National Park Photo by Giles Laurent.jpg |iucn_status[id] = 278113 |iucn_status[image] = Status iucn3.1 VU.svg |iucn_status[label] = მოწყვლადი სახეობები |iucn_status[references] = Q115962546 |name = Ლომი |qid = Q140 |range_map = Lion distribution.png |rank[1][id] = 713623 |rank[1][is_extinct] = no |rank[1][is_monotypic] = no |rank[1][is_subject] = no |rank[1][latin] = cladus |rank[1][link] = Q5852697 |rank[1][raw_scientific] = Prozostrodontia |rank[1][references] = |rank[1][scientific] = Prozostrodontia |rank[1][taxon] = [[d:Q5852697|Prozostrodontia]] |rank[2][id] = 713623 |rank[2][is_extinct] = no |rank[2][is_monotypic] = no |rank[2][is_subject] = no |rank[2][latin] = cladus |rank[2][link] = Q28746016 |rank[2][raw_scientific] = Mammaliamorpha |rank[2][references] = |rank[2][scientific] = Mammaliamorpha |rank[2][taxon] = [[d:Q28746016|Mammaliamorpha]] |rank[3][id] = 713623 |rank[3][is_extinct] = no |rank[3][is_monotypic] = no |rank[3][is_subject] = no |rank[3][latin] = cladus |rank[3][link] = Q2082668 |rank[3][raw_scientific] = Mammaliaformes |rank[3][references] = |rank[3][scientific] = Mammaliaformes |rank[3][taxon] = [[d:Q2082668|Mammaliaformes]] |rank[4][id] = 37517 |rank[4][is_extinct] = no |rank[4][is_monotypic] = no |rank[4][is_subject] = no |rank[4][latin] = classis |rank[4][link] = Q7377 |rank[4][raw_scientific] = Mammalia |rank[4][references] = Q19302303 Q1538807 Q21608408 |rank[4][scientific] = Mammalia |rank[4][taxon] = [[ძუძუმწოვრები|Ძუძუმწოვრები]] |rank[4][vernacular] = Ძუძუმწოვრები |rank[5][id] = 36602 |rank[5][is_extinct] = no |rank[5][is_monotypic] = no |rank[5][is_subject] = no |rank[5][latin] = ordo |rank[5][link] = Q25306 |rank[5][raw_scientific] = Carnivora |rank[5][references] = Q82575 Q1538807 Q19604469 Q21682704 Q19302303 |rank[5][scientific] = Carnivora |rank[5][taxon] = [[მტაცებლები|Მტაცებლები]] |rank[5][vernacular] = Მტაცებლები |rank[6][id] = 5867959 |rank[6][is_extinct] = no |rank[6][is_monotypic] = no |rank[6][is_subject] = no |rank[6][latin] = subordo |rank[6][link] = Q27070 |rank[6][raw_scientific] = Feliformia |rank[6][references] = Q19302303 Q19604469 Q1538807 Q82575 |rank[6][scientific] = Feliformia |rank[6][taxon] = [[d:Q27070|Feliformia]] |rank[7][id] = 35409 |rank[7][is_extinct] = no |rank[7][is_monotypic] = no |rank[7][is_subject] = no |rank[7][latin] = familia |rank[7][link] = Q25265 |rank[7][raw_scientific] = Felidae |rank[7][references] = Q82575 Q1538807 Q19604469 Q19771288 Q19302303 |rank[7][scientific] = Felidae |rank[7][taxon] = [[კატისებრნი|Კატისებრნი]] |rank[7][vernacular] = Კატისებრნი |rank[8][id] = 164280 |rank[8][is_extinct] = no |rank[8][is_monotypic] = no |rank[8][is_subject] = no |rank[8][latin] = subfamilia |rank[8][link] = Q230177 |rank[8][raw_scientific] = Pantherinae |rank[8][references] = Q82575 Q19604469 Q1538807 Q56211181 |rank[8][scientific] = Pantherinae |rank[8][taxon] = [[დიდი კატები|Დიდი კატები]] |rank[8][vernacular] = Დიდი კატები |rank[9][id] = 34740 |rank[9][is_extinct] = no |rank[9][is_monotypic] = no |rank[9][is_subject] = no |rank[9][latin] = genus |rank[9][link] = Q127960 |rank[9][raw_scientific] = Panthera |rank[9][references] = Q82575 Q1538807 Q19604469 Q43385197 Q77980496 |rank[9][scientific] = <i>Panthera</i> |rank[9][taxon] = [[პანთერა|Პანთერა]] |rank[9][vernacular] = Პანთერა |rank[10][authority] = [[კარლ ლინე|Linnaeus]], 1758 |rank[10][id] = 7432 |rank[10][is_extinct] = no |rank[10][is_monotypic] = no |rank[10][is_subject] = yes |rank[10][latin] = species |rank[10][link] = Q140 |rank[10][raw_scientific] = Panthera leo |rank[10][references] = Q1538807 |rank[10][scientific] = <i>Panthera leo</i> |rank[10][taxon] = <b>Ლომი</b> |rank[10][vernacular] = Ლომი |rank[references] = Q30135809 Q1538807 Q796451 Q30136284 Q33883775 Q19302303 Q28191107 Q30136117 Q82575 |rank[size] = 10 |synonym[1][author] = [[კარლ ლინე|Linnaeus]], 1758 |synonym[1][link] = d:Q15294488 |synonym[1][name] = Felis leo |synonym[size] = 1 |taxon = Panthera leo }}
All output parameters can be overrided by specifying same name input parameters. For example this will replace
34740 |
to "Foo" and
2455704 |
"Bar":
Ლომი | |||
---|---|---|---|
სისტემატიკა | |||
კლადა | Prozostrodontia | ||
კლადა | Mammaliamorpha | ||
კლადა | Mammaliaformes | ||
კლასი | Ძუძუმწოვრები | ||
რიგი | Მტაცებლები | ||
ქვერიგი | Feliformia | ||
ოჯახი | Კატისებრნი | ||
ქვეოჯახი | Bar | ||
გვარი | Foo | ||
სახეობა | Ლომი | ||
Ლათინური სახელი - სახეობა | |||
Panthera leo | |||
Linnaeus, 1758 | |||
სინონიმი (ტაქსონომია) | |||
გავრცელების არეალი | |||
დაცვის სტატუსი | |||
აუდიო | |||
|
{{#invoke:taxobox |taxobox |qid=Q140 |subfamilia=<strong style="color: green">Bar</strong> |rank[9][taxon]=<strong style="color: red">Foo</strong> }}
Supported properties
რედაქტირებაThe taxobox currently supports:
- 18 for taxon images and red list status
- 31: for
310890 |
and
14594740 |
- 105
- 141 also mark the taxon extinct if the value is
237350 |
- 171
- 181
- 225
- 248 for references
- 405
- 428
- 523
- 524 also mark the taxon extinct if present
- 566
- 574
- 582 mark the taxon extinct if present
- 697
- 428 if ICNafp applies, otherwise:
- 835, otherwise the last name of English language (en) is shown.
- 944 for authority string format and color.
- 1843, common name of a language to override the item label of the language
Wikipedia use
რედაქტირებაThis module is designed to be a replacement for Wikipedia taxoboxes. However, it is still unstable and need plenty extra template works to allow a classic
52496 |
to accept the new callback parameters. Suggestion and bug reports are welcome at d:Module talk:Taxobox or d:Wikidata talk:WikiProject_Taxonomy.
სქოლიო
რედაქტირებაეს არის „მოდული:Taxobox“-ის დოკუმენტაციის გვერდი