README.md in inline_svg-0.10.0 vs README.md in inline_svg-0.11.0

- old
+ new

@@ -5,11 +5,11 @@ embedding](http://css-tricks.com/using-svg/) it inline in the HTML. This gem is a little Rails helper method (`inline_svg`) that reads an SVG document (via Sprockets, so works with the Rails Asset Pipeline), applies a CSS class attribute to the root of the document and then embeds it into a view. -Inline SVG supports [Rails version 4.0.4](http://weblog.rubyonrails.org/2014/3/14/Rails-4-0-4-has-been-released/) and newer. +Inline SVG (from [v0.10.0](https://github.com/jamesmartin/inline_svg/releases/tag/v0.10.0)) supports both [Rails 4](http://weblog.rubyonrails.org/2013/6/25/Rails-4-0-final/) and [Rails 5](http://weblog.rubyonrails.org/2016/6/30/Rails-5-0-final/). Want to embed SVGs with Javascript? You might like [RemoteSvg](https://github.com/jamesmartin/remote-svg), which features similar transforms but can also load SVGs from remote URLs (like S3 etc.). ## Changelog @@ -185,9 +185,24 @@ And ```xml <svg custom="some value">...</svg> ``` + +Passing a `priority` option with your custom transformation allows you to +control the order that transformations are applied to the SVG document: + +```ruby +InlineSvg.configure do |config| + config.add_custom_transformation(attribute: :custom_one, transform: MyCustomTransform, priority: 1) + config.add_custom_transformation(attribute: :custom_two, transform: MyOtherCustomTransform, priority: 2) +end +``` + +Transforms are applied in ascending order (lowest number first). + +***Note***: Custom transformations are always applied *after* all built-in +transformations, regardless of priority. ## Contributing 1. Fork it ( [http://github.com/jamesmartin/inline_svg/fork](http://github.com/jamesmartin/inline_svg/fork) ) 2. Create your feature branch (`git checkout -b my-new-feature`)