Binding of Isaac: Rebirth Wiki
Advertisement

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

local p = {}

local w_table = require( 'module:table' )

function p.visualisation(frame)
	reponse = ""
	for index, objet in pairs(mw.ext) do
		reponse = reponse.."</br>À la clé "..index..", on trouve un objet de type : "..type(objet)
	end
	return reponse
end

function p.visualise(frame)
	reponse = ""
	for index, objet in pairs(frame) do
		reponse = reponse.."</br>À la clé "..index..", on trouve un objet de type : "..type(objet)
	end
	return reponse
end

function p.evalue(frame)
	local reponse = ""
	local nombre,chaine = 0,0
	for index, objet in ipairs(frame.args) do
		if tonumber(objet) == nil then
			chaine = chaine + 1
		else
			nombre = nombre + 1
		end
	end
	reponse = reponse.."Il y a "..nombre.." nombres et "..chaine.." chaines de caractères."
	return reponse
end

function p.renvoie(frame)
	local reponse = ""
	local nombre,chaine = 0,0
	for index, objet in pairs(frame.args) do
		reponse = reponse.."<br />À la clé "..index..", il y a l’objet : "..objet
	end
	return reponse
end

function p.parent(frame)
	local reponse = ""
	local model = frame:getParent()
	for index, objet in pairs(model.args) do
		reponse = reponse.."<br />À la clé "..index..", il y a l’objet : "..objet
	end
	return reponse
end

function p.replique(frame)
	return "Je renvoie "..frame.args[1].." et "..frame.args[2]
end

function p.child(frame)
	newFrame =  frame:newChild{ args = {"Jeudi",frame.args[2]}}
	return p.replique(newFrame)
end

function p.process(frame)
	local reponse = ""
	reponse = frame:preprocess("{{Attention|Essai avec le modèle Attention}}")
	return "<br />La fonction a retourné : "..reponse
end

function p.template(frame)
	reponse = frame:expandTemplate{ title = "Attention", args = { "Essai avec le modèle Attention" } }
	return reponse
end

function p.pair(frame)
	local reponse = ""
	local nombre,chaine = 0,0
	for index, objet in frame:argumentPairs() do
		reponse = reponse.."<br />À la clé "..index..", il y a l’objet : "..objet
	end
	return reponse
end

function p.parser(frame)
	local reponse = ""
	reponse = frame:callParserFunction('#time', 'Y-m-d H:i:s')
	if reponse == nil then
		return "Il y a un problème, la fonction a retourné : nil"
	else
		return "La fonction a retourné : "..reponse.." et son type est : "..type(reponse)
	end
end

function p.tag(frame)
	local reponse = ""
	reponse = frame:extensionTag('nowiki', '[[texte]]', {})
	if reponse == nil then
		return "Il y a un problème, la fonction a retourné : nil"
	else
		return "La fonction a retourné : "..reponse.." et son type est : "..type(reponse)
	end
end

function p.notag(frame)
	local reponse = ""
	reponse = '[[texte]]'
	if reponse == nil then
		return "Il y a un problème, la fonction a retourné : nil"
	else
		return "La fonction a retourné : "..reponse.." et son type est : "..type(reponse)
	end
end

function p.argument(frame)
	local reponse = ""
	reponse = frame:getArgument(1)
	if reponse == nil then
		return "Il y a un problème, la fonction a retourné : nil"
	else
		return "La fonction a retourné : "..reponse:expand().." et son type est : "..type(reponse)
	end
end

function p.namedArgument(frame)
	local reponse = ""
	reponse = frame:getArgument("fleur")
	if reponse == nil then
		return "Il y a un problème, la fonction a retourné : nil"
	else
		return "La fonction a retourné : "..reponse:expand().." et son type est : "..type(reponse)
	end
end

function p.parval(frame)
	local reponse = ""
	reponse = frame:newParserValue()
	if reponse == nil then
		return "Il y a un problème, la fonction a retourné : nil"
	else
		return "La fonction a retourné une variable de type : "..type(reponse).." qui contient : <br />"..table.concat(reponse, " ---- ")
	end
end

function p.temparval(frame)
	local reponse = ""
	local tab = {}
	reponse = frame:newTemplateParserValue(tab)
	if reponse == nil then
		return "Il y a un problème, la fonction a retourné : nil"
	else
		return "La fonction a retourné une variable de type : "..type(reponse).." qui contient : <br />"..table.concat(reponse, " ---- ")
	end
end

function p.title(frame)
	local reponse = ""
	reponse = frame:getTitle()
	if reponse == nil then
		return "Il y a un problème, la fonction a retourné : nil"
	else
		return "La fonction a retourné : "..reponse.." et son type est : "..type(reponse)
	end
end

function p.args( f, untrimmed )
	if type( f ) ~= 'table' or f == mw.getCurrentFrame() then
		f = f.args or {}
	end
	if f['use parent args'] then
		f = w_table.merge( f, mw.getCurrentFrame():getParent().args )
	end
	if not untrimmed then
		f = w_table.trim( f )
	end
	return f
end

return p
Advertisement