Jump to content

Module:Sandbox/Kephir

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Kephir (talk | contribs) at 19:47, 28 June 2013. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- [[User:Kephir]]'s Scribunto sandbox
-- do not expect anything to stay here in place

return {
	argtest = function (frame)
		local result = ''
		for key, value in ipairs(frame:getParent().args) do
			result = result .. key .. '=' .. value .. '<br/>'
		end
		return result
	end,
	templtest = function (frame)
		return '{{X1}} <b>X1</b> [[Template:X1]] [[:Category:X1]] [[Category:X1]]', 'Kaboom!'
	end,
	recurtest = function (frame)
		return 'Il a dit: »' .. frame.args[1] .. '«.'
	end,
	writetest = function (frame)
		local result = ''
		local args = mw.clone(frame.args)
		result = result .. args[1] .. '<br/>'
		args[1] = nil
		result = result .. args[1] .. '<br/>'
		return result
	end,
	looptest = function (frame)
		while true do
			-- nothing
		end
	end,
	frametest = function (frame)
		return (mw.getCurrentFrame() == frame) and 'OMG INCEST' or 'okay'
	end
}