Versions in this module Expand all Collapse all v0 v0.2.0 May 27, 2025 Changes in this version + var ErrChildOnly = errors.New("node must appear inside an element node") + var ErrMissingBody = errors.New("node must have children") + var ErrTopLevelOnly = errors.New("node must appear at the top level") type Node + func (n *Node) Render(w writer) (int, error) + type PluginOption func(*pluginConfig) + func WithExtensionName(extName string) PluginOption + func WithTagMappings(tagMappings map[string]string) PluginOption + func WithTagPrefixes(tagPrefixes map[string]string) PluginOption v0.1.0 May 4, 2025 Changes in this version + var ErrErrorNode = errors.New("cannot render an ErrorNode node") + var ErrTooManyChildren = errors.New("element must have a single child") + var ErrUnknownNode = errors.New("unknown node type") + var ErrVoidChildren = errors.New("void element has child nodes") + func Plugin() api.Plugin + func Render(w io.Writer, n *Node) (int, error) + type Attribute struct + IsExpr bool + Key string + KeyAtom atom.Atom + Val string + type Node struct + Attr []Attribute + Data string + DataAtom atom.Atom + FirstChild *Node + LastChild *Node + NextSibling *Node + Parent *Node + Path []PathComponent + PrevSibling *Node + Type NodeType + func Parse(r io.Reader) (node *Node, err error) + func (n *Node) AppendChild(c *Node) + func (n *Node) InsertBefore(newChild, oldChild *Node) + func (n *Node) RemoveChild(c *Node) + func (n *Node) TagName() string + type NodeType uint32 + const CommentNode + const ComponentNode + const ElementNode + const ErrorNode + const RangeNode + const TextNode + const UnlessNode + const VariableNode + const WhenNode + type PathComponent struct + IsRange bool + Key string + type TokenType uint32 + const CommentToken + const EndControlToken + const EndTagToken + const ErrorToken + const RangeToken + const SelfClosingTagToken + const StartTagToken + const TextToken + const UnlessToken + const VariableToken + const WhenToken + type Tokenizer struct + func NewTokenizer(r io.Reader) *Tokenizer + func (t *Tokenizer) Comment() []byte + func (t *Tokenizer) ControlName() []byte + func (t *Tokenizer) Err() error + func (t *Tokenizer) Next() TokenType + func (t *Tokenizer) Raw() []byte + func (t *Tokenizer) TagAttr() (key []byte, val []byte, isExpr bool, moreAttr bool) + func (t *Tokenizer) TagName() ([]byte, bool)