Mudanças entre as edições de "Módulo:Skillbox"
Ir para navegação
Ir para pesquisar
(Limpou toda a página) Etiqueta: anulando |
|||
| Linha 1: | Linha 1: | ||
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:expandTemplate{title = '#widget:Skillbox'}) | |||
return table.concat(out, '\n') | |||
end | |||
return p | |||
Edição das 20h16min 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:expandTemplate{title = '#widget:Skillbox'})
return table.concat(out, '\n')
end
return p