Module:Women in Green event: Difference between revisions

Content deleted Content added
simplify
start table function
Line 1:
require('strict')
local p = {}
local data = mw.loadJsonData('Template:WikiProject Women in Green/events')
 
p.main = function(frame)
local data = mw.loadJsonData('Template:WikiProject Women in Green/events')
local event = data[tonumber(frame.args[1])]
if event then
return event[frame.args[2]]
end
end
 
p.list = function()
local table = mw.html.create('table')
for _, n in ipairs(data) do
table:tag('tr'):tag('td'):wikitext(n):done():done()
end
return table:allDone()
end