Jump to content

Module:Biota infobox/test

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jts1882 (talk | contribs) at 15:05, 28 January 2020 (return the template code). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
require('Module:No globals')

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

function p.convert(frame)
	args = frame.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