Module:Variable arguments: Difference between revisions
Jump to navigation
Jump to search
ArrowHead294 (talk | contribs) m No longer needed as list templates have been deprecated |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| Line 8: | Line 8: | ||
local out_str = "" | local out_str = "" | ||
local i = 0 | local i = 0 | ||
for k, v in pairs(args) do | |||
if args == nil or args == "" then | |||
out_str = "[[Module:" .. frame:preprocess("{{ROOTPAGENAME}}") .. "]], " | |||
else | |||
for k, v in pairs(args) do | |||
out_str = out_str .. "[[Module:" .. v .. "]]" .. ", " | |||
i = k | |||
end | |||
end | end | ||
out_str = out_str:sub(1, -3) | out_str = out_str:sub(1, -3) | ||
Revision as of 17:33, 21 September 2024
- This module should not be invoked directly; use its corresponding templates instead.
This module is used to store functions for templates that take a variable number of arguments but do not use Module:Labelled list hatnote:
| Introspection summary for Module:Variable arguments | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||
No function descriptions were provided. The Lua code may have further information.
local mArguments = require("Module:Arguments")
local p = {}
function p.modlink(frame)
local args = mArguments.getArgs(frame, {
parentOnly = true
})
local out_str = ""
local i = 0
if args == nil or args == "" then
out_str = "[[Module:" .. frame:preprocess("{{ROOTPAGENAME}}") .. "]], "
else
for k, v in pairs(args) do
out_str = out_str .. "[[Module:" .. v .. "]]" .. ", "
i = k
end
end
out_str = out_str:sub(1, -3)
.. " – The "
.. string.gsub("module that implement", "()", {[((i > 1) and {7} or {22})[1]] = "s"})
.. " the functionality."
return out_str
end
return p