write-html-macro

Crates.iowrite-html-macro
lib.rswrite-html-macro
version0.1.2
sourcesrc
created_at2023-04-21 08:28:36.951963
updated_at2023-04-23 13:49:33.880465
descriptionA macro for writing HTML in Rust
homepagehttps://github.com/OpenPhysicsNotes/write-html
repositoryhttps://github.com/OpenPhysicsNotes/write-html
max_upload_size
id845124
size17,166
Luca Ciucci (LucaCiucci)

documentation

https://docs.rs/write-html-macro

README

write-html

A simple and fast html generator

:warning: This project is still in development and is not ready for production use, it is also not so fast, yet.

Example

use write_html::*;

let page = html!(
    (Doctype)
    html lang="en" {
        head {
            (DefaultMeta)
            title { "Website!" }
        }
        body {
            h1 #some-id { "H1" }
            h2 { "H2" }
            h3 { "H3" }
            p { "Paragraph" }
            ol {
                li { "Item 1" }
                li { "Item 2" }
                li style="color: red" { "Item 3" }
            }
            footer;
        }
    }
).to_html_string().unwrap();
Commit count: 18

cargo fmt