Voir la source de Module:Graph:Utils
3 min de lecture
Aller à la navigation Aller à la rechercheVous n’avez pas le droit de modifier cette page, pour la raison suivante :
Vous pouvez voir et copier le contenu de cette page.
local p = {}
function p.titleToJson(title)
-- Load mediawiki page and decodes it as json
local t = mw.title.new(title)
if not t.exists then
return nil
else
return mw.text.jsonDecode(t:getContent(), mw.text.JSON_TRY_FIXING)
end
end
function p.recodeListToMap(frame)
-- a function to re-code a json table in format [{},{},{}] to a map {},
-- with each source object containing the same set of values, and the response
-- mapping the "from" value to "to" value
-- parameters: tbl, from, to
local args = frame.args
local tbl = p.titleToJson(args[1])
local from = args[2]
000
1:0
Modèle utilisé par cette page :
Revenir à la page Module:Graph:Utils.