kasia.go: github.com/ziutek/kasia.go Index | Files | Directories

package kasia

import "github.com/ziutek/kasia.go"

Templating system for HTML and other text documents

Index

Package Files

compat.go getvarfun.go parser1.go parser2.go parser_elements.go parser_err.go template.go

Constants

const (
    RUN_OK = iota
    RUN_NOT_FOUND
    RUN_WRONG_ARG_NUM
    RUN_WRONG_ARG_TYP
    RUN_UNEXPORTED
    RUN_NOT_RET
    RUN_INDEX_OOR
    RUN_UNK_TYPE
    RUN_NOT_FUNC
    RUN_NIL_CTX
    RUN_INC_MAP_KEY
    RUN_NESTED
    CMP_NMATCH
    CMP_ARRSLIC
    CMP_BOOL
    CMP_CHANN
    CMP_CPLX
    CMP_FUNC
    CMP_MAP
    CMP_UNKNOWN
)
const (
    MAIN_BLK = iota
    IF_BLK
    FOR_BLK
    ELSE_BLK
    DEFER_BLK
)
const (
    PARSE_OK = iota
    PARSE_UNEXP_EOF
    PARSE_SYM_NEND
    PARSE_TXT_NEND
    PARSE_FUN_NEND
    PARSE_IF_ERR
    PARSE_BAD_NAME
    PARSE_FOR_ERR
    PARSE_UNEXP_ELIF
    PARSE_UNEXP_ELSE
    PARSE_UNEXP_END
    PARSE_BAD_FLOINT
    PARSE_IF_NEND
    PARSE_FOR_NEND
    PARSE_COLON_ERR
    PARSE_NESTED_DEFER
    PARSE_DEFER_NEND
)

func Render Uses

func Render(txt string, ctx ...interface{}) (out string)

func RenderBytes Uses

func RenderBytes(txt string, strict bool, ctx ...interface{}) ([]byte, error)

func RenderString Uses

func RenderString(txt string, strict bool, ctx ...interface{}) (string, error)

func WriteEscapedHtml Uses

func WriteEscapedHtml(wr io.Writer, txt []byte) (err error)

type ContextItself Uses

type ContextItself []interface{}

type DeferElem Uses

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

type Element Uses

type Element interface {
    // contains filtered or unexported methods
}

type ElifElem Uses

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

type ElseElem Uses

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

type EndElem Uses

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

type ForElem Uses

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

type IfElem Uses

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

type NestedTemplate Uses

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

type ParseErr Uses

type ParseErr struct {
    Lnum, Enum int
}

func (ParseErr) Error Uses

func (pe ParseErr) Error() string

type ReturnElem Uses

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

type RunErr Uses

type RunErr struct {
    Lnum   int
    Enum   int
    Nested error
}

func (RunErr) Error Uses

func (re RunErr) Error() (txt string)

type Template Uses

type Template struct {
    Strict     bool
    EscapeFunc func(io.Writer, []byte) error
    // contains filtered or unexported fields
}

func MustParse Uses

func MustParse(txt string) (tpl *Template)

func MustParseFile Uses

func MustParseFile(filename string) (tpl *Template)

func New Uses

func New() *Template

func Parse Uses

func Parse(txt string) (tpl *Template, err error)

func ParseFile Uses

func ParseFile(filename string) (tpl *Template, err error)

func (*Template) Execute Uses

func (tpl *Template) Execute(wr io.Writer, data interface{}) error

func (*Template) Nested Uses

func (tpl *Template) Nested(ctx ...interface{}) *NestedTemplate

func (*Template) Parse Uses

func (tpl *Template) Parse(txt []byte) (err error)

func (*Template) ParseFile Uses

func (tpl *Template) ParseFile(filename string) (err error)

func (*Template) Render Uses

func (tpl *Template) Render(ctx ...interface{}) (out string)

func (*Template) RenderBytes Uses

func (tpl *Template) RenderBytes(ctx ...interface{}) ([]byte, error)

func (*Template) RenderString Uses

func (tpl *Template) RenderString(ctx ...interface{}) (string, error)

func (*Template) Run Uses

func (tpl *Template) Run(wr io.Writer, ctx ...interface{}) (err error)

type TxtElem Uses

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

type VarFunElem Uses

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

Directories

PathSynopsis
examples

Package kasia imports 8 packages (graph) and is imported by 3 packages. Updated 2016-07-16. Refresh now. Tools for package owners.