An abstract object model generator and SVG writer.
This engine is designed to meet the needs of modern SVG and to be sharable by any client apps that can generate the standard JSON.
The engine currently works, in an experimental manner, with Photoshop Generator.
All code is offered under the Apache License Version 2.0.
We 👏 pull requests! If you submit one, please also sign our Contributor License Agreement.
The generator plugin adds Copy Generator DOM to make it easy to get test data for the svgOMGenerator
cd generator/plugins/
ln -s /path/to/svgObjectModelGenerator svgObjectModelGenerator
The tests rely on mocha and chai, so make sure you have run npm install
in your repository. Then, to run the tests, all you have to do is run npm test
.
The tests can be debugged using npm run-script test-debug
Generate the code coverage report "svgomg-code-coverage.html" by running npm run-script cover
The test data comes from processing PSDs using the generator plugin defined in main.js. With the plugin running and your PSD open in Photoshop use File > Generate > Copy Generator DOM. This copies the generator JSON to your clipboard.
Now, create a file with the PSD's name adding "-data.js" to the end, so "file.psd" becomes "file-data.js" Inside the file define the data so it can be loaded using require
module.exports = DATA;
Please don't check binary PSD files into this repo.