Mudanças entre as edições de "Módulo:Skillbox"

De Wiki Gla
Ir para navegação Ir para pesquisar
Linha 25: Linha 25:


     table.insert(out, '></div>')
     table.insert(out, '></div>')
     table.insert(out, frame:expandTemplate{title = '#widget:Skillbox'})
     table.insert(out, frame:preprocess('{{#widget:Skillbox}}'))


     return table.concat(out, '\n')
     return table.concat(out, '\n')

Edição das 20h17min de 25 de maio de 2025

A documentação para este módulo pode ser criada em Módulo:Skillbox/doc

local p = {}

function p.build(frame)
    local args = frame:getParent().args
    local out = {}
    table.insert(out, '<div id="skillbox-data" style="display:none"')

    for i = 1, 15 do
        local hab = args['hab' .. i]
        local de = args['de' .. i]
        local vid = args['vid' .. i]

        if hab or de or vid then
            if hab then
                table.insert(out, string.format(' data-hab%d="%s"', i, mw.text.encode(hab)))
            end
            if de then
                table.insert(out, string.format(' data-de%d="%s"', i, mw.text.encode(de)))
            end
            if vid then
                table.insert(out, string.format(' data-vid%d="%s"', i, mw.text.encode(vid)))
            end
        end
    end

    table.insert(out, '></div>')
    table.insert(out, frame:preprocess('{{#widget:Skillbox}}'))

    return table.concat(out, '\n')
end

return p