Module:Variable arguments
Jump to navigation
Jump to search
This module is used to store functions for templates that take a variable number of arguments but do not use Module:Labelled list hatnote:
local mArguments = require("Module:Arguments") local p = {} function p.modlink(frame) local args = mArguments.getArgs(frame, { parentOnly = true }) local out_str = "" local i = 0 for k, v in pairs(args) do out_str = out_str .. "[[Module:" .. v .. "]]" .. ", " i = i + 1 end out_str = out_str:sub(1, -3) if out_str == "" then out_str = "[[Module:" .. frame:preprocess("{{ROOTPAGENAME}}") .. "]]" end out_str = out_str .. " – the " .. string.gsub("module that implement", "()", {[((i > 1) and {7} or {22})[1]] = "s"}) .. " the functionality." return out_str end function p.breadcrumb(frame) local args = mArguments.getArgs(frame, { parentOnly = true }) local out_str = "" local i = 0 for k, v in pairs(args) do out_str = out_str .. "[[" .. v .. "]] | " i = i + 1 end if out_str == "" then out_str = frame:preprocess("[[{{#titleparts: {{FULLPAGENAME}}|-1}}]]") end out_str = "<div id=\"contentSub\">" .. "<div style=\"margin: 0.5em;\"></div>" .. "<div class=\"nomobile\" style=\"margin: -0.8em;\"></div>" .. "<div style=\"margin: 0em;\"><span class=\"subpages\">< " .. out_str .. "</span></div></div>" return out_str end return p