component

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrComponentNotParsed = errors.New("transform must be called after parse")

ErrComponentNotParsed is returned when an attempt is made to Transform() a Component before calling Parse()

Functions

func ProcessAll

func ProcessAll(base string) error

ProcessAll processes components starting at base

Types

type Component

type Component struct {
	Name     string
	Template string
	Style    string
	Package  string
	Imports  []string

	Struct   bool
	UniqueID string
	// contains filtered or unexported fields
}

A Component represents a web component in an HTML file

func Parse

func Parse(r io.Reader, name string) (*Component, error)

Parse reads a component file like Nav.html into a Component structure

func (*Component) QuotedStyle

func (c *Component) QuotedStyle() string

func (*Component) QuotedTemplate

func (c *Component) QuotedTemplate() string

func (*Component) Transform

func (c *Component) Transform(w io.Writer) error

func (*Component) TransformStyle

func (c *Component) TransformStyle()

func (*Component) WriteImports

func (c *Component) WriteImports() string

type Transpiler

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

func NewTranspiler

func NewTranspiler(r io.ReadCloser, createStruct bool, appPackage, componentName, packageName string) (*Transpiler, error)

func (*Transpiler) Code

func (s *Transpiler) Code() string

Jump to

Keyboard shortcuts

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