rusty-html

Crates.iorusty-html
lib.rsrusty-html
version0.1.2
sourcesrc
created_at2022-02-28 10:57:42.823223
updated_at2022-07-16 15:28:40.49539
descriptionThis crate allows for Jsx html inline like syntax in rust
homepage
repositoryhttps://github.com/michaelvanstraten/rusty-html
max_upload_size
id540802
size5,955
Michael (michaelvanstraten)

documentation

README

rusty-html

This crate allows for Jsx html inline like syntax in rust

Example

use rusty_html::html;

fn main() {
    let html = html! {
        <html>
            <head>
            <title>Page Title</title>
            </head>
            <body>
            {
                vec!["ad", "sdf", "sdfsdf"].into_iter().map(|s| {
                        html!{
                            <p>{s}</p>
                        }
                    }
                ).collect::<Vec<String>>()
            }
            <h1>sfsdf</h1>
            <p>My first paragraph.</p>
            </body>
        </html>
    };
    println!("{}", html);
}

License: MIT

Commit count: 20

cargo fmt