Module:Gaps

From Zoophilia Wiki
Revision as of 18:16, 2 July 2014 by meta>The Mol Man (Created page with 'local p = {} function p._make(frame) local parameters = frame:getParent().args local ret_string = '<span style="white-space: nowrap;'..parameters['size'] or...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Documentation for this module may be created at Module:Gaps/doc

local p = {}

function p._make(frame)
	local parameters = frame:getParent().args
	
	local ret_string = '<span style="white-space: nowrap;'..parameters['size'] or ''..'">'
	
	if parameters['lhs'] then
		ret_string = ret_string..parameters['lhs']..' = '
	end
	
	for i=1,20,1 do
		ret_string = ret_string..'<span style="margin-left: 0.2em">'..parameters[i]..'</span>'
		if not parameters[i] then
			break
		end
	end
	
	if parameters['e'] then
		ret_string = ret_string..'<span style="margin-left: 0.27em; margin-right: 0.27em">×</span>'..
					parameters['base'] or 10 ..'<span style="display:none">^</span><sup>'..parameters['e']..'</sup>'
	end
	
	if parameters['u'] then
		ret_string = ret_string..'&nbsp;'..parameters['u']
	end
	
	return ret_string
end

return p