Jump to content

Module:Metrics dashboard

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Harej (talk | contribs) at 22:18, 27 April 2023 (spans). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}

local function listItem(value, label)
    return string.format('* <span class="md-value">%s</span><span class="md-label">%s</span>', value, label)
end

function p.list(frame)
    local output = ''
    local i = 1
    local args = frame:getParent().args

    while args['figure' .. i .. '-value'] and args['figure' .. i .. '-label'] do
        local value = args['figure' .. i .. '-value']
        local label = args['figure' .. i .. '-label']

        output = output .. listItem(value, label) .. '\n'

        i = i + 1
    end

    return output
end

return p