singlepage – zgo.at/singlepage Index | Files | Directories

package singlepage

import "zgo.at/singlepage"

Index

Constants

const (
	HTML zint.Bitflag16 = 1 << (iota - 1)
	CSS
	JS
	Image
	Font
)

Variables

var Everything = Options{
	Local:  CSS | JS | Image,
	Remote: CSS | JS | Image,
	Minify: CSS | JS | Image,
}

Everything is an Options struct with everything enabled.

Functions

func Bundle

func Bundle(html []byte, opts Options) (string, error)

Bundle the resources in a HTML document according to the given options.

Types

type LookupError

type LookupError struct {
	Path string
	Err  error
}

LookupError is used when we can't look up a resource. This may be a non-fatal error.

func (*LookupError) Error

func (e *LookupError) Error() string

type Options

type Options struct {
	Root   string
	Strict bool
	Quiet  bool
	Local  zint.Bitflag16
	Remote zint.Bitflag16
	Minify zint.Bitflag16
}

Options for Bundle().

func NewOptions

func NewOptions(root string, strict, quiet bool) Options

NewOptions creates a new Options instance.

func (*Options) Commandline

func (opts *Options) Commandline(local, remote, minify []string) error

Commandline modifies the Options from the format accepted in the commandline tool's flags.

type ParseError

type ParseError struct {
	Path string
	Err  error
}

ParseError indicates there was a parsing failure. This may be a non-fatal error.

func (*ParseError) Error

func (e *ParseError) Error() string

Source Files

bundle.go css.go helpers.go

Directories

PathSynopsis
cmd
cmd/singlepage
Version
v0.0.0-20220403172446-1345e4e61f54 (latest)
Published
Apr 3, 2022
Platform
linux/amd64
Imports
20 packages
Last checked
3 days ago

Tools for package owners.