Módulo:CapiuntoTest: mudanças entre as edições

De Vugnaes Wiki
Sem resumo de edição
Etiqueta: Reversão manual
Sem resumo de edição
Linha 1: Linha 1:
local capiunto = require 'capiunto'
local p = {}
local p = {}


function p.main(frame)
function p.run(frame)
local args = frame:getParent().args
  local capiunto = require 'capiunto'
local headerStyle
  local args = {}
if args.headerstyle and args.headerstyle ~= '' then
  for i = 1, #frame.args do
headerStyle = string.format('background-color:%s;', args.headerstyle)
    args[i] = frame.args[i]
else
  end
headerStyle = 'background-color:grey;'
  local table = capiunto.create( {
end
    title = tostring(mw.title.getCurrentTitle()),
local retval = capiunto.create( {
    top = 'Above text',
title = args.title,
    topStyle = 'background:#cfc;',
headerStyle = headerStyle,  
    bottom = 'Below text'
} )
  } )
:addImage( args.image, args.caption )
  for i = 3, 2 + #args do
:addRow( 'Foo', args.foo )
    table:addRow(args[i], args[i + 1])
:addHeader( 'A header between the data rows' )
  end
:addRow( 'Bar', args.bar )
  return table
return retval
end
end


return p
return p

Edição das 22h10min de 6 de novembro de 2023


local p = {}

function p.run(frame)
  local capiunto = require 'capiunto'
  local args = {}
  for i = 1, #frame.args do
    args[i] = frame.args[i]
  end
  local table = capiunto.create( {
    title = tostring(mw.title.getCurrentTitle()),
    top = 'Above text',
    topStyle = 'background:#cfc;',
    bottom = 'Below text'
  } )
  for i = 3, 2 + #args do
    table:addRow(args[i], args[i + 1])
  end
  return table
end

return p