6 releases

0.2.0 Apr 6, 2023
0.1.4 Apr 2, 2023
0.1.1 Dec 11, 2021
0.1.0 Nov 26, 2021

#1310 in Rust patterns

Download history 22/week @ 2024-02-26 4/week @ 2024-03-04 16/week @ 2024-03-11 1/week @ 2024-03-18 23/week @ 2024-04-01 2/week @ 2024-04-08 32/week @ 2024-04-15

57 downloads per month
Used in 2 crates

MIT license

42KB
876 lines

laby

Crate Docs Maintainer License Issues Contributors

laby is a small macro library for writing HTML templates in Rust. Documentation

let n = html!(
  head!(
    title!("laby"),
  ),
  body!(
    p!("Hello, world!"),
  ),
);

let s = render!(DocType::HTML5, n);
<!DOCTYPE html><html><head><title>laby</title></head><body><p>Hello, world!</p></body></html>

lib.rs:

Contains code required by laby at both compile time and runtime.

This crate mainly provides the Render trait that forms the basis of all HTML rendering operations, the escape function that escapes strings for HTML inclusion, and the Buffer type that provides the rendering output buffer.

This crate is re-exported by crate laby. If you are using laby, you should not depend on this crate directly.

Dependencies

~740KB
~13K SLoC