Module:inline images
Jump to navigation
Jump to search
- This module lacks a documentation subpage. Please create it.
- Useful links: subpage list • links • transclusions • testcases • sandbox
local export = {}
function export.im(frame)
local params = {
[1] = {list = true, allow_holes = true, required = true},
["alt"] = {list = true, allow_holes = true, required = false},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local maxindex = math.max(args[1].maxindex)
local items = {}
for i = 1, maxindex do
if (args[1][i]) then
local item = "[[File:" .. args[1][i] .. "|frameless|100px"
if args["alt"][i] then
item = item .. "|" .. args["alt"][i]
end
item = item .. "]]"
table.insert(items, item)
end
end
return "<span class=\"inline_images\">" .. table.concat(items, " ") .. "</span>"
end
return export