https://github.com/stereobooster/html_minifier
Ruby wrapper for kangax html-minifier
https://github.com/stereobooster/html_minifier
Last synced: about 1 year ago
JSON representation
Ruby wrapper for kangax html-minifier
- Host: GitHub
- URL: https://github.com/stereobooster/html_minifier
- Owner: stereobooster
- Created: 2012-05-07T22:59:22.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2016-06-01T15:08:10.000Z (almost 10 years ago)
- Last Synced: 2025-03-25T22:36:36.222Z (about 1 year ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 12
- Watchers: 2
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-wpo - HTML_minifier - Ruby wrapper for kangax html-minifier. (Minifiers - HTML / Meetups)
- fucking-awesome-wpo - HTML_minifier - Ruby wrapper for kangax html-minifier. (Minifiers - HTML / Meetups)
- awesome-wpo-dup - HTML_minifier - Ruby wrapper for kangax html-minifier. (Minifiers - HTML)
- awesome-wpo-chinese - HTML_minifier - Ruby wrapper for kangax html-minifier. (Minifiers - HTML)
README
# HtmlMinifier
[](http://travis-ci.org/stereobooster/html_minifier)
Ruby wrapper for js library [html-minifier](https://github.com/kangax/html-minifier/). If you want pure ruby use [html_press](https://github.com/stereobooster/html_press)
## Installation
`html_minifier` is available as ruby gem.
$ gem install html_minifier
Ensure that your environment has a JavaScript interpreter supported by [ExecJS](https://github.com/sstephenson/execjs). Usually, installing therubyracer gem is the best alternative.
## Usage
```ruby
require 'html_minifier'
HtmlMinifier.minify(File.read("source.html"))
```
When initializing `HtmlMinifier`, you can pass options
```ruby
HtmlMinifier::minifier.new( ).minify(source)
# Or
HtmlMinifier.minify(source, )
```
## TODO
- add Rake task
- add color reporter. Maybe [colorize](https://github.com/fazibear/colorize)
- add cli