Skip to content

Commit

Permalink
Document the compressor options
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcovion committed Sep 2, 2014
1 parent 3f1c9ab commit bb31db1
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions README.md
Expand Up @@ -11,13 +11,37 @@ gem install middleman
middleman init MY_PROJECT
```

If you already have a Middleman project: Add `gem "middleman-minify-html"` to your `Gemfile` and run `bundle install`
If you already have a Middleman project: Add `gem 'middleman-minify-html'` to your `Gemfile` and run `bundle install`

## Configuration

```
```ruby
activate :minify_html
```
The various options can be passed with a block or as a hash like so:
```ruby
activate :minify_html, remove_input_attributes: false
```
These are the default settings, as listed in the [Htmlcompressor documentation](https://github.com/paolochiodi/htmlcompressor#usage):
```ruby
activate :minify_html do |html|
html.remove_multi_spaces = true # Remove multiple spaces
html.remove_comments = true # Remove comments
html.remove_intertag_spaces = false # Remove inter-tag spaces
html.remove_quotes = true # Remove quotes
html.simple_doctype = false # Use simple doctype
html.remove_script_attributes = true # Remove script attributes
html.remove_style_attributes = true # Remove style attributes
html.remove_link_attributes = true # Remove link attributes
html.remove_form_attributes = false # Remove form attributes
html.remove_input_attributes = true # Remove input attributes
html.remove_javascript_protocol = true # Remove JS protocol
html.remove_http_protocol = true # Remove HTTP protocol
html.remove_https_protocol = false # Remove HTTPS protocol
html.preserve_line_breaks = false # Preserve line breaks
html.simple_boolean_attributes = true # Use simple boolean attributes
end
```

## Build & Dependency Status

Expand Down Expand Up @@ -49,11 +73,11 @@ The best way to get quick responses to your issues and swift fixes to your bugs

## License

Copyright (c) 2012-2013 Thomas Reynolds. MIT Licensed, see [LICENSE] for details.
Copyright (c) 2012-2014 Thomas Reynolds. MIT Licensed, see [LICENSE] for details.

[middleman]: http://middlemanapp.com
[gem]: https://rubygems.org/gems/middleman-minify-html
[travis]: http://travis-ci.org/middleman/middleman-minify-html
[gemnasium]: https://gemnasium.com/middleman/middleman-minify-html
[codeclimate]: https://codeclimate.com/github/middleman/middleman-minify-html
[LICENSE]: https://github.com/middleman/middleman-minify-html/blob/master/LICENSE.md
[LICENSE]: https://github.com/middleman/middleman-minify-html/blob/master/LICENSE.md

0 comments on commit bb31db1

Please sign in to comment.