Aller au contenu

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

De Wreck
Modèle:Pistes>Escargot bleu
création brouillon
 
m 56 versions importées
 
(55 versions intermédiaires par 2 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
--[[local p = {}
-- luacheck: globals mw, no max line length
 
local p = {}


local langue = require 'Module:Langue'
local langue = require 'Module:Langue'


local nbPistes = 0
function p.tableauPistes( frame )
-- 1. Lecture des paramètres
local args = {}
local rowArgsTable = {}
local maxNumPiste = 0


local function piste (i)
-- map de noms de paramètres "alias → nom canonique" (attention à bien utiliser le nom canonique dans le code du module)
if {{{piste1|{{{title1|}}}}}} or {{{note1|}}} or {{{temps1|{{{length1|}}}}}} then
local aliases = {
local ligne = mw.html.create( 'tr' )
headline = 'titre',
    if i%2 == 0 then
total_length = 'total_temps',
    ligne:css( 'background-color', 'var(--background-color-base, #fff)')
lyrics_credits = 'credits_paroles',
    else
music_credits = 'credits_musique',
    ligne:css( 'background-color', '#f7f7f7') --couleur pas adaptée selon mode sombre / pas sombre
writing_credits = 'credits_ecriture',
    end
extra_column = 'colonne_extra',
ligne
}
:tag( 'th' )
 
:attr{ scope = 'row' }
-- même chose avec les paramètres "trucmucheN"
:cssText( 'padding-right: 10px; text-align: right;font-weight:normal;' )
local aliasesN = {
:wikitext( {{{numero1|1}}}. )
title = 'piste',
  <td style="text-align: left;">
length = 'temps',
if {{{piste1|{{{title1|}}}}}} then
lyrics = 'paroles',
if {{{langue|}}} then
music = 'musique',
{{#invoke:Langue|{{{langue|}}}|{{#ifeq: {{#invoke:Langue|nonLatin| {{{piste1|{{{title1|}}}}}} }} | true | {{{2}}} | ''<nowiki/>{{{piste1|{{{title1|}}}}}}<nowiki/>'' }}}}
writer = 'auteur',
else
}
{{#ifeq: {{#invoke:Langue|nonLatin| {{{piste1|{{{title1|}}}}}} }} | true | {{{piste1|{{{title1|}}}}}} | ''<nowiki/>{{{piste1|{{{title1|}}}}}}<nowiki/>''
else
Sans titre
if {{{note1|}}} then
' <small>({{{note1|}}})</small>'
end
</td>
if {{{credits_paroles}}} == 'oui' then
<td>{{{paroles1|{{{lyrics1|}}}}}}</td>
end
if {{{credits_musique}}} == 'oui' then
<td>{{{musique1|{{{music1|}}}}}}</td>
end
if {{{credits_ecriture}}} == 'oui' then
<td>{{{auteur1|{{{writer1|}}}}}}</td>
end
if {{{colonne_extra|}}} then
<td>{{{extra1|}}}</td>
end
<td style="padding-right: 10px; text-align: right;">{{{temps1|{{{length1|}}}}}}</td>
</tr>
end
end


function p.main( frame )
local args = {}
for k, v in pairs(frame:getParent().args) do
for k, v in pairs(frame:getParent().args) do
local matchNb = mw.ustring.match( k, '(.+)(%d+)' )
--[[
if matchNb
match:
local param, nb = matchNb[1], matchNb[2]
* foobar42
if args[nb] == nil then
* foo21bar42 (digits in base name)
if nb > nbPistes
* 21foo42 (leading digits in base name)
nbPistes = nb
* foobar0 (track zero)
 
do not match:
* 42 (only digits)
* foobar (no digits suffix)
* foobar042 (leading zeroes)
 
alternative pattern: ^(.+)%f[%d]([1-9]%d*)$
--]]
local param, num = string.match( k, '^(.*%D)([1-9]%d*)$' ) -- in this specific case, multibyte mw.ustring.match() is not needed
if not param then
param, num = string.match( k, '^(.*%D)(0)$' ) -- also search for track zero
end
if param then
if aliasesN[param] then
param = aliasesN[param]
end
if v ~= "" or param == "numero" then -- il est possible de renseigner des paramètres « numeroN » vides
num = tonumber(num)
if rowArgsTable[num] == nil then
if num > maxNumPiste then
maxNumPiste = num
end
rowArgsTable[num] = {}
end
end
args[nb] = {}
rowArgsTable[num][param] = v
end
end
args[nb][param] = v
else
else
args[k] = v -- manque résolution des alias
if aliases[k] then
k = aliases[k]
end
local trimmed = ( type(k) == "number" ) and mw.text.trim(v) or v
if trimmed ~= "" then
args[k] = trimmed
end
end
end
end
end


-- 2. Initialisation du tableau de la liste des titres
local divPistes = mw.html.create( 'div' )
:addClass( "overflow pistes-marge" )
:css({
['margin-bottom'] = args.total_temps and '0.5em' or '1em'
})
local tabPistes = divPistes
:tag( "table" )
:addClass( "tracklist" .. (args.collapsed == 'oui' and " collapsible collapsed" or "") )
:attr( 'cellpadding', "0" )
-- 3. Éventuel code avant l'entête du tableau (titre ou boîte repliable)
if args.titre then
tabPistes
:tag( "tr" )
:tag( "th" )
:addClass( "tlheader pistes-titre" )
:attr( "scope", "col" )
:attr( "colspan", "10" )
:wikitext( (args["langue titre"] or args["langue titres"]) and langue.langue({ args["langue titre"] or args["langue titres"], args.titre }) or args.titre )
elseif args.collapsed == 'oui' then
tabPistes
:tag( "tr" )
:tag( "th" )
:addClass( "tlheader pistes-titre" )
:attr( "colspan", "10" )
:wikitext( "&nbsp;" )
end
-- 4. Création de l'entête du tableau
local nbColonnesExtra = (args.credits_paroles and 1 or 0) + (args.credits_musique and 1 or 0) + (args.credits_ecriture and 1 or 0) + (args.colonne_extra and 1 or 0)
local entetesPistes = tabPistes
:tag( "tr" )
:tag( "th" ) -- Colonne « Numéro »
:addClass( "tlheader pistes-entete" )
:attr( "scope", "col" )
:css({
width = '20px',
['padding-left'] = '10px',
['padding-right'] = '10px',
['text-align'] = 'right'
})
:wikitext( '<abbr class="abbr" title="Numéro">N<sup>o</sup></abbr>' ) -- résultat de {{Numéro avec majuscule|espace=non}}
:done()
:tag( "th" ) -- Colonne « Titre »
:addClass( "tlheader pistes-entete" )
:attr( "scope", "col" )
:css({
width = ({[0]='100%', [1]='60%', [2]='40%', [3]='30%', [4]='20%'})[nbColonnesExtra]
})
:wikitext( "Titre" )
:done()
if args.credits_paroles == 'oui' then -- Colonne « Paroles »
entetesPistes
:tag( "th" )
:addClass( "pistes-entete" )
:attr( "scope", "col" )
:css({
width = ({[1]='40%', [2]='30%', [3]='20%', [4]='20%'})[nbColonnesExtra]
})
:wikitext( "Paroles" )
:done()
end
if args.credits_musique == 'oui' then -- Colonne « Musique »
entetesPistes
:tag( "th" )
:addClass( "pistes-entete" )
:attr( "scope", "col" )
:css({
width = ({[1]='40%', [2]='30%', [3]='20%', [4]='20%'})[nbColonnesExtra]
})
:wikitext( "Musique" )
:done()
end
if args.credits_ecriture == 'oui' then -- Colonne « Auteur »
entetesPistes
:tag( "th" )
:addClass( "pistes-entete" )
:attr( "scope", "col" )
:css({
width = ({[1]='40%', [2]='30%', [3]='20%', [4]='20%'})[nbColonnesExtra]
})
:wikitext( "Auteur" )
:done()
end
if args.colonne_extra then -- Colonne extra
entetesPistes
:tag( "th" )
:addClass( "pistes-entete" )
:attr( "scope", "col" )
:css({
width = ({[1]='40%', [2]='30%', [3]='20%', [4]='20%'})[nbColonnesExtra]
})
:wikitext( args.colonne_extra )
:done()
end
entetesPistes
:tag( "th" ) -- Colonne « Durée »
:addClass( "tlheader pistes-entete" )
:attr( "scope", "col" )
:css({
width = '60px',
['padding-right'] = '10px',
['text-align'] = 'right'
})
:wikitext( "Durée" )
:done()
-- 5. Tracé des lignes du tableau
for i = 0, maxNumPiste do -- on commence à 0, pour éventuel [[morceau caché]] dans le [[prégap]]
local rowArgs = rowArgsTable[i]
if rowArgs and (rowArgs.piste or rowArgs.note or rowArgs.temps) then
local ligne = tabPistes:tag( 'tr' )
local numero
if rowArgs.numero == '' then
numero = ''
else
numero = (rowArgs.numero or tostring(i)) .. '.'
end
ligne
:addClass( (i%2 == 0) and 'pistes-pair' or 'pistes-impair' )
:tag( 'th' )
:addClass( "pistes-numero" )
:attr{ scope = 'row' }
:wikitext( numero )
local titrePiste = rowArgs.piste
if titrePiste then
if langue.nonLatin( titrePiste ) then
titrePiste = '<cite style="font-style:normal">' .. titrePiste .. '</cite>'
else
titrePiste = '<cite>' .. titrePiste .. '</cite>'
end
if rowArgs["langue titre"] or args["langue titres"] then -- "langue titreN" puis "langue titres"
titrePiste = langue.langue({ rowArgs["langue titre"] or args["langue titres"], titrePiste })
end
else
titrePiste = 'Sans titre'
end
ligne:tag( 'td' ):wikitext(titrePiste .. (rowArgs.note and (' <small>(' .. rowArgs.note .. ')</small>') or '') )


<div style="margin:0 auto;padding-left:1px; margin-bottom:{{#if:{{{total_temps|}}}|0.5|1}}em;overflow:hidden;" class="overflow"><table class="tracklist{{#ifeq: {{{collapsed}}}|oui|<nowiki> </nowiki>collapsible collapsed}}" cellpadding="0" style="width: 100%;border-width: 0px; border-collapse: collapse;">
if args.credits_paroles == 'oui' then
    {{#if: {{{titre|{{{headline|}}}}}} |
ligne:tag( 'td' ):wikitext( rowArgs.paroles )
    <tr>
end
<th class="tlheader" colspan="10" style="text-align: left; background-color: var(--background-color-base, #fff); color:var(--color-base, #202122); border-width: 0;" scope="col">
if args.credits_musique == 'oui' then
{{#if:{{{langue titre|{{{langue titres|}}}}}}|{{langue|{{{langue titre|{{{langue titres|}}}}}}|{{{titre|{{{headline|}}}}}}}}|{{{titre|{{{headline|}}}}}}}}</th>
ligne:tag( 'td' ):wikitext( rowArgs.musique )
    </tr> |
end
      {{#ifeq: {{{collapsed}}}|oui|
if args.credits_ecriture == 'oui' then
      <tr>
ligne:tag( 'td' ):wikitext( rowArgs.auteur )
  <th class="tlheader" colspan="10" style="text-align: left; background-color: var(--background-color-base, #fff); color:var(--color-base, #202122); border-width: 0;">&nbsp;</th>
end
      </tr>
if args.colonne_extra then
      }}
ligne:tag( 'td' ):wikitext( rowArgs.extra )
    }}
end
    <tr>
ligne:tag('td')
      <th class="tlheader" style="width: 20px; padding-left: 10px; padding-right: 10px; text-align: right; background-color: var(--background-color-neutral, #eaecf0); color:var(--color-base, #202122);" scope="col">{{Numéro avec majuscule|espace=non}}</th>
:addClass( 'pistes-duree' )
      <th class="tlheader" scope="col" style="{{#switch: {{#expr: {{#ifeq: {{{credits_paroles|{{{lyrics_credits|}}}}}}|oui|1|0}} + {{#ifeq: {{{credits_musique|{{{music_credits|}}}}}}|oui|1|0}} + {{#ifeq: {{{credits_ecriture|{{{writing_credits|}}}}}}|oui|1|0}} + {{#if: {{{colonne_extra|{{{extra_column|}}}}}}|1|0}} }} | 0 = width: 100%; | 1 = width: 60%; | 2 = width: 40%; | 3 = width: 30%; | 4 = width: 20%;}} text-align: left; background-color: var(--background-color-neutral, #eaecf0); color:var(--color-base, #202122);">Titre</th>{{ #ifeq: {{{credits_paroles|{{{lyrics_credits|}}}}}}|oui|<th scope="col" style="{{#switch: {{#expr: ({{#ifeq: {{{credits_paroles|{{{lyrics_credits|}}}}}}|oui|1|0}} + {{#ifeq: {{{credits_musique|{{{music_credits|}}}}}}|oui|1|0}} + {{#ifeq: {{{credits_ecriture|{{{writing_credits|}}}}}}|oui|1|0}} + {{#if: {{{colonne_extra|{{{extra_column|}}}}}}|1|0}}) }} | 1 = width: 40%; | 2 = width: 30%; | 3 = width: 20%; | 4 = width: 20%;}} text-align: left; background-color: var(--background-color-neutral, #eaecf0); color:var(--color-base, #202122);">Paroles</th>}}{{ #ifeq: {{{credits_musique|{{{music_credits|}}}}}}|oui|<th scope="col" style="{{#switch: {{#expr: ({{#ifeq: {{{credits_paroles|{{{lyrics_credits|}}}}}}|oui|1|0}} + {{#ifeq: {{{credits_musique|{{{music_credits|}}}}}}|oui|1|0}} + {{#ifeq: {{{credits_ecriture|{{{writing_credits|}}}}}}|oui|1|0}} + {{#if: {{{colonne_extra|{{{extra_column|}}}}}}|1|0}}) }} | 1 = width: 40%; | 2 = width: 30%; | 3 = width: 20%; | 4 = width: 20%;}} text-align: left; background-color: var(--background-color-neutral, #eaecf0); color:var(--color-base, #202122);">Musique</th>}}{{ #ifeq: {{{credits_ecriture|{{{writing_credits|}}}}}}|oui|<th scope="col" style="{{#switch: {{#expr: ({{#ifeq: {{{credits_paroles|{{{lyrics_credits|}}}}}}|oui|1|0}} + {{#ifeq: {{{credits_musique|{{{music_credits|}}}}}}|oui|1|0}} + {{#ifeq: {{{credits_ecriture|{{{writing_credits|}}}}}}|oui|1|0}} + {{#if: {{{colonne_extra|{{{extra_column|}}}}}}|1|0}}) }} | 1 = width: 40%; | 2 = width: 30%; | 3 = width: 20%; | 4 = width: 20%;}} text-align: left; background-color: var(--background-color-neutral, #eaecf0); color:var(--color-base, #202122);">Auteur</th>}}{{ #if: {{{colonne_extra|{{{extra_column|}}}}}}|<th scope="col" style="{{#switch: {{#expr: ({{#ifeq: {{{credits_paroles|{{{lyrics_credits|}}}}}}|oui|1|0}} + {{#ifeq: {{{credits_musique|{{{music_credits|}}}}}}|oui|1|0}} + {{#ifeq: {{{credits_ecriture|{{{writing_credits|}}}}}}|oui|1|0}} + {{#if: {{{colonne_extra|{{{extra_column|}}}}}}|1|0}}) }} | 1 = width: 40%; | 2 = width: 30%; | 3 = width: 20%; | 4 = width: 20%;}} text-align: left; background-color: var(--background-color-neutral, #eaecf0); color:var(--color-base, #202122);">{{{colonne_extra|{{{extra_column|}}}}}}</th>}}
:wikitext( rowArgs.temps )
      <th class="tlheader" style="width: 60px; padding-right: 10px; text-align: right; background-color: var(--background-color-neutral, #eaecf0); color:var(--color-base, #202122);" scope="col">Durée</th>
end
    </tr>
   
    for i = 1, nbPistes do
    piste (i)
end
end


{{ #if: {{{total_temps|}}} |
-- 6. Affichage de la durée totale le cas échéant
    <tr>
if args.total_temps then
<td colspan="10" style="padding-right: 10px; text-align: right; background-color: var(--background-color-base, #fff); border-width: 0;">'''{{{total_temps}}}'''</td>
tabPistes:tag( 'tr' ):tag('td')
    </tr>
:addClass( 'pistes-dureetotale' )
}}</table></div>
:attr( 'colspan', '10' )
:wikitext( args.total_temps )
end


return tostring( divPistes )
end
end


return p
return p
]]--

Dernière version du 12 mars 2026 à 00:58

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

-- luacheck: globals mw, no max line length

local p = {}

local langue = require 'Module:Langue'

function p.tableauPistes( frame )
	-- 1. Lecture des paramètres
	local args = {}
	local rowArgsTable = {}
	local maxNumPiste = 0

	-- map de noms de paramètres "alias → nom canonique" (attention à bien utiliser le nom canonique dans le code du module)
	local aliases = {
		headline = 'titre',
		total_length = 'total_temps',
		lyrics_credits = 'credits_paroles',
		music_credits = 'credits_musique',
		writing_credits = 'credits_ecriture',
		extra_column = 'colonne_extra',
	}

	-- même chose avec les paramètres "trucmucheN"
	local aliasesN = {
		title = 'piste',
		length = 'temps',
		lyrics = 'paroles',
		music = 'musique',
		writer = 'auteur',
	}

	for k, v in pairs(frame:getParent().args) do
		--[[
			match:
			* foobar42
			* foo21bar42 (digits in base name)
			* 21foo42 (leading digits in base name)
			* foobar0 (track zero)

			do not match:
			* 42 (only digits)
			* foobar (no digits suffix)
			* foobar042 (leading zeroes)

			alternative pattern: ^(.+)%f[%d]([1-9]%d*)$
		--]]
		local param, num = string.match( k, '^(.*%D)([1-9]%d*)$' ) -- in this specific case, multibyte mw.ustring.match() is not needed
		if not param then
			param, num = string.match( k, '^(.*%D)(0)$' ) -- also search for track zero
		end
		if param then
			if aliasesN[param] then
				param = aliasesN[param]
			end
			if v ~= "" or param == "numero" then -- il est possible de renseigner des paramètres « numeroN » vides
				num = tonumber(num)
				if rowArgsTable[num] == nil then
					if num > maxNumPiste then
						maxNumPiste = num
					end
					rowArgsTable[num] = {}
				end
				rowArgsTable[num][param] = v
			end
		else
			if aliases[k] then
				k = aliases[k]
			end
			local trimmed = ( type(k) == "number" ) and mw.text.trim(v) or v
			if trimmed ~= "" then
				args[k] = trimmed
			end
		end
	end

	-- 2. Initialisation du tableau de la liste des titres
	local divPistes = mw.html.create( 'div' )
		:addClass( "overflow pistes-marge" )
		:css({
			['margin-bottom'] = args.total_temps and '0.5em' or '1em'
		})
	local tabPistes = divPistes
			:tag( "table" )
				:addClass( "tracklist" .. (args.collapsed == 'oui' and " collapsible collapsed" or "") )
				:attr( 'cellpadding', "0" )

	-- 3. Éventuel code avant l'entête du tableau (titre ou boîte repliable)
	if args.titre then
		tabPistes
				:tag( "tr" )
					:tag( "th" )
						:addClass( "tlheader pistes-titre" )
						:attr( "scope", "col" )
						:attr( "colspan", "10" )
						:wikitext( (args["langue titre"] or args["langue titres"]) and langue.langue({ args["langue titre"] or args["langue titres"], args.titre }) or args.titre )
	elseif args.collapsed == 'oui' then
		tabPistes
				:tag( "tr" )
					:tag( "th" )
						:addClass( "tlheader pistes-titre" )
						:attr( "colspan", "10" )
						:wikitext( "&nbsp;" )
	end

	-- 4. Création de l'entête du tableau
	local nbColonnesExtra = (args.credits_paroles and 1 or 0) + (args.credits_musique and 1 or 0) + (args.credits_ecriture and 1 or 0) + (args.colonne_extra and 1 or 0)

	local entetesPistes = tabPistes
				:tag( "tr" )
					:tag( "th" ) -- Colonne « Numéro »
						:addClass( "tlheader pistes-entete" )
						:attr( "scope", "col" )
						:css({
							width = '20px',
							['padding-left'] = '10px',
							['padding-right'] = '10px',
							['text-align'] = 'right'
						})
						:wikitext( '<abbr class="abbr" title="Numéro">N<sup>o</sup></abbr>' ) -- résultat de {{Numéro avec majuscule|espace=non}}
					:done()
					:tag( "th" ) -- Colonne « Titre »
						:addClass( "tlheader pistes-entete" )
						:attr( "scope", "col" )
						:css({
							width = ({[0]='100%', [1]='60%', [2]='40%', [3]='30%', [4]='20%'})[nbColonnesExtra]
						})
						:wikitext( "Titre" )
					:done()
	if args.credits_paroles == 'oui' then -- Colonne « Paroles »
		entetesPistes
					:tag( "th" )
						:addClass( "pistes-entete" )
						:attr( "scope", "col" )
						:css({
							width = ({[1]='40%', [2]='30%', [3]='20%', [4]='20%'})[nbColonnesExtra]
						})
						:wikitext( "Paroles" )
					:done()
	end
	if args.credits_musique == 'oui' then -- Colonne « Musique »
		entetesPistes
					:tag( "th" )
						:addClass( "pistes-entete" )
						:attr( "scope", "col" )
						:css({
							width = ({[1]='40%', [2]='30%', [3]='20%', [4]='20%'})[nbColonnesExtra]
						})
						:wikitext( "Musique" )
					:done()
	end
	if args.credits_ecriture == 'oui' then -- Colonne « Auteur »
		entetesPistes
					:tag( "th" )
						:addClass( "pistes-entete" )
						:attr( "scope", "col" )
						:css({
							width = ({[1]='40%', [2]='30%', [3]='20%', [4]='20%'})[nbColonnesExtra]
						})
						:wikitext( "Auteur" )
					:done()
	end
	if args.colonne_extra then -- Colonne extra
		entetesPistes
					:tag( "th" )
						:addClass( "pistes-entete" )
						:attr( "scope", "col" )
						:css({
							width = ({[1]='40%', [2]='30%', [3]='20%', [4]='20%'})[nbColonnesExtra]
						})
						:wikitext( args.colonne_extra )
					:done()
	end
	entetesPistes
					:tag( "th" ) -- Colonne « Durée »
						:addClass( "tlheader pistes-entete" )
						:attr( "scope", "col" )
						:css({
							width = '60px',
							['padding-right'] = '10px',
							['text-align'] = 'right'
						})
						:wikitext( "Durée" )
					:done()

	-- 5. Tracé des lignes du tableau
	for i = 0, maxNumPiste do -- on commence à 0, pour éventuel [[morceau caché]] dans le [[prégap]]
		local rowArgs = rowArgsTable[i]

		if rowArgs and (rowArgs.piste or rowArgs.note or rowArgs.temps) then
			local ligne = tabPistes:tag( 'tr' )
			local numero
			if rowArgs.numero == '' then
				numero = ''
			else
				numero = (rowArgs.numero or tostring(i)) .. '.'
			end
			ligne
				:addClass( (i%2 == 0) and 'pistes-pair' or 'pistes-impair' )
				:tag( 'th' )
					:addClass( "pistes-numero" )
					:attr{ scope = 'row' }
					:wikitext( numero )
			local titrePiste = rowArgs.piste
			if titrePiste then
				if langue.nonLatin( titrePiste ) then
					titrePiste = '<cite style="font-style:normal">' .. titrePiste .. '</cite>'
				else
					titrePiste = '<cite>' .. titrePiste .. '</cite>'
				end
				if rowArgs["langue titre"] or args["langue titres"] then -- "langue titreN" puis "langue titres"
					titrePiste = langue.langue({ rowArgs["langue titre"] or args["langue titres"], titrePiste })
				end
			else
				titrePiste = 'Sans titre'
			end
			ligne:tag( 'td' ):wikitext(titrePiste .. (rowArgs.note and (' <small>(' .. rowArgs.note .. ')</small>') or '') )

			if args.credits_paroles == 'oui' then
				ligne:tag( 'td' ):wikitext( rowArgs.paroles )
			end
			if args.credits_musique == 'oui' then
				ligne:tag( 'td' ):wikitext( rowArgs.musique )
			end
			if args.credits_ecriture == 'oui' then
				ligne:tag( 'td' ):wikitext( rowArgs.auteur )
			end
			if args.colonne_extra then
				ligne:tag( 'td' ):wikitext( rowArgs.extra )
			end
			ligne:tag('td')
						:addClass( 'pistes-duree' )
						:wikitext( rowArgs.temps )
		end
	end

	-- 6. Affichage de la durée totale le cas échéant
	if args.total_temps then
		tabPistes:tag( 'tr' ):tag('td')
						:addClass( 'pistes-dureetotale' )
						:attr( 'colspan', '10' )
						:wikitext( args.total_temps )
	end

	return tostring( divPistes )
end

return p