Versions in this module Expand all Collapse all v0 v0.18.5 Sep 23, 2026 Changes in this version + func RegisterBlockTag(name, endTag string, followers ...string) + func RegisterStandaloneTag(name string) + func SetIndentConfig(config IndentConfig) + func TraverseNode(n NodeList, f func(*ElementNode)) + type Attribute struct + Key string + Value string + func (a *Attribute) Dump(indent int) string + type AttributeEntityEncodingFromTo struct + From string + To string + type CommentNode struct + Line int + Text string + func (c *CommentNode) Dump(indent int) string + type ConfiguredNodeList struct + Config IndentConfig + Nodes NodeList + func NewAdminParser(input string) (ConfiguredNodeList, error) + func NewStorefrontParser(input string) (ConfiguredNodeList, error) + func (cnl ConfiguredNodeList) Dump(indent int) string + type ElementNode struct + Attributes NodeList + Children NodeList + Line int + SelfClosing bool + Tag string + Unclosed bool + func (e *ElementNode) Dump(indent int) string + type IndentConfig struct + IndentSize int + SpaceIndent bool + TwigBlockIndentChildren bool + func DefaultIndentConfig() IndentConfig + func (c IndentConfig) GetIndent() string + type Node interface + Dump func(indent int) string + type NodeList []Node + func NewParser(input string) (NodeList, error) + func NewParserWithConfig(input string, config IndentConfig) (NodeList, error) + func (nodeList NodeList) Dump(indent int) string + type ParentNode struct + Line int + Trim TwigTrim + func (p *ParentNode) Dump(indent int) string + type ParseError struct + Filename string + Msg string + Pos Pos + Related []RelatedLoc + Source string + func (e *ParseError) Error() string + func (e *ParseError) PrettyError() string + type Pos struct + Line int + Offset int + func (p Pos) ColumnIn(src string) int + func (p Pos) String() string + type RawNode struct + Line int + Text string + func (r *RawNode) Dump(indent int) string + type RelatedLoc struct + Msg string + Pos Pos + type TagParseFunc func(p *parser, openTok token) (Node, error) + type TagSpec struct + EndTag string + Followers []string + Name string + Parse TagParseFunc + type TemplateExpressionNode struct + Expression string + Line int + Trim TwigTrim + func (t *TemplateExpressionNode) Dump(indent int) string + type TwigBlockNode struct + Children NodeList + CloseTrim TwigTrim + Line int + Name string + OpenTrim TwigTrim + func (t *TwigBlockNode) Dump(indent int) string + type TwigCommentNode struct + Body string + Line int + Trim TwigTrim + func (c *TwigCommentNode) Dump(indent int) string + type TwigGenericBlockNode struct + Args string + Body NodeList + CloseTrim TwigTrim + Else NodeList + ElseTrim TwigTrim + EndTag string + Line int + Name string + OpenTrim TwigTrim + func (n *TwigGenericBlockNode) Dump(indent int) string + type TwigIfBranch struct + Body NodeList + Condition string + Trim TwigTrim + type TwigIfNode struct + Branches []TwigIfBranch + ElseChildren NodeList + ElseTrim TwigTrim + EndTrim TwigTrim + Line int + func (t *TwigIfNode) Dump(indent int) string + type TwigStandaloneTagNode struct + Args string + Line int + Name string + Trim TwigTrim + func (n *TwigStandaloneTagNode) Dump(indent int) string + type TwigTrim struct + Left bool + Right bool + type TwigVerbatimNode struct + Body string + CloseTrim TwigTrim + Line int + OpenTrim TwigTrim + func (v *TwigVerbatimNode) Dump(indent int) string