builder

package
v0.0.0-...-dccbc30 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CSSBuilderImportRegexp = regexp.MustCompile(`(?m)^\s*@import "local:\/\/(.*)";\s*$`)
View Source
var ErrTooDeep = errors.New("too deep")
View Source
var HTMLBuilderImportRegexp = regexp.MustCompile(`(?m)<!--\s*#import\s+(.*)\s*-->`)
View Source
var JSBuilderImportHTMLVarsFuncRegexp = regexp.MustCompile(`(?m)toastfront\.pagevars\((.+)\)`)
View Source
var JSBuilderImportRegexp = regexp.MustCompile(`(?m)^import "local:\/\/(.*)";$`)
View Source
var JSBuilderImportVarsFuncRegexp = regexp.MustCompile(`(?m)toastfront\.jsvars\(\)`)

Functions

This section is empty.

Types

type BuildEnv

type BuildEnv struct {
	Lang           string
	AvaliableLangs []string
}

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(srcDir, buildDir, rootFolder string) *Builder

func (*Builder) Build

func (b *Builder) Build(opts ...*BuilderOpts) error

func (*Builder) BuildDir

func (b *Builder) BuildDir() string

func (*Builder) BuildSingle

func (b *Builder) BuildSingle(path string, info fs.FileInfo) error

func (*Builder) Init

func (b *Builder) Init() error

Init is idempotent, multiple calls will only initialize the builder once

func (*Builder) ShouldHandle

func (b *Builder) ShouldHandle(name string) bool

type BuilderOpts

type BuilderOpts struct {
}

type CSSBuilder

type CSSBuilder struct {
	// contains filtered or unexported fields
}

func (*CSSBuilder) CanHandle

func (cb *CSSBuilder) CanHandle(path string, file fs.FileInfo) bool

func (*CSSBuilder) Init

func (cb *CSSBuilder) Init() error

func (*CSSBuilder) IsCssFile

func (cb *CSSBuilder) IsCssFile(path string, file fs.FileInfo) bool

func (*CSSBuilder) Process

func (cb *CSSBuilder) Process(path string, file fs.FileInfo) error

func (*CSSBuilder) ProcessAsByte

func (cb *CSSBuilder) ProcessAsByte(path string, file fs.FileInfo) ([]byte, error)

type CopyBuilder

type CopyBuilder struct {
	// contains filtered or unexported fields
}

func (*CopyBuilder) CanHandle

func (cp *CopyBuilder) CanHandle(path string, file fs.FileInfo) bool

func (*CopyBuilder) Init

func (cp *CopyBuilder) Init() error

func (*CopyBuilder) IsAssetsFile

func (cp *CopyBuilder) IsAssetsFile(path string, file fs.FileInfo) bool

func (*CopyBuilder) Process

func (cp *CopyBuilder) Process(path string, file fs.FileInfo) error

func (*CopyBuilder) RewritePath

func (cp *CopyBuilder) RewritePath(path string) string

type FileBuilder

type FileBuilder interface {
	Init() error
	CanHandle(string, fs.FileInfo) bool
	Process(string, fs.FileInfo) error
}

type FileWriter

type FileWriter interface {
	Writer(string, io.WriteCloser) io.WriteCloser
}

type FolderBuilder

type FolderBuilder struct {
	// contains filtered or unexported fields
}

func (*FolderBuilder) CanHandle

func (fb *FolderBuilder) CanHandle(path string, file fs.FileInfo) bool

func (*FolderBuilder) Init

func (fb *FolderBuilder) Init() error

func (*FolderBuilder) Process

func (fb *FolderBuilder) Process(path string, file fs.FileInfo) error

func (*FolderBuilder) RewritePath

func (fb *FolderBuilder) RewritePath(path string) string

type HTMLBuilder

type HTMLBuilder struct {
	// contains filtered or unexported fields
}

func (*HTMLBuilder) CanHandle

func (cb *HTMLBuilder) CanHandle(path string, file fs.FileInfo) bool

func (*HTMLBuilder) GetPathData

func (cb *HTMLBuilder) GetPathData(path string) map[string]interface{}

func (*HTMLBuilder) GetPathDataDir

func (cb *HTMLBuilder) GetPathDataDir(varsDir string) map[string]interface{}

func (*HTMLBuilder) Init

func (cb *HTMLBuilder) Init() error

func (*HTMLBuilder) IsHtmlFile

func (cb *HTMLBuilder) IsHtmlFile(path string, file fs.FileInfo) bool

func (*HTMLBuilder) Process

func (cb *HTMLBuilder) Process(path string, file fs.FileInfo) error

func (*HTMLBuilder) ProcessAsByte

func (cb *HTMLBuilder) ProcessAsByte(path string, file fs.FileInfo) ([]byte, error)

func (*HTMLBuilder) RewritePath

func (cb *HTMLBuilder) RewritePath(path string) string

type JSBuilder

type JSBuilder struct {
	VarsFile string
	// contains filtered or unexported fields
}

func (*JSBuilder) CanHandle

func (cb *JSBuilder) CanHandle(path string, file fs.FileInfo) bool

func (*JSBuilder) GetInternal

func (cb *JSBuilder) GetInternal(path string) []byte

func (*JSBuilder) Init

func (cb *JSBuilder) Init() error

func (*JSBuilder) IsJsFile

func (cb *JSBuilder) IsJsFile(path string, file fs.FileInfo) bool

func (*JSBuilder) Process

func (cb *JSBuilder) Process(path string, file fs.FileInfo) error

func (*JSBuilder) ProcessAsByte

func (cb *JSBuilder) ProcessAsByte(path string, file fs.FileInfo) ([]byte, error)

type NOOPMinifier

type NOOPMinifier struct {
}

func (*NOOPMinifier) Writer

func (m *NOOPMinifier) Writer(mediatype string, out io.WriteCloser) io.WriteCloser

type TDMinifier

type TDMinifier struct {
	Minifier *minify.M
}

func (*TDMinifier) Writer

func (m *TDMinifier) Writer(mediatype string, out io.WriteCloser) io.WriteCloser

Jump to

Keyboard shortcuts

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