README.md in inline_svg-0.3.0 vs README.md in inline_svg-0.4.0

- old
+ new

@@ -30,13 +30,16 @@ ## Usage ``` inline_svg(file_name, options={}) ``` +The `file_name` can be a full path to a file, or just the file's basename. The +actual path of the file on disk is resolved using +[Sprockets](://github.com/sstephenson/sprockets), which means you can pre-process +and fingerprint your SVG files like any other Rails asset. -Currently, this little helper only works in the context of a Rails app. Here's -an example of embedding an SVG document and applying a 'class' attribute in +Here's an example of embedding an SVG document and applying a 'class' attribute in HAML: ``` !!! 5 %html @@ -61,24 +64,32 @@ } ``` ## Options * `class`: set a CSS class attribute on the SVG +* `size`: set width and height attributes on the SVG + * Supplied as "{Width} * {Height}" or "{Number}", so "30px*45px" becomes `width="30px"` + and `height="45px"`, and "50%" becomes `width="50%"` and `height="50%"` * `title`: add a \<title\> node inside the top level of the SVG document * `desc`: add a \<desc\> node inside the top level of the SVG document * `nocomment`: remove comment tags (and other unsafe/unknown tags) from svg (uses the [Loofah](https://github.com/flavorjones/loofah) gem) Example: ``` -inline_svg("some-document.svg", class: 'some-class', title: 'Some Title', desc: +inline_svg("some-document.svg", class: 'some-class', size: '30% * 20%', title: 'Some Title', desc: 'Some interesting description', nocomment: true) ``` ## 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`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request + +Please write tests for anything you change, add or fix. +There is a [basic Rails +app](http://github.com/jamesmartin/inline_svg_test_app) that demonstrates the +gem's functionality in use.