From df93dd2c3242fb68d4e8458315cd60805d1e1c92 Mon Sep 17 00:00:00 2001 From: ydah <13041216+ydah@users.noreply.github.com> Date: Mon, 18 Sep 2023 11:36:35 +0900 Subject: [PATCH] Add description to README --- README.md | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 4 deletions(-) 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' ```