Aller au contenu

Module:Infobox/Étoile

Une page de Wikipédia, l'encyclopédie libre.

 Documentation[voir] [modifier] [historique] [purger]

Cette page définit un module d'infobox. Pour les conseils sur l'usage de ce module, voyez Modèle:Infobox Étoile.


local generic = require "Module:Infobox/Fonctions"
local localdata = require "Module:Infobox/Localdata"

local function ascensiondroite()
	local asc, ascnotes = localdata['ascension droite'], localdata['ascension droite notes']
	local str
	if asc then
		str = expandTemplate{ title = 'Ascension droite/avec séparateur', args = {asc} }
	end
	return str
end

local function declinaison()
	local dec, decnotes = localdata['déclinaison'], localdata['déclinaison notes']
	local str
	if dec then
		str = expandTemplate{ title = 'Déc/avec séparateur', args = {dec} }
	end
	return str
end

return 
{
    maincolor = '#CEDAF2',
    parts =
    {
        generic.title(),
        generic.mainimage('Article à illustrer Étoile'),
        {type = 'table', title = "Données d'observation",
            rows = {
                {type = 'row', label = '[[Ascension droite]]', value = function() return ascensiondroite() end},
                {type = 'row', label = '[[Déclinaison (astronomie)|Déclinaison]]', value = function() return declinaison() end},
                {type = 'row', label = '[[Constellation]]', value = function() return constellation() end},
                {type = 'row', label = '[[Magnitude apparente]]', value = function() return magnitudeapparente() end},
            }
        },
    }
}