Module:Information

Une page de Wikiversité, la communauté pédagogique libre.

Ce module contient des fonctions chargées de donner des informations.


- La fonction p.principaux_dep catégorise les départements ayant au moins dix leçons.


local p = {}

require("Module:Réserve")

function p.principaux_dep(frame)
	local titre = mw.title.getCurrentTitle().text
	local page = "Département:"..titre.."/Leçons par thèmes"
	local texte = lit(page)
	if texte then
		local compte,position = 0,0
		repeat
			position = string.find(texte,"{{L|",position+1,true)
			if position then
				compte = compte + 1
			end
		until position == nil
		if compte > 9 then
			return "[[Catégorie:Départements ayant au moins dix leçons]]"
		end
	end
end

return p