« Module:Infobox personnage » : différence entre les versions
De WikiPerche
Page créée avec « local capiunto = require 'capiunto' local p = {} function p.main(frame) local args = frame:getParent().args local headerStyle if args.headerstyle and args.headerstyle ~= '' then headerStyle = string.format('background-color:%s;', args.headerstyle) else headerStyle = 'background-color:grey;' end local titleStyle if args.titleStyle and args.titleStyle ~= '' then titleStyle = string.format('background-color:%s;', args.titleStyle) else titleSt... » |
Aucun résumé des modifications |
||
| Ligne 9 : | Ligne 9 : | ||
headerStyle = string.format('background-color:%s;', args.headerstyle) | headerStyle = string.format('background-color:%s;', args.headerstyle) | ||
else | else | ||
headerStyle = 'background-color: | headerStyle = 'background-color:#E3C234;' | ||
end | end | ||
local titleStyle | local titleStyle | ||
| Ligne 15 : | Ligne 15 : | ||
titleStyle = string.format('background-color:%s;', args.titleStyle) | titleStyle = string.format('background-color:%s;', args.titleStyle) | ||
else | else | ||
titleStyle= 'background-color: | titleStyle= 'background-color:#E3C234;' | ||
end | end | ||
local retval = capiunto.create( { | local retval = capiunto.create( { | ||
Version du 7 octobre 2026 à 13:28
La documentation pour ce module peut être créée à Module:Infobox personnage/doc
local capiunto = require 'capiunto'
local p = {}
function p.main(frame)
local args = frame:getParent().args
local headerStyle
if args.headerstyle and args.headerstyle ~= '' then
headerStyle = string.format('background-color:%s;', args.headerstyle)
else
headerStyle = 'background-color:#E3C234;'
end
local titleStyle
if args.titleStyle and args.titleStyle ~= '' then
titleStyle = string.format('background-color:%s;', args.titleStyle)
else
titleStyle= 'background-color:#E3C234;'
end
local retval = capiunto.create( {
title = args.title,
titleStyle = titleStyle,
headerStyle = headerStyle,
} )
:addImage( args.image, args.caption )
:addRow( 'Nom complet', args.nomcomplet )
:addRow( 'Naissance', args.naissance )
:addRow( 'Décès', args.deces )
:addHeader( 'Métier & vocations' )
:addRow( 'Métier(s)', args.metiers)
:addRow( 'Mandat(s)', args.mandats)
return retval
end
return p
