testing/
testing.rs

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
31
32
33
34
35
36
37
38
39
40
41
42
use titan_html::{
  css,
  tags::{
    head::Head,
    html::Html,
    link::{Link, LinkLoadType},
    Div, IntoTag as _,
  },
};

fn main() {
  let root = Html::with_head(Head::empty()).body_from_iter([
    Link::text("http://localhost:3000", "testing")
      .preload(LinkLoadType::WhenIdle)
      .styles(
        "
          color: blue;
          background-color: red;
        ",
      )
      .add_id("testing")
      .into_tag(),
    Link::text("http://localhost:3000".to_string(), "testing")
      .styles(
        "
          color: blue;
          background-color: red;
        ",
      )
      .into_tag(),
    Div::text("testing")
      .styles(css!(
        "
        background-color: green;
        color: blue;
              "
      ))
      .into_tag(),
  ]);

  println!("{}", titan_html::render(root));
}