runique/macros/template/const_template.rs
1//! Macros `tpl!` / `tpls!` — static inclusion (`include_str!`) of templates from `runique/templates/`.
2
3#[macro_export]
4macro_rules! tpl {
5 ($name:literal, $path:literal) => {
6 ($name, include_str!(concat!("../../../templates/", $path)))
7 };
8}
9
10#[macro_export]
11macro_rules! tpls {
12 ( $( ($name:literal, $path:literal) ),* $(,)? ) => {
13 &[
14 $(
15 $crate::tpl!($name, $path),
16 )*
17 ] as &[(&str, &str)]
18 };
19}