You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A templating engine using JSONPath-based `ht-*` data attributes for dynamic data binding in HTML/HTMX. HTMT extends standard HTML with custom attributes for declarative rendering and state management directly in the markup.
10
-
11
-
**Key attributes:**
12
-
13
-
| Attribute | Description |
14
-
|-----------|-------------|
15
-
|`ht-bind`| Bind data to element content |
16
-
|`ht-loop`| Iterate over arrays |
17
-
|`ht-template`| Reusable template blocks |
18
-
|`ht-attr-[name]`| Bind to HTML attributes |
19
-
|`ht-show` / `ht-hide`| Conditional visibility |
20
-
|`ht-switch` / `ht-case`| Switch-case rendering |
21
-
|`ht-class-[name]`| Conditional CSS classes |
22
-
|`ht-root-[attribute]`| Root-scoped variant of any attribute, binding against the root of the data instead of the local scope |
23
-
24
-
All attributes use JSONPath expressions (e.g., `$.user.name`) for data binding.
25
-
26
-
HTMT templates can be used as VDP template targets — VDP declares *which* HTMT templates to render, while HTMT handles the actual data binding.
Copy file name to clipboardExpand all lines: docs/specification.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ REST APIs return structured data (JSON, XML) that carries no presentation inform
26
26
27
27
-**View Descriptor**: A JSON object that describes a template tree — a root template URL and its slot assignments.
28
28
-**Template URL**: A URL identifying a template resource. The URL MUST resolve to a renderable template in the client's rendering framework.
29
-
-**Slot**: A named insertion point in a template where a sub-template can be composed. Slot names correspond to the template's own insertion point identifiers (e.g., Qute's `{#insert slotName}`, HTML's `<slot name="slotName">`).
29
+
-**Slot**: A named insertion point in a template where a sub-template can be composed. Slot names correspond to the template's own insertion point identifiers (e.g., Qute's `{#insert slotName}`).
30
30
-**View Descriptor Resource**: A standalone JSON document containing a view descriptor, addressable by its own URL, cacheable independently of the data it describes.
31
31
-**Static Composition**: Composition written directly into a template's source — for example, a layout that always includes its `_head` partial. VDP does not describe static composition; it is internal to the template.
32
32
-**Dynamic Composition**: Composition that changes per API response — a slot whose template is chosen by the server at request time. These are the slots a view descriptor declares.
@@ -366,8 +366,6 @@ VDP is agnostic to the template language. However, a template used with VDP MUST
0 commit comments