data_url_encode_macro/
lib.rs

1use proc_macro_hack::proc_macro_hack;
2
3/// Encodes given string literal to [base64] and, then, using [percent encoding] during the compile-time.
4/// So, resulting static `str` can be used in [data URLs].
5///
6/// [base64]: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
7/// [percent encoding]: https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding
8/// [data URLs]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
9#[proc_macro_hack]
10pub use data_url_encode_macro_impl::data_url_encode;