()
| 557 | //////////////////////////////////////////////////////////////// |
| 558 | |
| 559 | func ExampleMinify() { |
| 560 | m := minify.New() |
| 561 | m.AddFunc("text/html", Minify) |
| 562 | m.AddFunc("text/css", css.Minify) |
| 563 | m.AddFunc("image/svg+xml", svg.Minify) |
| 564 | m.AddFuncRegexp(regexp.MustCompile("^(application|text)/(x-)?(java|ecma)script$"), js.Minify) |
| 565 | m.AddFuncRegexp(regexp.MustCompile("[/+]json$"), json.Minify) |
| 566 | m.AddFuncRegexp(regexp.MustCompile("[/+]xml$"), xml.Minify) |
| 567 | |
| 568 | // set URL to minify link locations too |
| 569 | m.URL, _ = url.Parse("https://www.example.com/") |
| 570 | if err := m.Minify("text/html", os.Stdout, os.Stdin); err != nil { |
| 571 | panic(err) |
| 572 | } |
| 573 | } |
| 574 | |
| 575 | func ExampleMinify_options() { |
| 576 | m := minify.New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…