From 9f29a187b2395c5d1d4039600917e642948ad26b Mon Sep 17 00:00:00 2001 From: Ashelyn Rose Date: Fri, 25 Apr 2025 01:28:20 -0600 Subject: Working proc macro --- modules/site_test/src/main.rs | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'modules/site_test') diff --git a/modules/site_test/src/main.rs b/modules/site_test/src/main.rs index 55432d9..ba40ede 100644 --- a/modules/site_test/src/main.rs +++ b/modules/site_test/src/main.rs @@ -25,28 +25,14 @@ struct ParentLayout { impl Component for ParentLayout { fn render(self: Box) -> Vec { - let test = morx! { - html lang="en-US" { - head { title { "test thing" } } - body { "some document" } + morx!{ + html lang = "en-US" { + head { + title = "test thing" + } + body = {self.children} } - }; - - - vec![ - RenderNode::Element { name: "html".to_string(), attributes: HashMap::from([("lang".to_string(), "en-US".to_string())]), children: vec![ - RenderNode::Element { name: "head".to_string(), attributes: HashMap::new(), children: vec![ - RenderNode::Element { name: "title".to_string(), attributes: HashMap::new(), children: vec![ - RenderNode::TextNode { content: "test thing".to_string() } - ] } - ] }, - RenderNode::Element { - name: "body".to_string(), - attributes: HashMap::new(), - children: self.children, - }, - ] } - ] + } } } -- cgit 1.4.1