Module:Devilgrams NB
From The Obey Me Wiki
Description: Used to add devilgram story links/images within tables
local cardList = {} function cardList.add(frame) -- iterate input into array local contact = {} for i = 1, 100 do contact[i] = frame.args[i] end -- starts the table local html = '<div class="flex-container">\n' -- starting from first element of the array for card = 1, table.getn(contact), 7 do -- opens a new row html = html .. "\n" -- iterates between 1~7 for count = 0, 6 do html = html .. "<div class=\"cardflex\"><span class=\"desktop-ver\"><small>[[File:" .. string.gsub(string.gsub(string.gsub(contact[card+count], "\n", ""), ":", " -"), "?", " -") .. " Devilgram.png|center|130px|class=cardimage|link=" .. string.gsub(string.gsub(frame.args[card+count], "\n", ""), " %(NB%)", "") .. "/Devilgram#Nightbringer_Info-0]]</small></span>\n<span class=\"mobile-ver\"><small>[[File:" .. string.gsub(string.gsub(string.gsub(contact[card+count], "\n", ""), ":", " -"), "?", " -") .. " Devilgram.png|center|100px|class=cardimage|link=" .. string.gsub(string.gsub(frame.args[card+count], "\n", ""), " %(NB%)", "") .. "/Devilgram#Nightbringer_Info-0]]</small></span>\n[[" .. string.gsub(string.gsub(frame.args[card+count], "\n", ""), " %(NB%)", "") .. "/Devilgram#Nightbringer_Info-0|" .. string.gsub(string.gsub(frame.args[card+count], "\n", ""), " %(NB%)", "") .. "]]</div>\n" if card + count + 1 > table.getn(contact) then break end end -- completes one row of card html = html .. "\n" end return html .. "</div>" end return cardList --[[File:{{{1}}} Devilgram.png|center|class="cardlistimage"|link={{{1}}}]]