Module:Sandbox/Fred Gandt/motd/data

local data = { {		markup = [=[Foo Foo Foo]=], day = '1', month = 'January', year = '2015', },	{		markup = [=[Bar Bar Blacksheep]=], day = '3', month = 'January', year = '2015', },	{		markup = [=[Baz Baz Baz]=], day = '5', month = 'March', year = '2015', },	{		markup = [=[Qux Qux Qux]=], day = '21', month = 'September', year = '2015', }, }

return (function (t)	-- This function constructs the data into a pseudo-database.	local delink = require('Module:Delink').delink	local fields = {'markup', 'text', 'day', 'month', 'year'}	local ret = {}	for i, field in ipairs(fields) do		ret[field] = {}	end	for i, subtable in ipairs(t) do		for j, field in ipairs(fields) do			ret[field][i] = subtable[field] or delink({subtable['markup']})		end	end	return ret end)(data)