Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionBlock ¶
type ActionBlock struct {
Tag string // original HTML tag
ClassName string // class attribute value
OperationID string // data-action value (e.g. "CreateReservation")
Params []ParamBind // data-param-* attributes on this element
Fields []FieldBind // descendant data-field attributes (for validation)
Children []ChildNode // all children in DOM order (for codegen)
SubmitText string // text of button[type=submit]
}
ActionBlock represents a data-action element and its descendant fields.
type ChildNode ¶
type ChildNode struct {
Kind string // "bind", "each", "state", "component", "static", "action", "fetch"
Bind *FieldBind
Each *EachBlock
State *StateBind
Component *ComponentRef
Static *StaticElement
Action *ActionBlock
Fetch *FetchBlock
}
ChildNode represents any child element inside a block, preserving DOM order.
type ComponentRef ¶
type ComponentRef struct {
Name string // component name (e.g. "DatePicker")
Bind string // data-bind value if present
Field string // data-field value if present
ClassName string // class attribute value
}
ComponentRef represents a data-component attribute.
type EachBlock ¶
type EachBlock struct {
Tag string // original HTML tag (e.g. "ul")
ClassName string // class attribute value
ItemTag string // repeated item tag (e.g. "li")
ItemClassName string // repeated item class
Field string // array field name (e.g. "reservations")
Binds []FieldBind // data-bind inside the loop (for validation)
States []StateBind // data-state inside the loop (for validation)
Components []ComponentRef // data-component inside the loop (for validation)
Children []ChildNode // item children in DOM order (for codegen)
}
EachBlock represents a data-each element and its descendant bindings.
type FetchBlock ¶
type FetchBlock struct {
Tag string // original HTML tag (e.g. "section")
ClassName string // class attribute value
OperationID string // data-fetch value (e.g. "ListMyReservations")
Params []ParamBind // data-param-* attributes on this element
Binds []FieldBind // descendant data-bind attributes (for validation)
Eaches []EachBlock // descendant data-each blocks (for validation)
States []StateBind // descendant data-state attributes (for validation)
Components []ComponentRef // descendant data-component attributes (for validation)
Children []ChildNode // all children in DOM order (for codegen)
NestedFetches []FetchBlock // nested data-fetch blocks (for validation)
// Phase 5: infra params
Paginate bool // data-paginate present
Sort *SortDecl // data-sort parsed result
Filters []string // data-filter comma-separated columns
}
FetchBlock represents a data-fetch element and its descendant bindings.
type FieldBind ¶
type FieldBind struct {
Name string // field name (e.g. "Status", "Email")
Tag string // HTML tag (e.g. "span", "input")
Type string // input type attribute (e.g. "hidden", "number", "")
ClassName string // class attribute value
Placeholder string // placeholder attribute value
}
FieldBind represents a data-bind or data-field attribute.
type PageSpec ¶
type PageSpec struct {
Name string // page name derived from filename (e.g. "login-page")
FileName string // original filename (e.g. "login-page.html")
Fetches []FetchBlock // data-fetch blocks (for validation)
Actions []ActionBlock // data-action blocks (for validation)
Children []ChildNode // all top-level children in DOM order (for codegen)
}
PageSpec represents a single STML page parsed from an HTML file.
func ParseDir ¶
func ParseDir(dir string) ([]PageSpec, []diagnostic.Diagnostic)
ParseDir parses all .html files in the given directory and returns a PageSpec for each.
func ParseFile ¶
func ParseFile(path string) (PageSpec, []diagnostic.Diagnostic)
ParseFile parses a single HTML file and returns a PageSpec.
func ParseReader ¶
func ParseReader(filename string, r io.Reader) (PageSpec, []diagnostic.Diagnostic)
ParseReader parses HTML from a reader and returns a PageSpec.
type ParamBind ¶
type ParamBind struct {
Name string // parameter name (e.g. "ReservationID")
Source string // value source (e.g. "route.ReservationID")
}
ParamBind represents a data-param-* attribute.
type StateBind ¶
type StateBind struct {
Tag string // original HTML tag (e.g. "p", "footer")
ClassName string // class attribute value
Condition string // condition expression (e.g. "reservations.empty", "canDelete")
Text string // text content (e.g. "예약이 없습니다")
Children []ChildNode // nested children (e.g. action buttons inside state)
}
StateBind represents a data-state attribute.
Source Files
¶
- direct_text.go
- dispatch_action_child.go
- dispatch_each_child.go
- dispatch_fetch_child.go
- dispatch_static_action_child.go
- dispatch_static_data_child.go
- dispatch_static_each_child.go
- dispatch_static_fetch_child.go
- dispatch_top_level_element.go
- extract_non_empty_text.go
- extract_params.go
- get_attr.go
- handle_action_component.go
- handle_action_field.go
- handle_fetch_component.go
- handle_static_action_component.go
- handle_static_action_field.go
- handle_walk_static_action_component.go
- handle_walk_static_action_field.go
- has_attr.go
- has_content.go
- has_data_attr.go
- has_descendant_data.go
- has_descendant_data_in_fetch.go
- has_descendant_field.go
- has_field_attr.go
- is_data_element.go
- is_implicit_tag.go
- kebab_to_camel.go
- parse_action_block.go
- parse_dir.go
- parse_each_block.go
- parse_each_item_template.go
- parse_fetch_block.go
- parse_file.go
- parse_reader.go
- parse_sort_decl.go
- parse_state_bind.go
- parse_static_element.go
- parse_static_in_action.go
- parse_static_in_each.go
- parse_static_in_fetch.go
- parse_static_with_data_children.go
- split_trim.go
- type_action_block.go
- type_child_node.go
- type_component_ref.go
- type_each_block.go
- type_fetch_block.go
- type_field_bind.go
- type_page_spec.go
- type_param_bind.go
- type_sort_decl.go
- type_state_bind.go
- type_static_element.go
- walk_action_children.go
- walk_each_children.go
- walk_each_item_children.go
- walk_fetch_children.go
- walk_static_action_child.go
- walk_static_action_nested_children.go
- walk_top_level.go