Aller au contenu

« Module:Charte » : différence entre les versions

De Wikiquestia
Aucun résumé des modifications
Balise : Révoqué
Aucun résumé des modifications
Balise : Révocation manuelle
Ligne 2 : Ligne 2 :


local chartes = {
local chartes = {
  defaut = {
-- Exemple de chartes personnalisées
    titre = "#ddd",
biographie = {
    hr = "#ccc",
titre = "#6eacdc9c",
    header = "Informations générales",
soustitre = "#a9c8e09c",
  },
hr = "#6eacdc9c"
  royaume = {
},
    titre = "#995333",
empire = {
    hr = "#d8c9b8",
titre = "#993333",
    header = '[[Fichier:Drapeau_du_Royaume.png|50px|center]]<br>Informations du Royaume',
soustitre = "#ffcccc",
  },
hr = "#cc6666"
  biographie = {
},
    titre = "#334455",
-- Couleurs par défaut
    hr = "#8899aa",
defaut = {
    header = '[[Fichier:Portrait_Biographie.jpg|40px|left]]<br>Infos biographiques',
titre = "#eaecf0",
  }
soustitre = "#a2a9b1",
hr = "#eaecf0"
}
}
}


function p.couleur(frame)
function p.couleur(frame)
  local args = frame.args or {}
local args = frame.args
  local charte = args.charte or "defaut"
local charte = args["charte"] or "defaut"
  local type_ = args.type or "titre"
local type = args["type"] or "titre"
  if chartes[charte] and chartes[charte][type_] then
    return chartes[charte][type_]
  else
    return chartes.defaut[type_] or ""
  end
end


function p.header(frame)
if chartes[charte] and chartes[charte][type] then
  local args = frame.args or {}
return chartes[charte][type]
  local charte = args.charte or "defaut"
else
  if chartes[charte] and chartes[charte].header then
return chartes["defaut"][type] or "#dddddd"
    return chartes[charte].header
end
  else
    return chartes.defaut.header or ""
  end
end
end


return p
return p

Version du 23 mai 2025 à 21:42

La documentation pour ce module peut être créée à Module:Charte/doc

local p = {}

local chartes = {
	-- Exemple de chartes personnalisées
	biographie = {
		titre = "#6eacdc9c",
		soustitre = "#a9c8e09c",
		hr = "#6eacdc9c"
	},
	empire = {
		titre = "#993333",
		soustitre = "#ffcccc",
		hr = "#cc6666"
	},
	-- Couleurs par défaut
	defaut = {
		titre = "#eaecf0",
		soustitre = "#a2a9b1",
		hr = "#eaecf0"
	}
}

function p.couleur(frame)
	local args = frame.args
	local charte = args["charte"] or "defaut"
	local type = args["type"] or "titre"

	if chartes[charte] and chartes[charte][type] then
		return chartes[charte][type]
	else
		return chartes["defaut"][type] or "#dddddd"
	end
end

return p