Module:TV: Difference between revisions

From Terra Invicta Official Wiki
Redwah (talk | contribs)
Created page with "-- This is a LUA version of the Template:VT page. -- The idea is to standardize how Value-Type pairs are presented. local p = {} local IconModule = require('Module:Icon') local VTData = mw.loadData('Module:VT/data') function p.VT( frame ) local VTvalue = frame.args[1] local VTtype = frame.args[2] if not VTtype then return 'ERROR: No type specified for VT Module' end local returnString = VTvalue .. ' ' .. VTData[VTtype] return returnString end return p"
 
Redwah (talk | contribs)
No edit summary
Line 3: Line 3:


local p = {}
local p = {}
local IconModule = require('Module:Icon')


local VTData = mw.loadData('Module:VT/data')
local VTData = mw.loadData('Module:VT/data')


function p.VT( frame )
function p.VT( frame )
local VTvalue = frame.args[1]
local VTvalue = frame.args[1]
local VTtype = frame.args[2]
local VTtype = frame.args[2]
local VTshort = frame.args[3]
if not VTtype then
if not VTtype then
return 'ERROR: No type specified for VT Module'
return 'ERROR: No type specified for VT Module'
end
end
local returnString = VTvalue .. ' ' .. VTData[VTtype]
local returnString = VTvalue .. ' ' .. VTData[VTtype][1]
if VTshort == 'true' then
returnString = returnString .. VTData[VTtype][2]
end
return returnString
return returnString
end
end


return p
return p

Revision as of 19:12, 2 January 2026

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

-- This is a LUA version of the Template:VT page.
-- The idea is to standardize how Value-Type pairs are presented.

local p = {}

local VTData = mw.loadData('Module:VT/data')

function p.VT( frame )
	local VTvalue = frame.args[1]
	local VTtype = frame.args[2]
	local VTshort = frame.args[3]
	if not VTtype then
		return 'ERROR: No type specified for VT Module'	
	end
	local returnString = VTvalue .. ' ' .. VTData[VTtype][1]
	if VTshort == 'true' then
		returnString = returnString .. VTData[VTtype][2]
	end
	return returnString
end

return p