"साचा:TemplateBox" च्या विविध आवृत्यांमधील फरक

Content deleted Content added
छो paste from sandbox
छो resolve issue "no params"
ओळ ३४५:
end
end
end
if not pargs.useTemplateData then
local warning = "Warning: Module:TemplateBox - templatedata invoked but not requested by user (setting useTemplateData=1)."
mw.log(warning)
tdata.description = warning
return tdata, 0;
end
Line ४६४ ⟶ ४५७:
-- The TemplateData-portion for [[Template:TemplateBox]]
function p.templatedata(frame)
local tdata
local pargs = ( frame:getParent() or {} ).args or {}
if not pargs.useTemplateData then
local warning = "Warning: Module:TemplateBox - templatedata invoked but not requested by user (setting useTemplateData=1)."
mw.log(warning)
tdata = '{"description":"' .. warning .. '","params":{},"sets":[]}'
return tdata, 0;
end
-- Load the JSON-Module which will convert LUA tables into valid JSON
local JSON = require('Module:JSON')
JSON.strictTypes = true
-- Obtain the object containing info
local tdata = p.args2table(( frame:getParent() or {} ).args or {}pargs, nil, false)
-- And finally return the result
return JSON:encode(tdata)
"https://mr.wikipedia.org/wiki/साचा:TemplateBox" पासून हुडकले