Module:TestModule: Difference between revisions
AdamZachar (talk | contribs) No edit summary |
AdamZachar (talk | contribs) No edit summary |
||
Line 7: | Line 7: | ||
function p.externalDataTest( frame ) | function p.externalDataTest( frame ) | ||
local output = "" | local output = "" | ||
local targetShape = frame.args.targetShape | |||
local data, errors = | local data, errors = | ||
mw.ext.externaldata.getWebData | mw.ext.externaldata.getWebData | ||
Line 17: | Line 18: | ||
output = output .. "<ul>" | output = output .. "<ul>" | ||
for i, row in ipairs(data) do | for i, row in ipairs(data) do | ||
output = output .. " <li>" .. row.shape | |||
if row.shape == targetShape then | |||
output = output .. " <li>" .. "'''[[" .. row.shape .. "]]'''" | |||
else | |||
output = output .. " <li>" .. "[[" .. row.shape .. "]]" | |||
end | |||
end | end | ||
output = output .. "</ul>" | output = output .. "</ul>" | ||
return output | return output |