diff --git a/README.md b/README.md index 4e9209d..80f337f 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,100 @@ A slim file to minify embedded code. -## Installation +## Overview + +Remove comments and unnecessary blank lines in the css or javascript embedding of your Slim files when embedding them in HTML. + +### Example + +You have a Slim file like this: + +```slim +html + head + title My Slim Template + body + h1 Welcome to Slim! + css: + /* Slim supports embedded css */ + + + body { background-color: #ddd; } + javascript: + // Slim supports embedded javascript + alert('Slim supports embedded javascript!') +``` + +If this gem is not applied, the HTML will look like the following: + +```html + + + My Slim Template + + +

+ Welcome to Slim! +

+ + + + +``` + +Applying this gem will remove unnecessary blank lines and comments: +```html + + + My Slim Template + + +

+ Welcome to Slim! +

+ + + + ``` -gem install slim-embedded-minify + +## Installation + +Add this line to your application's Gemfile: + +```ruby +# Gemfile +gem 'slim' +gem 'slim-embedded-minify' ``` -or if you use bundler put this in your `Gemfile` +And then execute: ``` +bundle install +``` + +## Usage + +All you have to do is add this gem to your Gemfile. +No additional configuration or changes to your code are required. + +```ruby +# Gemfile +gem 'slim' gem 'slim-embedded-minify' ```