module Squoosh
@author Stephen Checkoway <s@pahtak.org> Minify HTML, JavaScript, and CSS.
Examples
html = <<-EOF <!DOCTYPE html> <html> <head> <!-- Set the title --> <title>My fancy title!</title> </head> <body> <p>Two</p> <p>paragraphs.</p> </body> </html> EOF compressed = Squoosh.minify_html(html) # "<!DOCTYPE html><title>My fancy title!</title><p>Two<p>paragraphs."
Constants
- VERSION
The version of squoosh.
Public Class Methods
minify_css(content, options = {})
click to toggle source
Minify CSS convenience method.
@param content [String] the CSS to minify @param options [Hash] options to override the Squoosher
default options @return [String] the minified CSS
# File lib/squoosh.rb, line 677 def self.minify_css(content, options = {}) Squoosher.new(options).minify_css content end
minify_html(content, options = {})
click to toggle source
Minify HTML convenience method.
@param content [String] the HTML to minify @param options [Hash] options to override the Squoosher
default options @return [String] the minified HTML
# File lib/squoosh.rb, line 668 def self.minify_html(content, options = {}) Squoosher.new(options).minify_html content end
minify_js(content, options = {})
click to toggle source
Minify JavaScript convenience method.
@param content [String] the JavaScript to minify @param options [Hash] options to override the Squoosher
default options @return [String] the minified JavaScript
# File lib/squoosh.rb, line 686 def self.minify_js(content, options = {}) Squoosher.new(options).minify_js content end