factorio-exporter 0.5.1

A library to export prototype definitions from Factorio (http://www.factorio.com)
Documentation
export = require "export"

local function ExportIcon(section, name, path)
    export.Export("- section: ", section)
    export.Export("  name: ", name)
    export.Export("  path: '", path, "'")
end

export.Export("<ICONS>")

for section, elements in pairs(data.raw) do
    for _, el in pairs(elements) do
        if el.icon then
            ExportIcon(section, el.name, el.icon)
        elseif el.icons and el.icons[1] then
            ExportIcon(section, el.name, el.icons[1].icon)
        end
    end
end

export.Export("</ICONS>")