engines

package
v0.0.0-...-722d182 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	FileFormats() []string
	Render(input []byte) (Node, error)
	RenderString(input string) (Node, error)
}

type Engines

type Engines []Engine

func (Engines) MatchEngine

func (engs Engines) MatchEngine(rawFileName string) (Engine, string, error)

type Node

type Node interface {
	Type() nodetypes.NodeType
	Value() string
	Children() []Node
}

func ConvertChildren

func ConvertChildren[T Node](gotChildren []T) []Node

type RawJson

type RawJson struct{}

func (RawJson) FileFormats

func (engine RawJson) FileFormats() []string

func (RawJson) Render

func (engine RawJson) Render(input []byte) (Node, error)

func (RawJson) RenderString

func (engine RawJson) RenderString(input string) (Node, error)

type Twig

type Twig struct{}

func (Twig) FileFormats

func (engine Twig) FileFormats() []string

func (Twig) Render

func (engine Twig) Render(input []byte) (Node, error)

func (Twig) RenderString

func (engine Twig) RenderString(input string) (Node, error)

type TwigNode

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

func (TwigNode) Children

func (node TwigNode) Children() []Node

func (TwigNode) Type

func (node TwigNode) Type() nodetypes.NodeType

func (TwigNode) Value

func (node TwigNode) Value() string

type TwigNodeType

type TwigNodeType int
const (
	TWIG_ROOT TwigNodeType = iota
	TWIG_DISPLAY
	TWIG_STMT
	TWIG_RAW
	TWIG_IDENT
	TWIG_STRING
	TWIG_SELECTOR
	TWIG_FILTER
	TWIG_CALL
	TWIG_COMMENT
	TWIG_ERROR
)

type TwigScanner

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

func (TwigScanner) Scan

func (sc TwigScanner) Scan() (TwigNode, error)

Jump to

Keyboard shortcuts

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