File: attributes.rs

package info (click to toggle)
rust-markup 0.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 128 kB
  • sloc: makefile: 4
file content (30 lines) | stat: -rw-r--r-- 524 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
markup::define! {
    #[derive(Clone)]
    Page<Body: markup::Render>(
        /// The page title
        title: &'static str,
        /// The page body
        body: Body,
    ) {
        html {
            head {
                title { @title }
            }
            body {
                @body
            }
        }
    }
}

fn main() {
    let page = Page {
        title: "Hello",
        body: markup::new! {
            p {
                "Hello!"
            }
        },
    };
    println!("{}", page);
}