viewparse

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SupportedDirectiveNames

func SupportedDirectiveNames() []string

SupportedDirectiveNames returns the sorted closed set of exact-name g: directives owned by the current view contract (excluding the g:on:* event family and the g:message:* rules, which are validated separately). It is the source of truth cross-checked against docs/language/stability.md.

Types

type Attr

type Attr = viewmodel.Attr

type ComponentCall

type ComponentCall = viewmodel.ComponentCall

type Element

type Element = viewmodel.Element

type EventDirective

type EventDirective struct {
	Event      string
	Prevent    bool
	Stop       bool
	Once       bool
	Capture    bool
	DebounceMS int
	ThrottleMS int
}

EventDirective is a parsed g:on:<event>[.<modifier>] directive.

func ParseEventDirective

func ParseEventDirective(name string) (EventDirective, error)

ParseEventDirective validates and splits a g:on directive name.

func (EventDirective) RuntimeOptions

func (directive EventDirective) RuntimeOptions() string

RuntimeOptions returns the compact modifier string emitted into HTML.

type ForDirective

type ForDirective struct {
	Var        string
	IndexVar   string
	Collection string
}

ForDirective is a parsed g:for declaration.

func ParseForDirective

func ParseForDirective(source string) (ForDirective, error)

ParseForDirective parses a g:for value such as "item in Items" or "item, i in Items".

type Node

type Node = viewmodel.Node

func Parse

func Parse(source string) ([]Node, error)

Parse parses a view markup fragment into the pure view model.

type Text

type Text = viewmodel.Text

Jump to

Keyboard shortcuts

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