Expand description
A generic templating language for rust ui frameworks
This is meant to be used for creating procedural macros to generate ui code.
§Implementors
§Example
ⓘ
#[proc_macro]
pub fn rdml(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream {
let nodes = parse_macro_input!(tokens as Nodes);
let nodes = nodes.nodes.iter().map(generate_node);
quote! {
::leptos::prelude::view! {
#(#nodes)*
}
}
.into()
}Structs§
- Attribute
- An attribute:
class="value" - Attribute
Name Directive - An attribute name with a directive:
on:click - Attributes
- An list of attributes:
(class="value", id="value") - Block
- A block of nodes surrounded by braces:
{ div {} [...] } - Element
- An element
- Expr
Node - An expression interpolation node:
(1 + 1). - ForNode
- A for node
- IfNode
- An if template literal
- Match
Node - A match node (
match {}) - Match
Node Arm - A match node arm. (
pattern => node) - Node
- A node with attributes
- Nodes
Enums§
- Attribute
Name - An attribute name
- Else
Node - Either an
else if {}clause or anelse {}clause. - Node
Type - A
Nodewithout attributes