Module:Lua banner: Difference between revisions
From Video Credit Archive
Content deleted Content added
wikpedia>Mr. Stradivarius create replacement for Template:Lua |
wikpedia>Mr. Stradivarius fix pattern bug in p.main, and use a separate table for making the module links |
||
Line 12: | Line 12: | ||
local args = {} |
local args = {} |
||
for k, v in pairs(origArgs) do |
for k, v in pairs(origArgs) do |
||
v = v:match('^%s*(.-)%s*') |
v = v:match('^%s*(.-)%s*$') |
||
if v ~= '' then |
if v ~= '' then |
||
args[k] = v |
args[k] = v |
||
Line 32: | Line 32: | ||
boxArgs.text = '<strong class="error">Error: no modules specified</strong>' |
boxArgs.text = '<strong class="error">Error: no modules specified</strong>' |
||
else |
else |
||
local moduleLinks = {} |
|||
⚫ | |||
for i, module in ipairs(modules) do |
|||
moduleLinks[i] = string.format('[[:%s]]', module) |
|||
end |
|||
⚫ | |||
boxArgs.text = 'Uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList |
boxArgs.text = 'Uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList |
||
end |
end |