Documentation ¶
Index ¶
Constants ¶
const ( DefaultLeftDelim = "//include(" DefaultRightDelim = ")" )
Contant bundler variables
const ( ItemError itemType = iota // error occurred; value is text of error ItemEOF ItemLeftDelim // left action delimiter ItemRightDelim // right action delimiter ItemText // plain text ItemFile // file keyword )
Lexed Item Types
Variables ¶
This section is empty.
Functions ¶
func Bundle ¶
func Bundle(r io.Reader, w io.Writer, dir string, relativeToDir bool, relativeDir string, leftDelim string, rightDelim string) error
Bundle combines the given input and writes it out to the provided writer removing delims from the combined files
func BundleKeepDelims ¶
func BundleKeepDelims(r io.Reader, w io.Writer, dir string, relativeToDir bool, relativeDir string, leftDelim string, rightDelim string) error
BundleKeepDelims combines the given input and writes it out to the provided writer but unlike Bundle() keeps the delims in the combined data
Types ¶
type Item ¶
type Item struct { Type itemType // The type of this item. Pos Pos // The starting position, in bytes, of this item in the input string. Val string // The value of this item. }
Item represents a token or text string returned from the scanner.
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
Lexer holds the state of the scanner.
type Pos ¶
type Pos int
Pos represents a byte position in the original input text from which this template was parsed.
type ProcessedFile ¶
ProcessedFile contains the information of the processed files.
func BundleDir ¶
func BundleDir(dirname string, suffix string, relativeToDir bool, relativeDir string, leftDelim string, rightDelim string, ignoreRegexp *regexp.Regexp) ([]*ProcessedFile, error)
BundleDir bundles an entire directory recursively and returns an array of filenames and if an error occurred processing suffix will be appended to filenames, if blank a hash of file contents will be added
func BundleFile ¶
func BundleFile(path string, output string, relativeToDir bool, relativeDir string, leftDelim string, rightDelim string) (*ProcessedFile, error)
BundleFile bundles a single file on disk and returns the filename and if an error occurred processing