Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Module documentation[view][edit][history][purge]
This documentation is transcluded from Module:UpdateChange/doc. Changes can be proposed in the talk page.
Function list
L 5 — p.fromArgs
L 24 — createRow
L 39 — p.createTable

Defines the SMW subobject of an update change and displays its description.


local SMWUtil = require( 'Module:SMWUtil' )

local p = {}

function p.fromArgs(frame)
	local args = require("Module:Arguments").getArgs(frame)
	local changeType = args[1] or "changed"
	local description = args[2] or ""
	
	local properties = {
		"Change Type=" .. changeType,
		"Change Description=" .. description
	}
	
	for link in description:gmatch("%[%[([^]|]+)") do
    	table.insert(properties, "Changed=" .. link)
	end
	
	SMWUtil.createAnonymousSubobject(frame, properties)
	
	return description
end

local function createRow(frame, changeType, feature, description)
	local properties = {
		"Change Type=" .. changeType,
		"Change Description=" .. description
	}
	
	for link in feature:gmatch("%[%[([^]|]+)") do
    	table.insert(properties, "Changed=" .. link)
	end
	
	SMWUtil.createAnonymousSubobject(frame, properties)
	
	return string.format("|-\n|%s\n|\n%s\n", feature, description)
end

function p.createTable(frame)
	local args = require("Module:Arguments").getArgs(frame)
	
	local out = "{| class=\"wikitable sortable\"\n!Feature\n!Description\n"
	
	local i = 1
	while args[i] and args[i + 1] and args[i + 2] do
		local changeType = args[i]
		local feature = args[i + 1]
		local description = args[i + 2]
		out = out .. createRow(frame, changeType, feature, description)
		i = i + 3
	end
	
	out = out .. "|}"
	
	return out
end

return p
🍪 Yum Yum Yum! Cookies help us better deliver our services. By using our site, you agree to our use of cookies.