<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wicri-demo.istex.fr/Wicri/Agronomie/priv/index.php?action=history&amp;feed=atom&amp;title=Module%3ABandeau</id>
	<title>Module:Bandeau - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wicri-demo.istex.fr/Wicri/Agronomie/priv/index.php?action=history&amp;feed=atom&amp;title=Module%3ABandeau"/>
	<link rel="alternate" type="text/html" href="https://wicri-demo.istex.fr/Wicri/Agronomie/priv/index.php?title=Module:Bandeau&amp;action=history"/>
	<updated>2026-04-19T03:06:08Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.31.10</generator>
	<entry>
		<id>https://wicri-demo.istex.fr/Wicri/Agronomie/priv/index.php?title=Module:Bandeau&amp;diff=54&amp;oldid=prev</id>
		<title>imported&gt;Jacques Ducloy : 1 révision importée</title>
		<link rel="alternate" type="text/html" href="https://wicri-demo.istex.fr/Wicri/Agronomie/priv/index.php?title=Module:Bandeau&amp;diff=54&amp;oldid=prev"/>
		<updated>2020-12-07T15:43:13Z</updated>

		<summary type="html">&lt;p&gt;1 révision importée&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--Ce module implémente les modèles de bandeau.&lt;br /&gt;
&lt;br /&gt;
--Standardisation des bandeaux ([[Catégorie:Modèle de bandeau]]).&lt;br /&gt;
--Créer une fonction exportable pour le modèle {{Bandeau}} (ns:all).&lt;br /&gt;
--Créer une fonction exportable pour les bandeaux d'article (ns:0).&lt;br /&gt;
--Créer une fonction exportable pour les bandeaux de section (ns:0).&lt;br /&gt;
--Créer une fonction exportable pour les bandeaux d'ébauche (ns:0).&lt;br /&gt;
--Créer une fonction exportable pour les bandeaux de discussion (ns:1).&lt;br /&gt;
--Créer une fonction exportable pour les bandeaux système (ns:8).&lt;br /&gt;
--Gérer les images multiples.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local trim = require('Module:Outils').trim&lt;br /&gt;
local yesno = require('Module:yesno')&lt;br /&gt;
local class = mw.loadData('Module:Bandeau/Class')&lt;br /&gt;
local moduleEbauche = 'Module:Bandeau/Ébauche'&lt;br /&gt;
-- local paramEbauche = mw.loadData(moduleEbauche) -- ne sera chargé que pour un bandeau d'ébauche.&lt;br /&gt;
&lt;br /&gt;
local cfg = {&lt;br /&gt;
	forme = 'bandeau-simple',&lt;br /&gt;
	niveau = 'bandeau-niveau-neutre',&lt;br /&gt;
	formatLien = '[[Fichier:%s|%spx|alt=%s]]',&lt;br /&gt;
	tailleIcone = '45x45',&lt;br /&gt;
	public = 'domaine public',&lt;br /&gt;
	erreurArgument = 'Paramètre &amp;lt;code&amp;gt;|%s=&amp;lt;/code&amp;gt; manquant',&lt;br /&gt;
	erreurEbaucheParam = 'le thème « %s » du modèle [[Modèle:Ébauche|{{ébauche}}]] n’est pas [[Aide:Ébauche/Aide paramètres|défini]].',&lt;br /&gt;
	erreurEbaucheType = 'le thème « %s » doit apparaître en tête de liste du modèle [[Modèle:Ébauche|{{ébauche}}]].',&lt;br /&gt;
	ebaucheImage = '&amp;lt;span style=&amp;quot;white-space:nowrap;word-spacing:5px&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt;',&lt;br /&gt;
	ebaucheTitre = '%s est une [[Aide:Ébauche|ébauche]].',&lt;br /&gt;
	ebaucheTitreSujet = '%s est une [[Aide:Ébauche|ébauche]] concernant %s.',&lt;br /&gt;
	ebaucheCateg = '[[Catégorie:Wikipédia:ébauche %s]]',&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function erreur(texte, formatstring, tag)&lt;br /&gt;
	local res = mw.html.create(tag or 'span')&lt;br /&gt;
	res	:addClass('error')&lt;br /&gt;
		:wikitext('Erreur : ')&lt;br /&gt;
&lt;br /&gt;
	if formatstring then&lt;br /&gt;
		res:wikitext(formatstring:format(texte))&lt;br /&gt;
	else&lt;br /&gt;
		res:wikitext(texte)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return tostring(res)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._bandeau(args)&lt;br /&gt;
	local res = mw.html.create('div')&lt;br /&gt;
	local cells = mw.html.create()&lt;br /&gt;
	local icone = trim(args.image) or trim(args['icône'])&lt;br /&gt;
	local backgroundIcone = class.icones[icone] or ''&lt;br /&gt;
	local texte = (trim(args.texte) or erreur('texte', cfg.erreurArgument))&lt;br /&gt;
&lt;br /&gt;
	res	:attr{ id = args.id }&lt;br /&gt;
		:addClass(class.formes[args.forme] or cfg.forme)&lt;br /&gt;
		:addClass(class.niveau[args.niveau] or cfg.niveau)&lt;br /&gt;
		:addClass('plainlinks')&lt;br /&gt;
		:addClass(args.class)&lt;br /&gt;
		:cssText(args.style)&lt;br /&gt;
	&lt;br /&gt;
	if yesno(args.centrer) then&lt;br /&gt;
		cells = mw.html.create('div')&lt;br /&gt;
			:addClass('bandeau-centrer')&lt;br /&gt;
	elseif trim(args.droite) then&lt;br /&gt;
		cells = mw.html.create('div')&lt;br /&gt;
			:css{ display = 'table', width = '100%' }&lt;br /&gt;
	end&lt;br /&gt;
	if icone and backgroundIcone == '' then&lt;br /&gt;
		local iconeWiki = icone&lt;br /&gt;
		if not icone:match('%[') then&lt;br /&gt;
			local alt = args.alt or args['légende'] or ''&lt;br /&gt;
			if alt:lower() == cfg.public then&lt;br /&gt;
				alt = '|link='&lt;br /&gt;
			end&lt;br /&gt;
			if yesno( args['domaine public'] ) then&lt;br /&gt;
				alt = alt .. '|link='&lt;br /&gt;
			end&lt;br /&gt;
			local taille = args['taille icône'] or cfg.tailleIcone&lt;br /&gt;
			iconeWiki = cfg.formatLien:format(icone, taille, alt)&lt;br /&gt;
		end&lt;br /&gt;
		cells&lt;br /&gt;
			:tag('div')&lt;br /&gt;
				:addClass('bandeau-cell bandeau-icone')&lt;br /&gt;
				:wikitext(iconeWiki)&lt;br /&gt;
			:done()&lt;br /&gt;
	elseif backgroundIcone ~= '' and args.forme == 'section' then&lt;br /&gt;
		texte = '&amp;amp;ensp;' .. texte&lt;br /&gt;
	end&lt;br /&gt;
	cells&lt;br /&gt;
		:tag('div')&lt;br /&gt;
			:addClass('bandeau-cell ' .. backgroundIcone)&lt;br /&gt;
			:wikitext(texte)&lt;br /&gt;
			:newline()&lt;br /&gt;
		:done()&lt;br /&gt;
	if trim(args.droite) then&lt;br /&gt;
		cells&lt;br /&gt;
			:tag('div')&lt;br /&gt;
				:addClass('bandeau-cell')&lt;br /&gt;
				:css( 'padding-left', '1em' )&lt;br /&gt;
				:newline()&lt;br /&gt;
				:wikitext(args.droite)&lt;br /&gt;
			:done()&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	res	:node(cells)&lt;br /&gt;
	if trim(args['supplément']) then&lt;br /&gt;
		res	:tag('p')   &lt;br /&gt;
				:wikitext(args['supplément'])&lt;br /&gt;
			:done()&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(res)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._bandeauAvertissement(args)&lt;br /&gt;
	local htmlTexte = mw.html.create()&lt;br /&gt;
&lt;br /&gt;
	htmlTexte&lt;br /&gt;
		:tag('strong')&lt;br /&gt;
			:addClass('bandeau-titre')&lt;br /&gt;
			:wikitext(trim(args.titre) or erreur('titre', cfg.erreurArgument))&lt;br /&gt;
		:done()&lt;br /&gt;
		:wikitext(args.date)&lt;br /&gt;
		:newline():newline()&lt;br /&gt;
		:wikitext(args.texte)&lt;br /&gt;
&lt;br /&gt;
	local parametres = {&lt;br /&gt;
		forme = 'article',&lt;br /&gt;
		niveau = args.niveau,&lt;br /&gt;
		id = args.id,&lt;br /&gt;
		class = args.class,&lt;br /&gt;
		['icône'] = trim(args['icône']) or trim(args['icône-complexe']) or args.niveau,&lt;br /&gt;
		alt = args.alt or args['légende'],&lt;br /&gt;
		['domaine public'] = args['domaine public'],&lt;br /&gt;
		texte = tostring(htmlTexte),&lt;br /&gt;
		['supplément'] = args['supplément'],&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return p._bandeau(parametres)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._bandeauSection(args)&lt;br /&gt;
	local res = mw.html.create('div')&lt;br /&gt;
	local icone = trim(args.image) or trim(args['icône'])&lt;br /&gt;
	local backgroundIcone = class.icones[icone] or ''&lt;br /&gt;
	local texte = '&amp;amp;ensp;' .. (trim(args.texte) or erreur('texte', cfg.erreurArgument))&lt;br /&gt;
&lt;br /&gt;
	res	:addClass('bandeau-section')&lt;br /&gt;
		:addClass(class.niveau[args.niveau] or cfg.niveau)&lt;br /&gt;
	&lt;br /&gt;
	if icone and backgroundIcone == '' then&lt;br /&gt;
		local iconeWiki = icone&lt;br /&gt;
		if not icone:match('%[') then&lt;br /&gt;
			local alt = args.alt or args['légende'] or ''&lt;br /&gt;
			if alt:lower() == cfg.public then&lt;br /&gt;
				alt = '|link='&lt;br /&gt;
			end&lt;br /&gt;
			iconeWiki = cfg.formatLien:format(icone, 'text-top|20x17', alt)&lt;br /&gt;
		end&lt;br /&gt;
		res	:wikitext(iconeWiki)&lt;br /&gt;
			:done()&lt;br /&gt;
	end&lt;br /&gt;
	res	:addClass(backgroundIcone)&lt;br /&gt;
		:wikitext(texte)&lt;br /&gt;
		:done()&lt;br /&gt;
&lt;br /&gt;
	return tostring(res)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- fonction qui inverse la casse du premier caractère d'une chaine&lt;br /&gt;
local function inverserCasse( str )&lt;br /&gt;
	if type( str ) == 'string' then&lt;br /&gt;
		local premierCar = mw.ustring.sub( str, 1, 1 )&lt;br /&gt;
		if mw.ustring.lower( premierCar ) == premierCar then&lt;br /&gt;
			return mw.ustring.upper( premierCar ) .. mw.ustring.sub( str, 2 )&lt;br /&gt;
		else&lt;br /&gt;
			return mw.ustring.lower( premierCar ) .. mw.ustring.sub( str, 2 )&lt;br /&gt;
		end&lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- fonction qui récupètre la ou les tables d'ébauche correspondant au thème&lt;br /&gt;
local function getEbaucheTable( paramEbauche, theme, feminin )&lt;br /&gt;
	-- suprime les marques de direction ltr&lt;br /&gt;
	theme = theme:gsub( '\226\128\142', '' ):gsub( '_', ' ' )&lt;br /&gt;
	-- récupére les paramètres lié au theme, à partir du module:Bandeau/Ébauche&lt;br /&gt;
	local params = {}&lt;br /&gt;
	local ebauche = paramEbauche[ theme ] or paramEbauche[ inverserCasse( theme ) ]&lt;br /&gt;
	if not ebauche and theme:find( ' ' ) then&lt;br /&gt;
		-- teste si l'un des mots du thème correspond à un adjectif existant&lt;br /&gt;
		for adj in theme:gmatch( ' ([^ ]+)' ) do&lt;br /&gt;
			paramsAdj = getEbaucheTable( paramEbauche, adj, feminin )&lt;br /&gt;
			if paramsAdj and paramsAdj.adjectif == true then&lt;br /&gt;
				local nom = theme:gsub( ' ' .. adj:gsub( '(%p)', '%%%1'), '' )&lt;br /&gt;
				params = getEbaucheTable( paramEbauche, nom, feminin )&lt;br /&gt;
				if params then&lt;br /&gt;
					return params, paramsAdj&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		-- aucun mot ne correspond à un adjectif, on essait une autre methode pour trouver une correspondance avec plusieurs mots&lt;br /&gt;
		if theme:find( ' .+ ' ) then&lt;br /&gt;
			for adj, paramsAdj in pairs( paramEbauche ) do&lt;br /&gt;
				if paramsAdj.adjectif == true and theme:find( ' ' .. adj, 2, true ) then&lt;br /&gt;
					local nom = theme:gsub( ' ' .. adj:gsub( '(%p)', '%%%1'), '' )&lt;br /&gt;
					params = getEbaucheTable( paramEbauche, nom, feminin )&lt;br /&gt;
					if params then&lt;br /&gt;
						return params, paramsAdj&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if feminin and ebauche and ebauche.feminin then &lt;br /&gt;
		ebauche = paramEbauche[ ebauche.feminin ]&lt;br /&gt;
	end&lt;br /&gt;
	if ebauche then&lt;br /&gt;
		for n, v in pairs( ebauche ) do&lt;br /&gt;
			params[ n ] = v&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		params = nil&lt;br /&gt;
	end&lt;br /&gt;
	return params, nil&lt;br /&gt;
end&lt;br /&gt;
p.getEbaucheTable = getEbaucheTable&lt;br /&gt;
&lt;br /&gt;
local function femininFromWikidata()&lt;br /&gt;
	local entity = mw.wikibase.getEntity()&lt;br /&gt;
	if entity then&lt;br /&gt;
		local p31 = entity:getBestStatements( 'P31' )&lt;br /&gt;
		local estHumain = type( p31 ) == 'table'&lt;br /&gt;
			and #p31 == 1&lt;br /&gt;
			and type( p31[ 1 ].mainsnak ) == 'table'&lt;br /&gt;
			and type( p31[ 1 ].mainsnak.datavalue ) == 'table'&lt;br /&gt;
			and type( p31[ 1 ].mainsnak.datavalue.value ) == 'table'&lt;br /&gt;
			and p31[ 1 ].mainsnak.datavalue.value['numeric-id'] == 5&lt;br /&gt;
		local p21 = entity:getBestStatements( 'P21' )&lt;br /&gt;
		local estFeminin = type( p21 ) == 'table'&lt;br /&gt;
			and #p21 == 1&lt;br /&gt;
			and type( p21[ 1 ].mainsnak ) == 'table'&lt;br /&gt;
			and type( p21[ 1 ].mainsnak.datavalue ) == 'table'&lt;br /&gt;
			and type( p21[ 1 ].mainsnak.datavalue.value ) == 'table'&lt;br /&gt;
			and p21[ 1 ].mainsnak.datavalue.value['numeric-id'] == 6581072&lt;br /&gt;
		return estHumain, estFeminin&lt;br /&gt;
	end&lt;br /&gt;
	return false, false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p['_ébauche'] = function ( args )&lt;br /&gt;
	local paramEbauche = mw.loadData( moduleEbauche )&lt;br /&gt;
	local page = mw.title.getCurrentTitle()&lt;br /&gt;
	local ebauches, gestionErreur = {}, {}&lt;br /&gt;
	local humain, feminin = femininFromWikidata()&lt;br /&gt;
	feminin = yesno( args[&amp;quot;féminin&amp;quot;], true ) or feminin&lt;br /&gt;
	local estFeminin&lt;br /&gt;
	&lt;br /&gt;
	-- fonction qui retourne la valeur de param pour l'ébauche i, ou une valeur par défaut&lt;br /&gt;
	local ebaucheParam = function( i, param )&lt;br /&gt;
		return ebauches[ i ] and ebauches[ i ][ param ] or paramEbauche[''][ param ]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- récupération des paramètres de tous les thèmes&lt;br /&gt;
	for i, theme in ipairs( args ) do&lt;br /&gt;
		theme = trim( theme )&lt;br /&gt;
		if theme then&lt;br /&gt;
			local t, tAdj = getEbaucheTable( paramEbauche, theme, feminin )&lt;br /&gt;
			if t then&lt;br /&gt;
				table.insert( ebauches, t )&lt;br /&gt;
				table.insert( ebauches, tAdj )&lt;br /&gt;
			else&lt;br /&gt;
				table.insert(&lt;br /&gt;
					gestionErreur, &lt;br /&gt;
					erreur( theme, cfg.erreurEbaucheParam, 'div' )&lt;br /&gt;
				)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- récupération des différents titres, images et catégories&lt;br /&gt;
	local images, titres, categs = {}, {}, {}&lt;br /&gt;
	local tailleIcone = '45x35'&lt;br /&gt;
	if #ebauches &amp;gt; 3 then&lt;br /&gt;
		tailleIcone = '35x25'&lt;br /&gt;
	end&lt;br /&gt;
	for i, ebauche in ipairs( ebauches ) do&lt;br /&gt;
		-- création du lien de l'image&lt;br /&gt;
		local alt = ebauche.altIcone&lt;br /&gt;
		if not alt then&lt;br /&gt;
			if ebauche.sujet then&lt;br /&gt;
				alt = 'image illustrant ' .. ebauche.sujet&lt;br /&gt;
			else&lt;br /&gt;
				alt = ''&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if ebauche.icone then&lt;br /&gt;
			local image = cfg.formatLien:format( ebauche.icone, tailleIcone, alt )&lt;br /&gt;
			table.insert( images, image )&lt;br /&gt;
		end&lt;br /&gt;
		if math.fmod( #ebauches, 3 ) == 1 and ( #ebauches - i ) == 2	&lt;br /&gt;
			or math.fmod( i, 3 ) == 0 and ( #ebauches - i ) &amp;gt; 1&lt;br /&gt;
		then&lt;br /&gt;
			-- sur plusieurs lignes s'il y a plus de 3 images, avec minimum deux images sur la dernière ligne&lt;br /&gt;
			table.insert( images, '&amp;lt;br&amp;gt; ' )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if i &amp;gt; 1 and ebauche.type and ebauche.type ~= paramEbauche[''].type then&lt;br /&gt;
			-- remplace &amp;quot;Cet article par &amp;quot;Ce portail&amp;quot; ou autre en fonction du premier thème&lt;br /&gt;
			table.insert(&lt;br /&gt;
				gestionErreur, &lt;br /&gt;
				erreur( ebauche.nom, cfg.erreurEbaucheType, 'div' )&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- récupères les différents noms de thème&lt;br /&gt;
		if ebauche.adjectif and #titres &amp;gt; 0 then&lt;br /&gt;
			local sujet = ebauche.sujet or ebauche.nom&lt;br /&gt;
			if estFeminin then&lt;br /&gt;
				sujet = ebauche.sujetF or sujet:gsub(&lt;br /&gt;
					ebauche.nom:gsub( '(%p)', '%%%1') .. '%f[%W]', &lt;br /&gt;
					ebauche.feminin&lt;br /&gt;
				)&lt;br /&gt;
			end&lt;br /&gt;
			-- ajout du sujet de l'adjectif dans le sujet de l'ébauche précédente&lt;br /&gt;
			local titre, subst = titres[ #titres ]:gsub( &lt;br /&gt;
				'&amp;lt;(adj[^&amp;gt;]*)&amp;gt;', &lt;br /&gt;
				{ adjectif = sujet, adj = ebauche.nom, adjF = ebauche.feminin }&lt;br /&gt;
			)&lt;br /&gt;
			if subst &amp;gt; 0 then&lt;br /&gt;
				titres[ #titres ] = titre&lt;br /&gt;
			else&lt;br /&gt;
				titres[ #titres ] = titre .. ' ' .. sujet&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			table.insert( titres, ebauche.sujet )&lt;br /&gt;
			estFeminin = ebauche.estFeminin or ( ebauche.sujet == '' and estFeminin )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- mise en forme des catégories&lt;br /&gt;
		if ebauche.adjectif then&lt;br /&gt;
			-- tentative d'ajout du nom de l'adjectif dans les catégories précédentes&lt;br /&gt;
			local modif = false&lt;br /&gt;
			for k, v in ipairs( categs ) do&lt;br /&gt;
				local cat, subst = v:gsub( &lt;br /&gt;
					'&amp;lt;(adj[^&amp;gt;]*)&amp;gt;', &lt;br /&gt;
					{ adj = ebauche.nom, adjF =  ebauche.feminin,  adjectif = ebauche.nom }&lt;br /&gt;
				)&lt;br /&gt;
				if subst == 0 then&lt;br /&gt;
					cat = v .. ' ' .. ebauche.nom&lt;br /&gt;
				end&lt;br /&gt;
				if mw.title.new( 'Catégorie:Wikipédia:ébauche ' .. cat ).exists then&lt;br /&gt;
					categs[ k ] = cat&lt;br /&gt;
					modif = true&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if not modif &lt;br /&gt;
				and humain &lt;br /&gt;
				and mw.title.new( 'Catégorie:Wikipédia:ébauche personnalité ' .. ebauche.feminin ).exists&lt;br /&gt;
			then&lt;br /&gt;
				table.insert( categs, 'personnalité ' .. ebauche.feminin )&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		table.insert( categs, ebauche.categ )&lt;br /&gt;
		table.insert( categs, ebauche.categ2 )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- mise en forme des images&lt;br /&gt;
	local image &lt;br /&gt;
	if trim( args['icône'] ) then&lt;br /&gt;
		local theme = getEbaucheTable( paramEbauche, args['icône'] )&lt;br /&gt;
		if theme and theme.icone then&lt;br /&gt;
			image = cfg.formatLien:format(&lt;br /&gt;
				theme.icone, &lt;br /&gt;
				tailleIcone, &lt;br /&gt;
				theme.altIcone or ( 'image illustrant ' .. theme.sujet )&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
	elseif #images == 1 then&lt;br /&gt;
		image = images[ 1 ]&lt;br /&gt;
	elseif #images &amp;gt; 1 then&lt;br /&gt;
		image = cfg.ebaucheImage:format( table.concat( images, ' ' ) )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- mise en forme du titre&lt;br /&gt;
	local titre&lt;br /&gt;
	if #titres &amp;gt; 0 then&lt;br /&gt;
		titre = cfg.ebaucheTitreSujet:format( &lt;br /&gt;
			ebaucheParam( 1, 'type' ), &lt;br /&gt;
			mw.text.listToText( titres )&lt;br /&gt;
		)&lt;br /&gt;
	else&lt;br /&gt;
		titre = cfg.ebaucheTitre:format( ebaucheParam( 1, 'type' ) )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- mise en forme du texte&lt;br /&gt;
	local texte&lt;br /&gt;
	if #ebauches == 0 then&lt;br /&gt;
		texte = ( ebaucheParam( 1, 'message' ) ) .. '.'&lt;br /&gt;
	else&lt;br /&gt;
		local message = ebaucheParam( 1, 'message' )&lt;br /&gt;
		local selon = ebaucheParam( 1, 'selon' )&lt;br /&gt;
		-- ajout d'un point si le paramètre selon commence par un retour ligne ou une majuscule&lt;br /&gt;
		if message:sub( -1 ) == ')' and ( selon:sub( 1, 3 ) == '&amp;lt;br' or mw.ustring.match( selon, '^%u' ) ) then&lt;br /&gt;
			texte = ( ebaucheParam( 1, 'message' ) ) .. '. ' .. ( ebaucheParam( 1, 'selon' ) ) .. '.'&lt;br /&gt;
		else&lt;br /&gt;
			texte = ( ebaucheParam( 1, 'message' ) ) .. ' ' .. ( ebaucheParam( 1, 'selon' ) ) .. '.'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- ajout d'un texte s'il y a une liste de tâches&lt;br /&gt;
	local todo = mw.title.makeTitle( mw.site.namespaces[ page.namespace ].talk.id, page.text .. '/À faire' )&lt;br /&gt;
	if todo.exists then&lt;br /&gt;
		texte = texte .. '\n\n'&lt;br /&gt;
			.. 'Consultez la liste des &amp;lt;b&amp;gt;tâches à accomplir&amp;lt;/b&amp;gt; en [['&lt;br /&gt;
			.. page.talkPageTitle.prefixedText&lt;br /&gt;
			.. '|page de discussion]].'&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- paramètres pour le bandeau&lt;br /&gt;
	local parametres = {&lt;br /&gt;
		niveau = 'ébauche',&lt;br /&gt;
		['icône'] = image,&lt;br /&gt;
		titre = titre:gsub( ' &amp;lt;adj[^&amp;gt;]*&amp;gt;', '' ),&lt;br /&gt;
		texte = texte,&lt;br /&gt;
		id = args.id&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	-- concaténation des différentes catégories (pas de catégorisation si nocat, ou page de discussion, ou espace utilisateur)&lt;br /&gt;
	local categ = ''&lt;br /&gt;
	local messageErreur = table.concat( gestionErreur )&lt;br /&gt;
	if not ( yesno( args.nocat, true, false ) or page.isTalkPage or page.namespace == 2 ) then&lt;br /&gt;
		for i = 1, #categs do&lt;br /&gt;
			categs[ i ] = cfg.ebaucheCateg:format( categs[ i ] )&lt;br /&gt;
		end&lt;br /&gt;
		categ = table.concat( categs ):gsub( ' &amp;lt;[^&amp;gt;]*&amp;gt;', '' )&lt;br /&gt;
		if categ == '' then&lt;br /&gt;
			categ = cfg.ebaucheCateg:format('')&lt;br /&gt;
		end&lt;br /&gt;
		if #gestionErreur &amp;gt; 0 then&lt;br /&gt;
			messageErreur = messageErreur .. '[[Catégorie:Ébauche inconnue]]'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
	return p._bandeauAvertissement( parametres ) .. messageErreur .. categ&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
-- fonction retournant un paramètre d'une table d'ébauche.&lt;br /&gt;
-- Elle est prévue pour être appelée directement par #invoke:&lt;br /&gt;
-- avec pour paramètres le thème et le paramètre désiré&lt;br /&gt;
-- Cette fonction est principalement destinée à la page d'aide.&lt;br /&gt;
function p.parametreEbauche( frame )&lt;br /&gt;
	local paramEbauche = mw.loadData( moduleEbauche )&lt;br /&gt;
	local theme = frame.args[1]&lt;br /&gt;
	local param = frame.args[2]&lt;br /&gt;
	if paramEbauche[ theme ] then&lt;br /&gt;
		return paramEbauche[ theme ][ param ]&lt;br /&gt;
	elseif paramEbauche[ inverserCasse( theme ) ] then&lt;br /&gt;
		return paramEbauche[ inverserCasse( theme ) ][ param ]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- &lt;br /&gt;
-- Fonction retournant le féminin d'un théme d'ébauche&lt;br /&gt;
-- Elle est prévue pour être appelée directement par #invoke:&lt;br /&gt;
-- avec pour paramètres le thème et le paramètre désiré&lt;br /&gt;
-- Cette fonction est principalement destinée au modèle {{Catégorie d'ébauche}}, donc une valeur n'est retournée que si les catégories sont identiques&lt;br /&gt;
function p.femininEbauche( frame )&lt;br /&gt;
	local paramEbauche = mw.loadData( moduleEbauche )&lt;br /&gt;
	local theme = frame.args[1]&lt;br /&gt;
	local themeF&lt;br /&gt;
	if theme then&lt;br /&gt;
		local t = getEbaucheTable( paramEbauche, theme )&lt;br /&gt;
		local tF, tAdjF = getEbaucheTable( paramEbauche, theme, true )&lt;br /&gt;
		if t.feminin and  tF.categ == t.categ then&lt;br /&gt;
			if tAdjF then&lt;br /&gt;
				themeF = tF.nom .. ' ' .. tAdjF.feminin&lt;br /&gt;
			elseif tF then&lt;br /&gt;
				themeF = tF.nom&lt;br /&gt;
			end&lt;br /&gt;
			return themeF&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
-- fonction qui contruit deux tableaux récapitulatif de l'ensemble des paramètres d'ébauche&lt;br /&gt;
function p.tableParametresEbauches( frame )&lt;br /&gt;
	local paramEbauche = mw.loadData( moduleEbauche )&lt;br /&gt;
	local params, paramAdj, paramType = {}, {}, {}&lt;br /&gt;
	local wikiTab = { '&amp;lt;table class=&amp;quot;wikitable sortable&amp;quot; style=&amp;quot;table-layout:fixed;&amp;quot;&amp;gt;' }&lt;br /&gt;
	wikiTab.insert = function ( t, value )&lt;br /&gt;
		table.insert( t, value )&lt;br /&gt;
		return t&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for clef, ebauche in pairs( paramEbauche ) do&lt;br /&gt;
		local kEbauche = {}&lt;br /&gt;
		for k, v in pairs( ebauche ) do&lt;br /&gt;
			kEbauche[ k ] = v&lt;br /&gt;
		end&lt;br /&gt;
		kEbauche.clef = clef&lt;br /&gt;
		if ebauche.type then&lt;br /&gt;
			table.insert( paramType, kEbauche )&lt;br /&gt;
		elseif ebauche.adjectif then&lt;br /&gt;
			if clef == ebauche.nom or clef ~= ebauche.feminin then&lt;br /&gt;
				table.insert( paramAdj, kEbauche )&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			table.insert( params, kEbauche )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local comp = function( eb1, eb2 )&lt;br /&gt;
		return eb1.clef &amp;lt; eb2.clef&lt;br /&gt;
	end&lt;br /&gt;
	table.sort( params, comp )&lt;br /&gt;
	table.sort( paramAdj, comp )&lt;br /&gt;
	table.sort( paramType, comp )&lt;br /&gt;
	&lt;br /&gt;
	wikiTab&lt;br /&gt;
		:insert('\n=== Ébauches normales ===\n')&lt;br /&gt;
		:insert('&amp;lt;caption&amp;gt;Liste des paramètres d\'ébauche&amp;lt;/caption&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col style=&amp;quot;width:15%;&amp;quot;&amp;gt;nom&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col style=&amp;quot;width:50px; box-sizing:border-box;&amp;quot;&amp;gt;i&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col style=&amp;quot;width:20%;&amp;quot;&amp;gt;sujet&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col style=&amp;quot;width:20%;&amp;quot;&amp;gt;catégorie&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col&amp;gt;selon&amp;lt;/th&amp;gt;')&lt;br /&gt;
	for k, ebauche in ipairs( params ) do&lt;br /&gt;
			wikiTab&lt;br /&gt;
			:insert('&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
			:insert( ebauche.clef )&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
		if ebauche.icone then&lt;br /&gt;
			wikiTab:insert( cfg.formatLien:format( ebauche.icone, '45x35', ebauche.altIcone or '' ) )&lt;br /&gt;
		end&lt;br /&gt;
		wikiTab&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
			:insert( ebauche.sujet )&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
		if ebauche.categ then&lt;br /&gt;
			wikiTab&lt;br /&gt;
				:insert( '[[:Catégorie:Wikipédia:ébauche ' .. ebauche.categ .. '|' .. ebauche.categ .. ']]' )&lt;br /&gt;
		end&lt;br /&gt;
		if ebauche.cageg2 then&lt;br /&gt;
			wikiTab&lt;br /&gt;
				:insert('&amp;lt;br&amp;gt;')&lt;br /&gt;
				:insert( '[[:Catégorie:Wikipédia:ébauche ' .. ebauche.categ2 .. '|' .. ebauche.categ2 .. ']]' )&lt;br /&gt;
		end&lt;br /&gt;
		wikiTab&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
			:insert( ebauche.selon )&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;')&lt;br /&gt;
	end&lt;br /&gt;
	wikiTab:insert('&amp;lt;/table&amp;gt;')&lt;br /&gt;
	&lt;br /&gt;
	-- seconde table pour les adjectifs&lt;br /&gt;
	wikiTab&lt;br /&gt;
		:insert('\n=== Adjectifs ===\n')&lt;br /&gt;
		:insert('&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;caption&amp;gt;Liste des adjectifs&amp;lt;/caption&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col&amp;gt;adjectif&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col&amp;gt;féminin&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col style=&amp;quot;width:50px;&amp;quot;&amp;gt;icone&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col&amp;gt;sujet&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col&amp;gt;sujet féminin&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col&amp;gt;catégorie&amp;lt;/th&amp;gt;')&lt;br /&gt;
	for k, ebauche in ipairs( paramAdj ) do&lt;br /&gt;
		wikiTab&lt;br /&gt;
			:insert('&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
			:insert( ebauche.clef )&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
			:insert( ebauche.feminin )&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
		if ebauche.icone then&lt;br /&gt;
			wikiTab&lt;br /&gt;
				:insert( cfg.formatLien:format( ebauche.icone, '45x35', ebauche.altIcone or '' ) )&lt;br /&gt;
		end&lt;br /&gt;
		wikiTab&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
			:insert( ebauche.sujet )&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
			:insert( ebauche.sujetF or ebauche.sujet:gsub( ebauche.nom .. '%f[%W]', ebauche.feminin ) )&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
		if ebauche.categ then&lt;br /&gt;
			wikiTab&lt;br /&gt;
				:insert( '[[:Catégorie:Wikipédia:ébauche ' .. ebauche.categ .. '|' .. ebauche.categ .. ']]' )&lt;br /&gt;
		end&lt;br /&gt;
		wikiTab&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;')&lt;br /&gt;
	end&lt;br /&gt;
	wikiTab:insert('&amp;lt;/table&amp;gt;')&lt;br /&gt;
	&lt;br /&gt;
	-- troisième table pour les types&lt;br /&gt;
	wikiTab&lt;br /&gt;
		:insert('\n=== Types ===\n')&lt;br /&gt;
		:insert('&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;caption&amp;gt;Liste des paramètres de type&amp;lt;/caption&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col style=&amp;quot;width:15%;&amp;quot;&amp;gt;nom&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col style=&amp;quot;width:50px;&amp;quot;&amp;gt;icone&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col style=&amp;quot;width:20%;&amp;quot;&amp;gt;type&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col style=&amp;quot;width:15%;&amp;quot;&amp;gt;sujet&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col style=&amp;quot;width:15%;&amp;quot;&amp;gt;catégorie&amp;lt;/th&amp;gt;')&lt;br /&gt;
		:insert('&amp;lt;th scope=col&amp;gt;message&amp;lt;/th&amp;gt;')&lt;br /&gt;
	for k, ebauche in ipairs( paramType ) do&lt;br /&gt;
		wikiTab&lt;br /&gt;
			:insert('&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
			:insert( ebauche.clef )&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
		if ebauche.icone then&lt;br /&gt;
			wikiTab:insert( cfg.formatLien:format( ebauche.icone, '45x35', ebauche.altIcone or '' ) )&lt;br /&gt;
		end&lt;br /&gt;
		wikiTab&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
			:insert ( ebauche.type )&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
			:insert( ebauche.sujet )&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
		if ebauche.categ then&lt;br /&gt;
			wikiTab:insert( '[[:Catégorie:Wikipédia:ébauche ' .. ebauche.categ .. '|' .. ebauche.categ .. ']]' )&lt;br /&gt;
		end&lt;br /&gt;
		wikiTab&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;')&lt;br /&gt;
			:insert( ebauche.message )&lt;br /&gt;
			:insert('&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;')&lt;br /&gt;
	end&lt;br /&gt;
	wikiTab:insert('&amp;lt;/table&amp;gt;')&lt;br /&gt;
	&lt;br /&gt;
	return table.concat( wikiTab ):gsub( ' &amp;lt;adjF?&amp;gt;', '' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- fonction destiné au gadget MediaWiki:Gadget-BandeauxEbauches.js&lt;br /&gt;
function p.listeEbauches( frame )&lt;br /&gt;
	local paramEbauche = mw.loadData( moduleEbauche )&lt;br /&gt;
	local liste = {}&lt;br /&gt;
	for k in pairs( paramEbauche ) do&lt;br /&gt;
		if k ~=&amp;quot;&amp;quot; then&lt;br /&gt;
			table.insert( liste, k )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	table.sort( liste )&lt;br /&gt;
	return table.concat( liste, '\n' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Insertion dans la table p des fonctions appelées par les&lt;br /&gt;
-- modèles à l'aide d'un adaptateur de fonction.&lt;br /&gt;
local function adaptateur(nomFonction)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args&lt;br /&gt;
		if frame.args.texte or frame.args.titre then&lt;br /&gt;
			args = frame.args&lt;br /&gt;
		else&lt;br /&gt;
			args = frame:getParent().args&lt;br /&gt;
		end&lt;br /&gt;
		return p[nomFonction](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
local nomsFonction = {'bandeau', 'bandeauAvertissement', 'bandeauSection', 'ébauche' } &lt;br /&gt;
for _, nomFonction in ipairs(nomsFonction) do&lt;br /&gt;
	p[nomFonction] = adaptateur('_' .. nomFonction)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Jacques Ducloy</name></author>
		
	</entry>
</feed>