data-url-encode-macro 1.0.1

Rust macro to generate base64+percent-encoded strings suitable for data URLs in compile time
Documentation
1
2
3
4
5
6
7
8
use data_url_encode_macro::data_url_encode;

const HTML: &str = data_url_encode!("<h1>Hello, World!</h1>");

#[test]
fn test_encode() {
    assert_eq!(HTML, "PGgxPkhlbGxvLCBXb3JsZCE8L2gxPg%3D%3D");
}