Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby wrapper for kangax html-minifier
JavaScript Ruby
tree: e82d1bc948

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
vendor
.gitignore
.gitmodules
.travis.yml
Gemfile
README.md
Rakefile
html_minifier.gemspec

README.md

HtmlMinifier

Build Status

Ruby wrapper for js library html-minifier. If you want pure ruby use 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. Usually, installing therubyracer gem is the best alternative.

Usage

require 'html_minifier'

HtmlMinifier.minify(File.read("source.html"))

When initializing HtmlMinifier, you can pass options

HtmlMinifier::minifier.new( <options> ).minify(source)
# Or
HtmlMinifier.minify(source, <options>)

TODO

  • add Rake task
  • add color reporter. Maybe colorize
  • add cli
Something went wrong with that request. Please try again.