Module:Biota infobox/test

From blackwiki
< Module:Biota infobox
Revision as of 15:11, 28 January 2020 by blackwiki>Jts1882 (this is confusing)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Biota infobox/test/doc

require('Module:No globals')

local p = {}  -- exposed variables
local args = {}  

function p.convert(frame)
	args = frame:getParent().args
	local template = {}
	local targs = {}
	
	table.insert (template, '{{speciesbox ' );	
	
	
	for k,v in pairs(args) do
		
		if k == 'genus' then 
			local param = k:gsub("%'",""):gsub("%[",""):gsub("%]","")
			k=param
			v='Hypsiboas'
		elseif k== 'species' then
			v='albopunctatus'
		end
		
	    table.insert (template, table.concat ({' |'..k..'=', v}));	
	    targs[k]	= v
	end

	table.insert (template, '}}');												-- close the template
	
	--return frame:expandTemplate{ title = 'speciesbox', args = targs }
	return table.concat (template, '\n');			
end

return p