Module:Test Lua VisualData: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary Tag: Manual revert |
| (One intermediate revision by the same user not shown) | |
(No difference)
| |
Latest revision as of 08:10, 16 August 2024
Documentation for this module may be created at Module:Test Lua VisualData/doc
local p = {}
function p.testlua(frame)
if mw.visualdata == nil then
return "Error: visualdata module is not available."
end
local schema = "Project key data"
local query = "[[category::Projects]]"
local printouts = {"objective", "image", "description"}
local results = mw.visualdata.query(schema, query, printouts)
local output = ""
for _, result in ipairs(results) do
output = output .. "Objective: " .. (result.objective or "N/A") .. "<br>"
output = output .. "Image: " .. (result.image or "N/A") .. "<br>"
output = output .. "Description: " .. (result.description or "N/A") .. "<br><br>"
end
return output
end
return p