tmpl

package
v0.0.0-...-553e66b Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ATTmpl = iota
	ATLoop
	ATIfPtr
)

Variables

This section is empty.

Functions

func Minify

func Minify(data string) string

TODO: Write unit tests for this

Types

type CContext

type CContext struct {
	RootHolder       string
	VarHolder        string
	HoldReflect      reflect.Value
	RootTemplateName string
	TemplateName     string
	LoopDepth        int
	OutBuf           *[]OutBufferFrame
}

func (*CContext) AttachVars

func (con *CContext) AttachVars(vars string, index int)

func (*CContext) DiscardAndAfter

func (con *CContext) DiscardAndAfter(index int)

func (*CContext) EndIf

func (con *CContext) EndIf(startIndex int, body string) (index int)

func (*CContext) EndLoop

func (con *CContext) EndLoop(body string) (index int)

func (*CContext) EndTemplate

func (con *CContext) EndTemplate(body string) (index int)

func (*CContext) LastBufIndex

func (con *CContext) LastBufIndex() int

func (*CContext) Push

func (con *CContext) Push(nType string, body string) (index int)

func (*CContext) PushPhrase

func (con *CContext) PushPhrase(langIndex int) (index int)

func (*CContext) PushPhrasef

func (con *CContext) PushPhrasef(langIndex int, args string) (index int)

func (*CContext) PushText

func (con *CContext) PushText(body string, fragIndex int, fragOutIndex int) (index int)

func (*CContext) StartIf

func (con *CContext) StartIf(body string) (index int)

func (*CContext) StartIfPtr

func (con *CContext) StartIfPtr(body string) (index int)

func (*CContext) StartLoop

func (con *CContext) StartLoop(body string) (index int)

func (*CContext) StartTemplate

func (con *CContext) StartTemplate(body string) (index int)

type CTemplateConfig

type CTemplateConfig struct {
	Minify         bool
	Debug          bool
	SuperDebug     bool
	SkipHandles    bool
	SkipTmplPtrMap bool
	SkipInitBlock  bool
	PackageName    string
	DockToID       map[string]int
}

type CTemplateSet

type CTemplateSet struct {
	FragOut []OutFrag
	// contains filtered or unexported fields
}

nolint

func NewCTemplateSet

func NewCTemplateSet(in string, logDir ...string) *CTemplateSet

func (*CTemplateSet) Compile

func (c *CTemplateSet) Compile(name, fileDir, expects string, expectsInt interface{}, varList map[string]VarItem, imports ...string) (out string, e error)

func (*CTemplateSet) CompileByLoggedin

func (c *CTemplateSet) CompileByLoggedin(name, fileDir, expects string, expectsInt interface{}, varList map[string]VarItem, imports ...string) (stub, gout, mout string, e error)

func (*CTemplateSet) GetConfig

func (c *CTemplateSet) GetConfig() CTemplateConfig

func (*CTemplateSet) GetOverridenRoots

func (c *CTemplateSet) GetOverridenRoots() map[string]map[string]bool

func (*CTemplateSet) ResetLogs

func (c *CTemplateSet) ResetLogs(in string)

func (*CTemplateSet) SetBaseImportMap

func (c *CTemplateSet) SetBaseImportMap(importMap map[string]string)

func (*CTemplateSet) SetBuildTags

func (c *CTemplateSet) SetBuildTags(tags string)

func (*CTemplateSet) SetConfig

func (c *CTemplateSet) SetConfig(config CTemplateConfig)

func (*CTemplateSet) SetOverrideTrack

func (c *CTemplateSet) SetOverrideTrack(overriden map[string]map[string]bool)

func (*CTemplateSet) SetPerThemeTmpls

func (c *CTemplateSet) SetPerThemeTmpls(perThemeTmpls map[string]bool)

func (*CTemplateSet) SetThemeName

func (c *CTemplateSet) SetThemeName(name string)

type FragLite

type FragLite struct {
	Body string
}

For use in generated code

type Fragment

type Fragment struct {
	Body         string
	TemplateName string
	Index        int
	Seen         bool
}

type OutBufferFrame

type OutBufferFrame struct {
	Body         string
	Type         string
	TemplateName string
	Extra        interface{}
	Extra2       interface{}
}

type OutFrag

type OutFrag struct {
	TmplName string
	Index    int
	Body     string
}

type SkipBlock

type SkipBlock struct {
	Frags           map[int]int
	LastCount       int
	ClosestFragSkip int
}

type Skipper

type Skipper struct {
	Count int
	Index int
}

type VarItem

type VarItem struct {
	Name        string
	Destination string
	Type        string
}

type VarItemReflect

type VarItemReflect struct {
	Name        string
	Destination string
	Value       reflect.Value
}

Jump to

Keyboard shortcuts

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