Template:Taxobox-fr
Template Taxobox-fr is used to produce a taxobox on articles, and are scientific-classification-infoboxes for biology (animals, plants…).
It should be used on any article that describe a scientificaly described taxa, of any level. It should not be used for terms that are do not strictly apply to a taxa.
Technical information
editThis template uses the function taxobox from Lua module Taxobox-fr, which in turn uses modules Taxobox-outils (various tools), Taxobox-data (mostly all texts selectors and valid values for parameters) and Taxobox-briques (basic elements for building wikitext/HTML code that generates the different parts of the taxobox. Note: in future these basic elements should be in a non-dedicated module used by several/every infoboxes).
Syntax
editThe syntax of this monolytic template relies on named and unamed parameters. There are very few editorial named parameters (most of them are just used to control to output).
Named parameters
edit- règne: the regnum of the described taxa. It means that regnum is not given anymore in the rest of the taxobox template
- nv (or nom vernaculaire): the vernacular name(s). Optional. Used for subtitle stuff.
Named parameters that control output (bold is default one):
- titre: oui, non, auto. Always, never, or depending on article namespace modify title typography if needed.
- sous-titre: oui, non, auto. Always, never, or depending on article namespace add the subtitle if needed.
- erreurs: oui, non, auto. Always, never, or depending on article namespace display errors (if any) in a dedicated box.
- catégories: en ligne, boîte, non, auto. Inline, in box, never or depending on article namespace insert information categories.
- catégories erreurs: en ligne, boîte, non, auto. Inline, in box, never or depending on article namespace insert errors categories.
Debug named parameters, dedicated to developpers only:
- debug: oui, non. Add (or not) debug messages in output. Don't do anything at this time.
- raw: oui, non. Print (or not) the taxobox result in raw (not wikified) format.
Unamed parameters
editAfter named parameters all the taxobox content is described with unamed parameters.
The description is compouned by a set of parameters (in the order they are given) starting with a valid keyword − which describe the kind of element to add − followed by its parameters, ended by a newline (note: this point may/will change).
The keywords correspond (mostly) to the template names of current taxobox, followed by the same parameters, in the same order. The main differences are:
- keyword is more simple as "taxobox" is not present. Example: {{Taxobox taxon}} → taxon.
- the name for {{Taxobox}} is different (as it would be empty): rang.
- the "début" don't need to give the taxobox title, as it is automatically extracted from taxobox content (the described taxa).
- the regnum parameter is no more present in parameters (appart for the named parameter règne).
- named parameters present in current taxobox templates are managed in a different way:
- named parameters that are "yes/no": only give the parameter name. Example: {{Taxobox | genre | Uroplatus | ancien=oui}} becomes |rang | genre | Uroplatus | ancien.
- named parameters that has a value: the "=" becomes a "|" (a separated parameter). Example: {{Taxobox début | animal | ''Uroplatus guentheri'' | Uroplatus guentheri male.jpg | ''Uroplatus guentheri'' mâle|classification=ReptileDB }} becomes |début | Uroplatus guentheri male.jpg | Uroplatus guentheri mâle | classification | ReptileDB.
Complete list of keywords and their associated syntax. Each line contains: the keyword; then the list of "unamed" parameters, in the order they are used; then the list of "flag" parameters, with just the name of the flag, which is present or not, wherever it appears; then the list of named parameters which must be given in the form "|named-parameter|value", wherever it appears. Each kind of elements can be empty.
Please see later for the detailed explanation of each line or the role of parameters.
- début
- unamed: image, légende
- flags: phylo
- named: classification
- taxon
- unamed: rang, nom, auteur
- flags: titre, sans auteur
- named: obsolète
- rang
- unamed: rang, nom, lien
- flags: ancien
- named:
- fin
- unamed:
- flags:
- named:
- uicn
- unamed: risque, critère, lien
- flags:
- named:
- cites
- unamed: annexe, date, précision
- flags:
- named:
- synonymes
- unamed: synonymes
- flags:
- named:
- taxons
- unamed: texte, texte2
- flags:
- named:
- parents
- unamed: sexe1, taxon1, sexe2, taxon2
- flags:
- named:
- image
- unamed: image, légende
- flags: séparateur
- named:
- répartition
- unamed: image, légende, taille
- flags: séparateur
- named:
- légende répartition
- unamed: légende
- flags:
- named:
- conflit
- unamed: rang, nom1, site1, nom2, site2, nom3, site3
- flags:
- named:
- phylogénie bandeau
- unamed: image
- flags:
- named: classification, image
- phylogénie inexistant
- unamed: classification
- flags:
- named:
- position
- unamed: arbre, frère
- flags:
- named:
Description of each keyword
editdébut
editMust be the first line. Describes the main header.
- unamed: image, légende : all optional. The image and its legend, if any. Legend not printed if no image is given.
- flags: phylo : if present, means that this taxa does not exists in classical classification, so "début" must not be followed by a classification.
- named: classification : the classification followed in the taxobox/article. Optional.
taxon
editDescribe the taxa of the taxobox. Can be present more than one time (in case of monotypic taxa).
- unamed: rang, nom, auteur : the level, name and author+date. The two first are mandatory. If the last is omited a "author missing" is inserted.
- flags: titre, sans auteur : titre is used to indicate that this taxa should be considered as the article subject. This should not occurs (by default the last given taxa is used). sans auteur allow not to print the "author missing" stuff if no author is given.
- named: obsolète : means that the current taxa is obsolete. It must contains the name of the new taxa that replaces the old one.
rang
editUsed to add a line of classification.
- unamed: rang, nom, lien : the two first are mandatory (the level and the name of the corresp. taxa in higher classification). The last one can be used if "nom" is an homonymy. In this case link will be with the form [[lien|nom]].
- flags: ancien : the classification line is printed striked. Indicates that this entry is no more valid.
- named:
fin
editTerminates a taxobox. No parameter. Not mandatory: the module closes the taxobox when it reach the end of the description.
- unamed:
- flags:
- named:
uicn
editUsed to describe IUCN status of the taxa (species).
- unamed: risque, critère, lien : "risque" is the IUCN code (VU, EN, DD, LC…). Other are not mandatory. "critère" is the criteria used by IUCN.
- flags:
- named:
cites
editUsed to describe CITES annexe for this taxa.
- unamed: annexe, date, précision : "annexe" is mandatory and should be I, II or III. "date" is the associated date and "précision" a precision (such as for which country or for which subspecies). The two last are not mandatory.
- flags:
- named:
synonymes
editDescribes the known synonyms for this taxa.
- unamed: synonymes : the list of synonyms. Most of the time a doted list of scientific names + author + date. Mandatory.
- flags:
- named:
taxons
editUsed to give the lower taxa of the described taxa.
- unamed: texte, texte2 : if non given just prints "Voir texte" (see text). If only "texte" is given print its content. If both are given the first one describes the level of the lower taxa, and the second becomes the printed content.
- flags:
- named:
parents
editUsed to describe parents in case of an hybrid (do not use with other kind of taxa).
- unamed: sexe1, taxon1, sexe2, taxon2 : all mandatory. Sex and name of first parent, sex and name of second parent. If sex is not relevant use "A" and "B".
- flags:
- named:
image
editUsed to insert an image with optional legend in the taxobox.
- unamed: image, légende : the image (mandatory) and the legend (optional).
- flags: séparateur : if present a small horizontal separation line is printed before the image.
- named:
répartition
editUsed to add a distribution image of the taxa.
- unamed: image, légende, taille : image (mandatory), legend (optional), and image size (do not use!)
- flags: séparateur : if present a small horizontal separation line is printed before the image.
- named:
légende répartition
editJust insert an additional legend.
- unamed: légende : the legend to print (mandatory)
- flags:
- named:
conflit
editMostly the same role than rang keyword.
- unamed: rang, nom1, site1, nom2, site2, nom3, site3 : to be described…
- flags:
- named:
phylogénie bandeau
editUsed to start a phylogenetic classification. Mostly the same behavior than début.
- unamed: image : optional. Used to add a picture of the phylogenetic classification (not for a taxa image!)
- flags:
- named: classification, image : the first is the followed classification (optional) and the second ???
phylogénie inexistant
editUsed in place of previous one, to indicate that this taxa does not exists in phylogenetic classification.
- unamed: classification : the followed classification (optional)
- flags:
- named:
position
edit???
- unamed: arbre, frère
- flags:
- named:
Taxobox behavior
editThe taxobox module creates the elements following the description given using the parameters.
It also handle some other features that are not explicitly described, in particular:
- modifying article title by adding italics when needed
- adding a subtitle with the vernacular names (if any) when titled by scientific name and vis-versa
- adding various information categories (article without image, IUCN status, …)
- adding various error categories (in case of syntax/usage/structure non-fatal errors)
- adding an error box in case of fatal error (i.e. no regnum given)
- adding errors description
- handling categories, error categories and error descriptions inline, in box or not at all depending of user choice or (default) depending on the namespace of the article
- handling structural coherence, when the free-syntax is used in a bad way
The default behavior make a difference beetween articles and other pages (docs, templates, help, talkpages…).
By default information and errors categories are categories for articles, and are displayed in separated boxes in other namespaces.
By default error descriptions are not printed for articles and are displayed in a separated box in other namespaces.
By default title typography is modified only for articles.
By default subtitles are added only for articles.
All these behaviors can be modified by module options.
Examples
editComparison beetween current and new taxobox
editFormat « taxobox-module » | Format « taxobox-fr » |
{{Hexasoft-test | règne=algue | nv=Haptophytes |début|image.png | légende | classification|AlgaeBASE |rang | sous-règne | Hacrobia |taxon | embranchement | Haptophyta | <auteurs>, <date> | taxons | * classe ''[[Pavlovophyceae]]'' ** ordre ''[[Pavlovales]]'' * classe ''[[Prymnesiophyceae]]'' Hibberd, 1976 ** ordre ''[[Prymnesiales]]'' ** ordre ''[[Phaeocystales]]'' ** ordre ''[[coccolithophore|Isochrysidales]]'' ** ordre ''[[coccolithophore|Coccolithales]]'' |position | {{Phylogénie Eukaryota}} | Cryptophyta |fin }} |
{{Taxobox début | algue | image.png | légende | classification=AlgaeBASE }} {{Taxobox | sous-règne | Hacrobia }} {{Taxobox taxon | algue | embranchement | Haptophyta | <auteurs>, <date> }} {{Taxobox taxons | * classe ''[[Pavlovophyceae]]'' ** ordre ''[[Pavlovales]]'' * classe ''[[Prymnesiophyceae]]'' Hibberd, 1976 ** ordre ''[[Prymnesiales]]'' ** ordre ''[[Phaeocystales]]'' ** ordre ''[[coccolithophore|Isochrysidales]]'' ** ordre ''[[coccolithophore|Coccolithales]]'' }} {{Taxobox position | {{Phylogénie Eukaryota}} | Cryptophyta }} {{Taxobox fin}} |
A small taxobox
edit{{Taxobox-fr |règne=animal |nv=Uroplate |début |Uroplatus guentheri male.jpg | ''Uroplatus guentheri'' mâle|classification|ReptileDB |rang|embranchement|Chordata |rang|Classe|Reptilia |rang|Sous-classe|Lepidosauria |rang|Ordre|Squamata |rang|Infra-ordre|Gekkota |rang|Famille|Gekkonidae |rang|Genre|Uroplatus |taxon | espèce | Uroplatus fimbriatus | [[François Mocquard|Mocquard]], [[1908]] |fin }}
A (mostly) complete taxobox
editNote: this taxobox does not make sense, its content is invented or copied from other species.
{{Taxobox-fr |règne=animal |debug=oui |erreurs=oui |catégories=boîte |catégories erreurs=boîte |nv=Uroplate |début |Uroplatus guentheri male.jpg | ''Uroplatus guentheri'' mâle|classification|ReptileDB |rang|embranchement|Chordata |rang|Classe|Reptilia |rang|Sous-classe|Lepidosauria |rang|Ordre|Squamatii|ancien |conflit|Ordre|Squamata |conflit|Ordre|Squamata|ReptileDB |conflit|Sous-ordre|Sauria|ReptileDB|Saurii|ITIS|Saurie|NCBI |rang|Infra-ordre|Gekkota |rang|Famille|Gekkonidae|Gecko |rang|Genre|Uroplatus |taxon | espèce | Uroplati guentherii | [[François Mocquard|Mocquard]], [[1908]] | obsolète| |taxon | espèce | Uroplati guentherii | [[François Mocquard|Mocquard]], [[1908]] | obsolète|Uroplatus guentheri |taxon | espèce | Uroplatus fimbriatus | [[François Mocquard|Mocquard]], [[1908]] | titre |taxon | espèce | Uroplatus fimbriatuse | [[François Mocquard|Mocquard]], [[1908]] |synonymes | * ''Turlu tutu'' <small>Chapeau Pointu</small> |taxons | Plein |uicn | LC | 1Ab12-coulé | chez moi |uicn | VU | 1Ab12-coulé | ailleurs |taxons | Sous-espèces | Plein |répartition | Agelaius phoeniceus.svg|bleu: zone de nidification<br /> vert: présent toute l'année<br /> ocre: non-nicheur |répartition légende | ''[[Coffea arabica]]'' (arabica) |c4666b |répartition légende | « arabica » '''et''' « robusta » |9b7066 |répartition légende | ''[[Coffea canephora]]'' (robusta) |877563 |cites | II | 22-10-87 |cites | III | 1998 | (Turquie) |image | Uroplatus guentheri juvenile.jpg | | séparateur |image | Uroplatus guentheri juvenile.jpg | Un juvénile |légende | Et une autre légende… |taxons |phylogénie inexistant |phylogénie inexistant | ReptileDB |fin }}
Templates from fr:
editThis part describes the correspondance beetween current taxobox templates and the associated keyword in taxobox-module. Note that keywords are case-insensitive.
- fr:Modèle:Taxobox CITES: cites → done / complete
- fr:Modèle:Taxobox conflit: conflit → done / complete (mostly: missing treatment of classif. references)
- fr:Modèle:Taxobox début: début → done / complete (mostly, missing cats for image?)
- fr:Modèle:Taxobox fin: fin → done / complete
- fr:Modèle:Taxobox image: image → done / complete
- fr:Modèle:Taxobox légende: légende → done / complete
- fr:Modèle:Taxobox parents: parents → done / complete
- fr:Modèle:Taxobox phylogénie arbre → done / complete
- fr:Modèle:Taxobox phylogénie inexistant → done / complete
- fr:Modèle:Taxobox phylogénie bandeau: phylogénie bandeau → done / complete
- fr:Modèle:Taxobox position → ? (to check)
- fr:Modèle:Taxobox répartition: répartition → done / complete
- fr:Modèle:Taxobox répartition début: don't exists → no more needed
- fr:Modèle:Taxobox répartition image: répartition image → done / complete
- fr:Modèle:Taxobox répartition fin: don't exists → no more needed
- fr:Modèle:Taxobox répartition légende: répartition légende → done / complete
- fr:Modèle:Taxobox simple début: don't exists → not needed (covered by the module)
- fr:Modèle:Taxobox synonymes: synonymes → done / complete
- fr:Modèle:Taxobox: rang → done / complete (some check needed)
- fr:Modèle:Taxobox taxon: taxon → done / complete (not exactly the same output)
- fr:Modèle:Taxobox taxons: taxons -> done / complete
- fr:Modèle:Taxobox UICN: uicn → done / complete (need to check generated cats)
Technical informations
editModule:Taxobox-data
editThis module contains all the "data" for taxobox. It includes list of classifications (and the corresponding links), some categories text, typographic conventions followed by regnum, …
Module:Taxobox-briques
editThis module contains basic functions that creates part of a "box" (opening, closing, adding a subsection, starting a data table…).
Module:Taxobox-outils
editContains the functions that treat the different keywords and there result. Also contains some generic-purpose functions.
Module:Taxobox-fr
editThe main module.
How do I…
editAdd a new regnum, a new classification, or modify a link?
editMostly all the text elements are in Module:Taxobox-data. Look in this module to find the element you want to modify or the list of elements in which you want to add something.
Example: to insert a new classification search the definitions after "local classifications = {}", which contain all the corresponding data. You just have to duplicate one line and to:
- replace the selector name by your name (in lowercase, uppercases are ignored for keywords)
- replace the text/link by the correct target (in wikitext format)
Modify the result of a taxobox element?
editYou have to modify the code used for this element. Each element is in a dedicated function into Module:Taxobox-outils. Functions has a name closely-related to the keyword of the element.
When you find the function you can modify its behavior by changing the code and/or the texts.
Note that parameters from the element line are all stored in the local parameter params.
Add a new parameter to an existing element?
editIn this case you have to change the element line syntax. All the syntax are in Module:Taxobox-data (at the begining), in variables named tools.df_<keyword>.
Note that the syntax of these variables is not obvious. See dedicated section later (not written yet).
When you added your new parameter you just have to modify the function that handle this element (see previous section) to use this new parameter (remember: the new parameter will be visible in the local params table).
Change the default behavior of taxobox?
editAll controlable parts of the taxobox has its default values stored in Module:Taxobox-data. Check tools.defauts.xxx variables and modify them if needed.
Add a new element in taxobox?
editThis is a little more complicated. You have to create all the associated elements:
- the element line format (in Taxobox-data)
- add a function in Taxobox-outils to handle this element (see other functions)
- add this element in call table (at the end of Taxobox-outils), with an associated keyword, the line format and the function to handle it.
- if needed have a look to Taxobox-fr in function z.traite_ligne(ligne). A part of this section is dedicated for checking the coherence of the current taxobox. You may want to add "structural sanity check" (example: if current element is not a classification level line but previous was this function closes the HTML table used for that part).