fnando / svg_optimizer

Some SVG optimization based on Node's SVGO
MIT License
19 stars 6 forks source link

Add option to exclude or include tweaks #3

Closed nelsond closed 8 years ago

nelsond commented 9 years ago

I added (optional) options to allow excluding or including specific tweaks.

Include tweaks using the with option:

# single tweak
SvgOptimizer.optimize(xml, with: :remove_comment)           

# multiple tweaks                     
SvgOptimizer.optimize(xml, with: [:remove_comment, :remove_empty_container])

Exclude tweaks using the without option:

# excluding a single tweak
SvgOptimizer.optimize(xml, without: :remove_comment)

# excluding multiple tweaks
 SvgOptimizer.optimize(xml, without: [:remove_comment, :remove_empty_container])
fnando commented 8 years ago

I implemented something simpler; just passing an array of plugins.

nelsond commented 8 years ago

👍