Skip to content

Detect and merge redudent definitions for lighter svg files

Notifications You must be signed in to change notification settings

1000i100/svg-def-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svg-def-cleaner

Detect and merge redundant definitions for lighter svg files

How to use

First step, installation. Be sure to have node.js installed on your system then :

npm install -g svg-dev-cleaner

To clean a svg file juste write in your shell :

svg-dev-cleaner inputFile.svg outputFile.svg

To use it as module :

var sdc = require('svg-def-cleaner');
// string api
var cleanedSvgString = sdc.cleanSvgContent('<xml>redundantSvg</xml>');
// file api
sdc.main('sourceFile.svg', 'targetFile.svg');

How to contribute

You need node.js and git then run :

git clone git@github.com:GammaNu/svg-def-cleaner.git
cd svg-def-cleaner
npm install
node_modules/coffee-script/bin/cake watch

start coding !

RoadMap

  • factorize identical elements excepted the transformation part (one element in and in replacement of duplicated elements)
  • factorize style attribute when possible (put them on group if all child have the same or override it)

About

Detect and merge redudent definitions for lighter svg files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published