Module:Variable arguments: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| Line 45: | Line 45: | ||
for k, v in pairs(args) do | for k, v in pairs(args) do | ||
result = result .. string.format("* [[Module:%s]]\n", v) | result = result .. (v == debugg and "" or string.format("* [[Module:%s]]\n", v)) | ||
i = i + 1 | i = i + 1 | ||
end | end | ||
| Line 66: | Line 66: | ||
.. string.format("This template uses [[wikipedia:WP:Lua|Lua]]:\n%s</span>\n", result) | .. string.format("This template uses [[wikipedia:WP:Lua|Lua]]:\n%s</span>\n", result) | ||
.. "|}\n</div>" | .. "|}\n</div>" | ||
return frame:preprocess(debugg == true and "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" or result) | return frame:preprocess(yesno(debugg) == true and "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" or result) | ||
end | end | ||
| Line 78: | Line 78: | ||
for k, v in pairs(args) do | for k, v in pairs(args) do | ||
result = result .. string.format("<span style=\"white-space: nowrap;\">%s</span>, ", | result = result .. (v == debugg and "" or | ||
string.format("<span style=\"white-space: nowrap;\">%s</span>, ", string.gsub(v, "^%s*(.-)%s*$", "%1"))) | |||
i = i + 1 | i = i + 1 | ||
end | end | ||
| Line 104: | Line 104: | ||
if string.lower(v) ~= "false" and string.lower(v) ~= "true" then | if string.lower(v) ~= "false" and string.lower(v) ~= "true" then | ||
result = result .. string.format("<div style=\"margin-left: 10px;\">'''{{w|%s}}'''</div>\n", v) | result = result .. (v == debugg and "" or string.format("<div style=\"margin-left: 10px;\">'''{{w|%s}}'''</div>\n", v)) | ||
end | end | ||
i = i + 1 | i = i + 1 | ||