<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://the-democratika.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ATaxonList</id>
	<title>Module:TaxonList - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://the-democratika.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ATaxonList"/>
	<link rel="alternate" type="text/html" href="https://the-democratika.com/wiki/index.php?title=Module:TaxonList&amp;action=history"/>
	<updated>2026-04-04T21:38:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://the-democratika.com/wiki/index.php?title=Module:TaxonList&amp;diff=7529&amp;oldid=prev</id>
		<title>&gt;Izno: -plainlist per discussion</title>
		<link rel="alternate" type="text/html" href="https://the-democratika.com/wiki/index.php?title=Module:TaxonList&amp;diff=7529&amp;oldid=prev"/>
		<updated>2022-12-13T18:50:27Z</updated>

		<summary type="html">&lt;p&gt;-plainlist per discussion&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
This module provides the core functionality to a set of templates used to&lt;br /&gt;
display a list of taxon name/authority pairs, with the taxon names optionally&lt;br /&gt;
italicized, wikilinked and/or emboldened. Such lists are usually part of&lt;br /&gt;
taxoboxes.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
-- use a function from Module:TaxonItalics to italicize a taxon name&lt;br /&gt;
local TaxonItalics = require(&amp;quot;Module:TaxonItalics&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--[[=========================================================================&lt;br /&gt;
Utility function to strip off any initial † present to mark the taxon as&lt;br /&gt;
extinct. The † must not be italicized, emboldened, or included in the&lt;br /&gt;
wikilinked text, so needs to be added back afterwards.&lt;br /&gt;
† is assumed to be present as one of:&lt;br /&gt;
* the unicode character †&lt;br /&gt;
* the HTML entity &amp;amp;dagger;&lt;br /&gt;
* the output of {{extinct}} – this will have been expanded before reaching this&lt;br /&gt;
  module and is assumed to have the form &amp;#039;&amp;lt;span ... &amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
The function returns two values: the taxon name with any † before it removed&lt;br /&gt;
and either &amp;#039;†&amp;#039; if it was present or the empty string if not.&lt;br /&gt;
=============================================================================]]&lt;br /&gt;
function p.stripDagger(taxonName)&lt;br /&gt;
	local dagger = &amp;#039;&amp;#039;&lt;br /&gt;
	if mw.ustring.sub(taxonName,1,1) == &amp;#039;†&amp;#039; then&lt;br /&gt;
		taxonName = mw.ustring.sub(taxonName,2,#taxonName)&lt;br /&gt;
		dagger = &amp;#039;†&amp;#039;&lt;br /&gt;
	else &lt;br /&gt;
		if string.sub(taxonName,1,8) == &amp;#039;&amp;amp;dagger;&amp;#039; then&lt;br /&gt;
			taxonName = string.sub(taxonName,9,#taxonName)&lt;br /&gt;
			dagger = &amp;#039;†&amp;#039;&lt;br /&gt;
		else&lt;br /&gt;
			-- did the taxon name originally have {{extinct}} before it?&lt;br /&gt;
			if (string.sub(taxonName,1,5) == &amp;#039;&amp;lt;abbr&amp;#039;) and mw.ustring.find(taxonName, &amp;#039;†&amp;#039;) then&lt;br /&gt;
				taxonName = string.gsub(taxonName, &amp;#039;^.*&amp;lt;/abbr&amp;gt;&amp;#039;, &amp;#039;&amp;#039;, 1)&lt;br /&gt;
				dagger = &amp;#039;†&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return taxonName, dagger&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[=========================================================================&lt;br /&gt;
The function returns a list of taxon names and authorities, appropriately&lt;br /&gt;
formatted.&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:TaxonList|main&lt;br /&gt;
|italic = yes - to italicize the taxon name&lt;br /&gt;
|linked = yes - to wikilink the taxon name&lt;br /&gt;
|bold = yes - to emboldent the taxon name&lt;br /&gt;
|incomplete = yes - to output &amp;quot;(incomplete)&amp;quot; at the end of the list&lt;br /&gt;
}}&lt;br /&gt;
The template that transcludes the invoking template must supply an indefinite&lt;br /&gt;
even number of arguments in the format&lt;br /&gt;
|Name1|Author1 |Name2|Author2| ... |NameN|AuthorN&lt;br /&gt;
=============================================================================]]&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local italic = frame.args[&amp;#039;italic&amp;#039;] == &amp;#039;yes&amp;#039;&lt;br /&gt;
	local bold = frame.args[&amp;#039;bold&amp;#039;] == &amp;#039;yes&amp;#039;&lt;br /&gt;
	local linked = frame.args[&amp;#039;linked&amp;#039;] == &amp;#039;yes&amp;#039;&lt;br /&gt;
	if bold then linked = false end -- must not have bold and wikilinked&lt;br /&gt;
	local abbreviated = frame.args[&amp;#039;abbreviated&amp;#039;] == &amp;#039;yes&amp;#039;&lt;br /&gt;
	local incomplete = frame.args[&amp;#039;incomplete&amp;#039;] == &amp;#039;yes&amp;#039;&lt;br /&gt;
	local taxonArgs = frame:getParent().args&lt;br /&gt;
	local result = &amp;#039;&amp;#039;&lt;br /&gt;
	-- iterate over unnamed variables&lt;br /&gt;
	local taxonName&lt;br /&gt;
	local dagger&lt;br /&gt;
	local first = true -- is this the first of a taxon name/author pair?&lt;br /&gt;
	for param, value in pairs(taxonArgs) do&lt;br /&gt;
		if tonumber(param) then&lt;br /&gt;
			if first then&lt;br /&gt;
				taxonName = mw.text.trim(value)&lt;br /&gt;
				-- if necessary separate any initial † from the taxon name&lt;br /&gt;
				if linked or italic or bold then&lt;br /&gt;
					taxonName, dagger = p.stripDagger(taxonName)&lt;br /&gt;
				else&lt;br /&gt;
					dagger = &amp;#039;&amp;#039;&lt;br /&gt;
				end&lt;br /&gt;
				if linked and not italic then&lt;br /&gt;
					taxonName = &amp;#039;[[&amp;#039; .. taxonName .. &amp;#039;]]&amp;#039;&lt;br /&gt;
				end&lt;br /&gt;
				if italic then&lt;br /&gt;
					taxonName = TaxonItalics.italicizeTaxonName(taxonName, linked, abbreviated)&lt;br /&gt;
				end&lt;br /&gt;
				if bold then&lt;br /&gt;
					taxonName = &amp;#039;&amp;lt;b&amp;gt;&amp;#039; .. taxonName .. &amp;#039;&amp;lt;/b&amp;gt;&amp;#039;&lt;br /&gt;
				end&lt;br /&gt;
				result = result .. &amp;#039;&amp;lt;li&amp;gt;&amp;#039; .. dagger .. taxonName&lt;br /&gt;
			else&lt;br /&gt;
				result = result .. &amp;#039; &amp;lt;small&amp;gt;&amp;#039; .. value .. &amp;#039;&amp;lt;/small&amp;gt;&amp;lt;/li&amp;gt;&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
			first = not first&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if incomplete then&lt;br /&gt;
		result = result .. &amp;#039;&amp;lt;small&amp;gt;(incomplete list)&amp;lt;/small&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;&amp;lt;ul class=&amp;quot;taxonlist&amp;quot;&amp;gt;&amp;#039; .. result .. &amp;#039;&amp;lt;/ul&amp;gt;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>&gt;Izno</name></author>
	</entry>
</feed>