Mudanças entre as edições de "Módulo:Teste"
Ir para navegação
Ir para pesquisar
m |
m |
||
| Linha 1: | Linha 1: | ||
local p = {} | |||
function p.main(frame) | |||
local args = frame:getParent().args | |||
local titulo = mw.text.trim(args.titulo or '') | |||
local texto = mw.text.trim(args.texto or '') | |||
if titulo == '' then | |||
titulo = 'Sem título' | |||
end | |||
local | local root = mw.html.create('div'):addClass('teste-caixa') | ||
root:tag('h3'):wikitext(titulo) | |||
root:tag('p') | |||
:addClass('teste-corpo') | |||
:addClass('teste-colapsado') | |||
:wikitext(texto) | |||
root:tag('button') | |||
:addClass('teste-toggle') | |||
:attr('type', 'button') | |||
:wikitext('Expandir') | |||
return tostring(root) | |||
end | |||
return p | |||
return | |||
Edição das 00h22min de 1 de abril de 2026
A documentação para este módulo pode ser criada em Módulo:Teste/doc
local p = {}
function p.main(frame)
local args = frame:getParent().args
local titulo = mw.text.trim(args.titulo or '')
local texto = mw.text.trim(args.texto or '')
if titulo == '' then
titulo = 'Sem título'
end
local root = mw.html.create('div'):addClass('teste-caixa')
root:tag('h3'):wikitext(titulo)
root:tag('p')
:addClass('teste-corpo')
:addClass('teste-colapsado')
:wikitext(texto)
root:tag('button')
:addClass('teste-toggle')
:attr('type', 'button')
:wikitext('Expandir')
return tostring(root)
end
return p