The template language
A Weft template describes what a component, page or layout shows, what it holds and how it changes. These chapters define the language exactly.
- Overview
Where templates live, and what one is made of.
- Lexical structure
Names, strings, numbers, comments, keywords and the line rule.
- Grammar
The whole syntax, in EBNF.
- Nodes
Elements, text, if, for, slot and meta.
- Attributes and values
Writing attributes, and what each becomes in the page.
- Components and events
Props, slots, events, the event record, and template-only components.
- Expressions
Values, operators and precedence, calls, pipes and lambdas.
- Standard functions
Every function expressions can call, with an example of each.
- Declarations
state, let and on: a template's own state and handlers.
- Data and effects
load, requests in handlers, and timers.
- Pages and routing
app/ and components/, companions, metadata, modes and the base path.
- Built-in elements
Weft's elements, canvas shapes, scene objects, and the HTML attributes written.
- Errors
What the parser reports, and what to do about it.