transpiler

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EOT = es.New("end of tag")

Functions

func ComponentName

func ComponentName(path string) string

func GeneratedGoFileName

func GeneratedGoFileName(base, name string) string

func IsHTML

func IsHTML(info os.FileInfo) bool

func ProcessAll

func ProcessAll(base string)

ProcessAll processes components starting at base

func SanitizedName

func SanitizedName(path string) string

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

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)

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

func (*Transpiler) Code

func (s *Transpiler) Code() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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