Module:History

From Vintage Story Wiki
Revision as of 16:16, 20 August 2022 by Sana (talk | contribs)

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

local p = {}

function p.create(f)
	local args = require( 'Module:ProcessArgs' ).merge( true )
		
	local header = '{| class="wikitable">!colspan="3"|History|-'
		
	if args.header then
		return header
	end
	
	local footer = '|}'
	
	if args.footer then
		return footer
	end
	
	local parentVer = args[1] or ''
	local childVer = args[2]
	
	local child = '||[[' .. childVer .. ']]'
		
	local notes = '||' .. args[2]
	
	local parent
	local body
	if parentVer then
		parent = '|[[' .. parentVer .. ']]'
		body =  parent .. child .. notes
	else
		body = '|' .. child .. notes
	end
	
	return body
end
return p