Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a2378c895e7d6483

Jump to content

Module talk:TaxonItalics

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 13 days ago by Peter coxhead in topic Question about Module:TaxonItalics scope

Request to output log

[edit]

Moved here from Module talk:TaxonItalics/testcases as per instructions there. Peter coxhead (talk) 15:13, 23 August 2018 (UTC)Reply

Erutuon, due to some useful changes Peter coxhead made to the main module, all of the initially-unitalicized testcases [at Module talk:TaxonItalics/testcases] show as failed, but I assume this is due to HTML-ified spaces/multipliciations/etc., which render the same but fail a simple plain-text equivalency check. Would you be able to output a nowiki version of the log after the table and/or add 2 columns to the table (e.g. "Expected nowiki" & "Actual nowiki")?   ~ Tom.Reding (talkdgaf)  14:48, 23 August 2018 (UTC)Reply

@Tom.Reding: I'm aware of this issue, but I'm still working on the module to get allow it to abbreviate taxon names when required – not needed in {{Taxonbar}} but needed in some autotaxoboxes.
I think it's correct now, but Erutuon should wait a day before doing anything in case there are more changes. Peter coxhead (talk) 15:13, 23 August 2018 (UTC)Reply
See User:Peter coxhead/Test#Module:TaxonItalics#main for my work tests. Peter coxhead (talk) 15:16, 23 August 2018 (UTC)Reply
@Tom.Reding and Erutuon: I'm doubtful of the value of Module talk:TaxonItalics/testcases, because it's the visual appearance of the output that matters, not the exact HTML that achieves this. During development, I've changed the way the code de-italicizes components like the hybrid symbol and connecting terms more than once, partly to simplify the algorithm and partly for consistency. It could be changed again, e.g. depending on the discussion at Wikipedia talk:WikiProject Plants#Hybrid symbol ×, without changing the visual appearance of cases currently handled correctly. In development, I've relied on tests like those at User:Peter coxhead/Test#Module:TaxonItalics#main, just looking at the output. Peter coxhead (talk) 16:47, 24 August 2018 (UTC)Reply
@Peter coxhead: Well, I see your point, but I've updated them so that they all pass again. Perhaps they can serve as a demonstration of what the function does, since they are not very useful when editing the module. — Eru·tuon 20:54, 24 August 2018 (UTC)Reply
Well, if you're happy to do the work, I agree they are a good demonstration.
Any thoughts about other cases, as per my question below? Peter coxhead (talk) 20:58, 24 August 2018 (UTC)Reply
Not right now, but I'll post there if any occur to me. — Eru·tuon 06:03, 25 August 2018 (UTC)Reply

Work remaining

[edit]

The module seems to handle ICNafp-style names (i.e. those with connecting terms) correctly, both straightforward italicization and abbreviation. However, it doesn't yet handle "GENUS (SUBGENUS)" style names: Peter coxhead (talk) 17:12, 23 August 2018 (UTC)Reply

The module now handles "GENUS (SUBGENUS)" style names correctly:

  • Genus (Subgenus) → Genus (Subgenus)
  • Genus (Subgenus) species → Genus (Subgenus) species
  • Genus (Subgenus) [abbreviated] → G. (Subgenus)
  • Genus (Subgenus) species [abbreviated] → G. (S.) species

Are there any more cases that the code should handle? Peter coxhead (talk) 16:41, 24 August 2018 (UTC)Reply

Handling disambiguation terms

[edit]

By default, the code assumes that a parenthesized term is a subgenus and italicizes it:

  • {{#invoke:TaxonItalics |main |Varanus (Hapturosaurus)}}Varanus (Hapturosaurus)

However, this is wrong if it is actually a disambiguation term:

  • {{#invoke:TaxonItalics |main |Caia (plant)}}Caia (plant)

I've just added a parameter |dab= to treat a parenthesized part as a disambiguation term:

  • {{#invoke:TaxonItalics |main |Caia (plant) |dab=yes}}Caia (plant)

Peter coxhead (talk) 06:54, 5 October 2021 (UTC)Reply

Automatic case formatting and italicization for taxon names

[edit]

Hi @Peter coxhead,

I would like to request a few improvements to how taxon names are processed and displayed. Currently, the system is sensitive to user input formatting errors, which often results in incorrect botanical or zoological nomenclature on the output. Could we please implement the following automated fixes:

  • Case formatting for binomial/trinomial names: If a user accidentally enters a taxon name in ALL CAPS or with incorrect casing, the system should automatically convert it to the standard nomenclatural format.
    • Example 1 (Zoology): Any input casing should be normalized to Ochotona (Conothoa) roylii nepalensis (genus and subgenus capitalized; species and subspecies in lowercase).
    • Example 2 (Botany): The input should be normalized to Pinus (subg. Strobus) balfouriana subsp. austrina.
  • Lowercase for rank abbreviations: Standard taxonomic rank abbreviations like "subg.", "subsp.", "var.", and "f." should always be automatically converted to lowercase.
  • Non-italicized rank abbreviations: In complex names like Genus (Subgenus) species subsp. subspecies, the rank abbreviations themselves (such as "subsp.", "var.", "subg.") must not be italicized. Currently, the system fails to un-italicize these connectives, which is a nomenclatural error.

These automated adjustments would easily eliminate accidental formatting errors made by inexperienced users and ensure full compliance with international codes of biological nomenclature.

Thank you for your time and hard work! I look forward to your reply.

Wishing you peace and safety, --~2026-37716-92 (talk) 23:06, 1 July 2026 (UTC)Reply

The primary purpose of the module is to support automated taxoboxes, where parameters must be input without italics, but the output may need to be italicized. In these situations, there are limits on when incorrect capitalization will work. For example, in a {{Speciesbox}}, |taxon=PINUS BALFOURIANA would incorrectly attempt to use a taxonomy template "Template:Taxonomy/PINUS".
I also think the automated taxobox system at most displays tripart names, so wouldn't show Genus (Subgenus) species subsp. subspecies.
So can you give some examples of where you have found there to be incorrect output in actual use, rather than independently constructed examples?
None of the above is to say that it would not be a good idea to fix some of the issues you have identified, although the module's purpose is to italicize correctly, not fix all input errors.
Peter coxhead (talk) 07:01, 2 July 2026 (UTC)Reply

Question about Module:TaxonItalics scope

[edit]

Hello @Peter coxhead,

Could you please clarify which main taxonomic ranks the «TaxonItalics» module was designed for and which nomenclature codes it accommodates? Specifically, does it account for the distinct italicization rules of the botanical (ICNafp), zoological (ICZN), prokaryotic (ICNP), virological (ICTV), or cultivated plant (ICNCP) codes?

Since formatting rules for scientific names vary significantly across these international codes depending on the rank, I would highly appreciate it if you could specify whether the module also supports any other nomenclature codes.

Thank you for your time, dedication, and hard work! I look forward to your reply.

Wishing you peace and safety, ~2026-39489-85 (talk) 22:46, 11 July 2026 (UTC)Reply

Sorry, haven't been active here lately. As I noted above, the module was designed to support the way that automated taxoboxes italicized ranks at the time it was written. Is there an actual taxobox that produces the wrong italicization? It should support ICNafp, ICZN and virus names with the main automated taxobox templates, noting that policy here is to italicize at genus level and below for the first two codes, and all ranks for viruses. As also noted above, it only supports three part names. {{Infobox cultivar}} used for ICNCP names requires manual formatting. I don't know about ICNP names, other than past discussions of how to handle "candidatus". Peter coxhead (talk) 16:41, 17 July 2026 (UTC)Reply