diff options
author | Ashelyn Rose <git@ashen.earth> | 2025-04-25 01:28:20 -0600 |
---|---|---|
committer | Ashelyn Rose <git@ashen.earth> | 2025-04-25 01:28:20 -0600 |
commit | 9f29a187b2395c5d1d4039600917e642948ad26b (patch) | |
tree | 88852805dc6c0642bf9e3ebf3a25a0ba4f597642 /modules/site_test/src | |
parent | b115605055e72c5a261f9f024d7db8f508517fc9 (diff) |
Working proc macro proc_macro
Diffstat (limited to 'modules/site_test/src')
-rw-r--r-- | modules/site_test/src/main.rs | 28 |
1 files changed, 7 insertions, 21 deletions
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<Self>) -> Vec<RenderNode> { - 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, - }, - ] } - ] + } } } |