use std::collections::HashMap; use morgana::{morx, Component, RenderNode}; pub fn main() { let parent = ParentLayout { children: vec![ RenderNode::Component( Box::new(Child { children: vec![ RenderNode::TextNode { content: "Hello world!".to_string() } ] }) ) ] }; let text = morgana::render_tree_blocking(RenderNode::Component(Box::new(parent))); println!("{text}") } struct ParentLayout { children: Vec } impl Component for ParentLayout { fn render(self: Box) -> Vec { morx!{ html lang = "en-US" { head { title = "test thing" } body = {self.children} } } } } struct Child { children: Vec } impl Component for Child { fn render(self: Box) -> Vec { vec![ RenderNode::Element { name: "p".to_string(), attributes: HashMap::new(), children: self.children } ] } }