minify

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cssmin minifies CSS. It's a port of Ryan Grove's cssmin from Ruby.

Package htmlmin minifies HTML.

Package jsmin implements JavaScript minifier. It's a direct port of Doulas Crockford's JSMin.

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = &Options{
	MinifyScripts: false,
	MinifyStyles:  false,
}
View Source
var FullOptions = &Options{
	MinifyScripts: true,
	MinifyStyles:  true,
}

Functions

func MinifyCSS

func MinifyCSS(css []byte) (minified []byte)

func MinifyHTML

func MinifyHTML(data []byte, options *Options) (out []byte, err error)

Minify returns minified version of the given HTML data. If passed options is nil, uses default options.

func MinifyJS

func MinifyJS(script []byte) (minified []byte, err error)

Minify returns a minified script or an error.

Types

type Options

type Options struct {
	MinifyScripts bool // if true, use jsmin to minify contents of script tags.
	MinifyStyles  bool // if true, use cssmin to minify contents of style tags and inline styles.
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL