Documentation ¶
Index ¶
- Variables
- type Compiler
- func (compiler *Compiler) Compile(reader io.Reader) ([]*Component, error)
- func (compiler *Compiler) CompileBytes(src []byte) ([]*Component, error)
- func (compiler *Compiler) CompileFile(fileIn string) ([]*Component, error)
- func (compiler *Compiler) CompileString(src string) ([]*Component, error)
- func (compiler *Compiler) GetFileHeader() string
- func (compiler *Compiler) GetUtilities() string
- func (compiler *Compiler) SaveUtilities(filePath string) error
- type Component
Constants ¶
This section is empty.
Variables ¶
var DefaultCompiler = NewCompiler("components")
DefaultCompiler is the default compiler used by the interface.
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
type Compiler struct { // PackageName contains the package name used in the generated .go files. PackageName string }
Compiler is a Pixy file compiler.
func NewCompiler ¶
NewCompiler constructs a new Pixy compiler.
func (*Compiler) Compile ¶
Compile compiles a Pixy template as a string and returns a slice of components.
func (*Compiler) CompileBytes ¶
CompileBytes compiles a Pixy template as a byte slice and returns a slice of components.
func (*Compiler) CompileFile ¶
CompileFile compiles a Pixy template read from a file and returns a slice of components.
func (*Compiler) CompileString ¶ added in v1.2.0
CompileString compiles a Pixy template as a string and returns a slice of components.
func (*Compiler) GetFileHeader ¶
GetFileHeader returns the file header.
func (*Compiler) GetUtilities ¶
GetUtilities returns the file header and utility functions that are available for components.
func (*Compiler) SaveUtilities ¶
SaveUtilities adds the file with required function definitions to the directory.
type Component ¶
Component represents a single, reusable template.
func CompileBytes ¶
CompileBytes compiles a Pixy template as a byte slice and returns a slice of components.
func CompileFile ¶
CompileFile compiles a Pixy template read from a file and returns a slice of components.
func CompileString ¶ added in v1.2.0
CompileString compiles a Pixy template as a byte slice and returns a slice of components.