Crates.io | write-html-macro |
lib.rs | write-html-macro |
version | 0.1.2 |
source | src |
created_at | 2023-04-21 08:28:36.951963 |
updated_at | 2023-04-23 13:49:33.880465 |
description | A macro for writing HTML in Rust |
homepage | https://github.com/OpenPhysicsNotes/write-html |
repository | https://github.com/OpenPhysicsNotes/write-html |
max_upload_size | |
id | 845124 |
size | 17,166 |
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.
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();