Difference between revisions of "Module:Sandbox/BrandonXLF/2/example"

From blackwiki
Jump to navigation Jump to search
blackwiki>BrandonXLF
(Created page with 'local p = {} function p.example (frame) local exampleNumber = frame.args[1] local code = frame.args[2] local arguments = { [1] = {'main','item',', '},...')
 
blackwiki>BrandonXLF
(Fix)
Line 22: Line 22:
 
local out = frame:callParserFunction {
 
local out = frame:callParserFunction {
 
name = '#invoke:Sandbox/BrandonXLF/2',
 
name = '#invoke:Sandbox/BrandonXLF/2',
args = arguments {'main', 'item', ', '}
+
args = arguments[exampleNumber]
 
}
 
}
 
 

Revision as of 01:37, 2 January 2019

Documentation for this module may be created at Module:Sandbox/BrandonXLF/2/example/doc

local p = {}

function p.example (frame)
	
	local exampleNumber = frame.args[1]
	local code = frame.args[2]
	
	local arguments = {
		[1] = {'main','item',', '},
		[2] = {'main','',', ','','',' and '},
		[3] = {'main','','•','•',' and '},
		[4] = {'main','',', ','•','•',' and '},
		[5] = {'main','x',' & '},
		[6] = {'bulleted'},
		[7] = {'unbulleted'},
		[8] = {'horizontal'},
		[9] = {'ordered'},
		[10] = {'commas'},
		[11] = {'list'},
	}
	
	local out = frame:callParserFunction {
		name = '#invoke:Sandbox/BrandonXLF/2',
		args = arguments[exampleNumber]
	}
	
	if code then
		out = '<pre>'..out..'</pre>'
	end
	
	return out

end

return p