Module:IS/pages

local pages = { ['Currency'] = { pagename = "Currencies", items = {} }, 	['Held'] = { pagename = "Items/Held Items", items = {} }, 	['Scarves'] = { pagename = "Items/Scarves", items = {} }, 	['Cosmetic'] = { pagename = "Items/Cosmetic Items", items = {} }, 	['Ability'] = { pagename = "Items/Ability Items", items = {} }, 	['Type-enhancing'] = { pagename = "Items/Type-enhancing Items", items = {} }, 	['Music'] = { pagename = "Items/Music Items", items = {} }, 	['Evolutionary'] = { pagename = "Items/Evolutionary Items", items = {} }, 	['Keys'] = { pagename = "Items/Keys", items = {} }, 	['Consumable'] = { pagename = "Items/Consumable Items", items = {} }, 	['Berries'] = { pagename = "Items/Berries", items = {} }, 	['Seeds'] = { pagename = "Items/Seeds", items = {} }, 	['Gummis'] = { pagename = "Items/Gummis", items = {} }, 	['Miscellaneous'] = { pagename = "Items/Miscellaneous Items", items = {} }, 	['Throwing'] = { pagename = "Items/Throwing Items", items = {} }, 	['Valuable'] = { pagename = "Items/Valuable Items", items = {} }, 	['TMsHMs'] = { pagename = "Items/TMs and HMs", items = {} }, 	['Traps'] = { pagename = "Traps#Usable Traps", items = {} }, 	['Orbs'] = { pagename = "Items/Orbs", items = {} }, 	['Tutor'] = { pagename = "Items/Tutor Items", items = {} }, 	['Fossils'] = { pagename = "Items/Fossils", items = {} }, 	['Boxes'] = { pagename = "Items/Boxes", items = {} }, 	['Slates'] = { pagename = "Items/Heart Slates", items = {} } }

for _,page in pairs(pages) do --For each Item In the "pages" table pageitems = mw.getCurrentFrame:expandTemplate { title = 'DIL', args = { ..page.pagename.. } } --Assigns a list of Items on that page to"pageitems" 	using DIL for item in string.gmatch(pageitems, "([%w é`%-?'%.]+)") do --The list Is an entire string, so each Item Is being found using gmatch to put It In the "items"table of 	the respective page table.insert(page.items, item) end end

return pages