--This module provides the core functionality to a set of templates used todisplay a list of taxon name/authority pairs, with the taxon names optionallyitalicized, wikilinked and/or emboldened. Such lists are usually part oftaxoboxes.
-- use a function from Module:TaxonItalics to italicize a taxon namelocal TaxonItalics = require("Module:TaxonItalics")local yesno = require("Module:Yesno")
local p =
--function p.stripDagger(taxonName) local dagger = if mw.ustring.sub(taxonName,1,1)
'†' then taxonName = string.sub(taxonName,9,#taxonName) dagger = '†' elseif (string.sub(taxonName,1,5)
--main|italic = yes - to italicize the taxon name|linked = yes - to wikilink the taxon name|bold = yes - to emboldent the taxon name|incomplete = yes - to output "(incomplete)" at the end of the list}}The template that transcludes the invoking template must supply an indefiniteeven number of arguments in the format|Name1|Author1 |Name2|Author2| ... |NameN|AuthorNfunction p.main(frame) local italic = yesno(frame.args['italic']) local bold = yesno(frame.args['bold']) local linked = yesno(frame.args['linked']) if bold then linked = false end -- must not have bold and wikilinked local abbreviated = yesno(frame.args['abbreviated']) local incomplete = yesno(frame.args['incomplete']) local taxonArgs = frame:getParent.args local result = -- iterate over unnamed variables local taxonName local dagger local first = true -- is this the first of a taxon name/author pair? for param, value in pairs(taxonArgs) do if tonumber(param) then if first then taxonName = mw.text.trim(value) -- if necessary separate any initial † from the taxon name if linked or italic or bold then taxonName, dagger = p.stripDagger(taxonName) else dagger = end if linked and not italic then taxonName = '' .. taxonName .. '' end if italic then taxonName = TaxonItalics.italicizeTaxonName(taxonName, linked, abbreviated) end if bold then taxonName = '' .. taxonName .. '' end result = result .. '
return p