Module:Cite taxon/utilities
Appearance
local p = {}
p.format_species_list = function(frame)
local list = frame.args[1] or frame:getParents().args[1]
list = mw.text.trim( list )
local names = mw.text.split( list, "\n", plain )
local genus, species, authority
local output = { }
--for k, v in pairs( names ) do
--genus, species, authority = string.gmatch( v, " " )
local i = 1
while names[i] do
for genus, species, authority in string.gmatch(names[i], "(%S+) (%S+) (.+)" ) do
table.insert ( output , "\n*''[[" .. genus .. " " .. species .. "]]'' "
-- .. frame:expandTemplate{ title = 'small', args = { authority } } --expand template
.. "{{small|" .. authority .."}}" -- don't expand template
)
end
i=i+1
end
return table.concat(output)
end
return p