Module:Link list: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
mNo edit summary |
(add option for list of formatted template links) |
||
Line 11: | Line 11: | ||
out = out .. ', ' |
out = out .. ', ' |
||
end |
end |
||
if f.args.template~=nil then |
|||
⚫ | |||
out = out .. '<code>{{[[Template:' .. value .. '|' .. value .. ']]}}</code>' |
|||
else |
|||
⚫ | |||
end |
|||
end |
end |
||
return out |
return out |
Revision as of 22:30, 18 June 2024
Documentation for this module may be created at Module:Link list/doc
local p = {}
-- generates a list like: "[[a]], [[b]] and [[c]]"
function p.listPages( f )
local args = require('Module:ProcessArgs').merge()
local out = ''
for index, value in ipairs(args) do
if index == 1 then
elseif index == #args then
out = out .. ' and '
else
out = out .. ', '
end
if f.args.template~=nil then
out = out .. '<code>{{[[Template:' .. value .. '|' .. value .. ']]}}</code>'
else
out = out .. '[[' .. value .. ']]'
end
end
return out
end
return p