htmlmin

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: BSD-2-Clause Imports: 5 Imported by: 7

README

HTML minifier. (Also optionally minifies embedded scripts and styles).

Build Status

Alternatives

Documentation

Overview

Package htmlmin minifies HTML.

Index

Constants

This section is empty.

Variables

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

Functions

func Minify

func Minify(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.

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.
	UnquoteAttrs  bool // if true, remove quotes from HTML attributes where possible.
}

Jump to

Keyboard shortcuts

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