Module:template demo

From Wiktionary, the free dictionary
Jump to navigation Jump to search

local export = {}

local format_link = require("Module:template link").format_link
local pairs = pairs
local remove = table.remove
local shallowcopy = require("Module:table").shallowcopy

function export.show(frame)
	local args = shallowcopy(pairs(frame.args)() and frame.args or frame:getParent().args)
	local template_name = remove(args, 1)
	return format_link(template_name, args) .. " ⇒<br style=\"line-height: 200%;\" />"
		.. frame:expandTemplate {title = template_name, args = args}
end

return export