Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
HTML COMPRESSOR
require 'html_compressor'
class HtmlCompressor < Nanoc3::Filter
identifier :html_compressor
# Runs the content through htmlcompressor.
#
# This method optionally takes options to pass directly to htmlcompressor
#
# @param [String] content The content to filter
#
# @param [Hash] params Options passed to htmlcompressor
#
# @return [String] The filtered content
def run(content, params={})
compressor = HtmlCompressor::HtmlCompressor.new(params)
compressor.compress(content)
end
end
@bobthecow

This comment has been minimized.

Copy link
Owner Author

bobthecow commented Feb 29, 2012

Options are:

:charset => 'utf-8',
:line_break => nil,
:java => '/path/to/java'
:munge => false,
:optimize => true,
:preserve_semicolons => false,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.