templatepipe

package
Version: v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2016 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert added in v0.6.1

func Convert(inputTemplateFile, definesFromFile string,
	htmlFuncs map[string]interface{}, outputFile string) error

func Curl

func Curl(s string) string

func CurlyNotMethod

func CurlyNotMethod(parent, key, full string) interface{}

func CurlyX

func CurlyX(parent, key, full string) interface{}

func Data

func Data(cf CurlyFunc, root *template.Template) interface{}

func Encurl

func Encurl(cf CurlyFunc, parent Dotted, level int) interface{}

Encurl returns constructed Nota.

func Uncurl

func Uncurl(s string) string

Types

type Context

type Context struct {
	Dotted Dotted              // end result
	Vars   map[string][]string // for vars kept between Node* methods calls
}

func (*Context) Node

func (c *Context) Node(node parse.Node, na NodeArgs)

func (*Context) Ranging

func (c *Context) Ranging(rangeNode *parse.RangeNode, na NodeArgs)

func (*Context) Touch

func (c *Context) Touch(na NodeArgs, words []string)

type Curled

type Curled string

func Curly

func Curly(parent, key, full string) Curled

func (Curled) Uncurl

func (c Curled) Uncurl() string

type CurlyFunc

type CurlyFunc func(string, string, string) interface{}

type Define

type Define struct {
	ShortName  string
	Iterable   string
	NeedList   bool
	UsesParams bool
	JSX        string
}

func MakeDefine

func MakeDefine(definesOnly *template.Template, shortname, fullname string) (Define, error)

type Dotted

type Dotted struct {
	Parent *Dotted
	Leaves []*Dotted // template/parse has nodes, we ought to have leaves
	Name   string

	Ranged bool
	Keys   []string
	Decl   string
}

Dotted is a tree.

func (*Dotted) Append

func (d *Dotted) Append(words []string, prefix []string) *Dotted

Append adds words into d.

func (*Dotted) Find

func (d *Dotted) Find(words []string) *Dotted

Find traverses d to search by words. Used by tests.

func (Dotted) Leave

func (d Dotted) Leave(name string) *Dotted

func (*Dotted) Notation

func (d *Dotted) Notation() (string, string, string)

type NodeArgs

type NodeArgs struct {
	Template    *template.Template
	PrefixWords []string
	Decl        []*parse.VariableNode
}

type Nota

type Nota map[string]interface{}

Nota is a type of encoded jsx notations for template transplitting.

func (Nota) String

func (n Nota) String() string

func (Nota) Uncurl

func (n Nota) Uncurl() string

Uncurl is required by templatefunc.Uncurler interface.

type SortableTemplates

type SortableTemplates []*template.Template

SortableTemplates is for just sorting.

func (SortableTemplates) Len

func (st SortableTemplates) Len() int

func (SortableTemplates) Less

func (st SortableTemplates) Less(i, j int) bool

func (SortableTemplates) Swap

func (st SortableTemplates) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL