Module:Template

local p = {}

local utilsTable = require("Module:UtilsTable")

function p.Main(frame) local args = frame:getParent.args local templateName = args[1] local templateArgs = {} for k, v in pairs(args) do		if k == 1 then -- do nothing elseif type(k) == "string" then table.insert(templateArgs, k.."= "..v)		else table.insert(templateArgs, v)		end end local templateLink = string.format("%s", templateName, templateName) local parts = utilsTable.concat({templateLink}, templateArgs) parts = table.concat(parts, "|") return string.format(" ", parts) end

p.Templates = { ["Template"] = { purpose = "Renders sample code for a template transclusion, for use in wiki documentation.", categories = {"Formatting templates"}, params = { [1] = {				name = "template", required = true, desc = "A template name.", type = "wiki-template-name", },			["..."] = {				name = "args", placeholder = "arg", desc = "Template arguments.", type = "content", },		},		examples = { {"Page Name"}, {"ALttP", "-"}, },	} }

return p