No edit summary
No edit summary
Line 6: Line 6:
     local output = ""
     local output = ""
     local outer_div_style = string.format(' style="width:%s;"', size)
     local outer_div_style = string.format(' style="width:%s;"', size)
     output = output .. '<div class="outer-container"' .. outer_div_style .. '>\n<div class="image-sequence">\n'
     output = output .. '<div class="image-sequence"' .. outer_div_style .. '>\n<div class="image-sequence-row">\n'


     local index = 1
     local index = 1

Revision as of 00:55, 23 November 2025

Documentation for this module may be created at Module:ImageSequence/doc

local p = {}

function p.render(frame)
    local args = frame:getParent().args
    local size = args["size"] or "200px"
    local output = ""
    local outer_div_style = string.format(' style="width:%s;"', size)
    output = output .. '<div class="image-sequence"' .. outer_div_style .. '>\n<div class="image-sequence-row">\n'

    local index = 1
    while true do
        local paramName
        if index == 1 then
            paramName = "image"
        else
            paramName = "image" .. index
        end

        local imageName = args[paramName]
        if not imageName then
            break
        end

        output = output .. string.format('[[File:%s|thumb|%s]]\n', imageName, size)

        index = index + 1
    end

    output = output .. '</div>\n</div>'

    return output
end

return p