Module:Link list: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(Created page with "local p = {} -- generates a list like: "a, b and c" function p.listPages( f ) local args = require('Module:ProcessArgs').merge(true) local out = '' for index, value in ipairs(args) do if index == 1 then elseif index == #args then out = out .. ' and ' else out = out .. ', ' end out = out .. '' .. value .. '' end return out end return p") |
mNo edit summary |
||
Line 2: | Line 2: | ||
-- generates a list like: "[[a]], [[b]] and [[c]]" |
-- generates a list like: "[[a]], [[b]] and [[c]]" |
||
function p.listPages( f ) |
function p.listPages( f ) |
||
local args = require('Module:ProcessArgs').merge( |
local args = require('Module:ProcessArgs').merge() |
||
local out = '' |
local out = '' |
||
for index, value in ipairs(args) do |
for index, value in ipairs(args) do |
Revision as of 00:27, 10 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
out = out .. '[[' .. value .. ']]'
end
return out
end
return p