mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-02 15:25:19 +00:00
21 lines
330 B
Rust
21 lines
330 B
Rust
#[macro_use]
|
|
extern crate askama;
|
|
|
|
use askama::Template;
|
|
|
|
macro_rules! hello {
|
|
() => {
|
|
"world"
|
|
}
|
|
}
|
|
|
|
#[derive(Template)]
|
|
#[template(path = "rust-macros.html")]
|
|
struct RustMacrosTemplate {}
|
|
|
|
#[test]
|
|
fn main() {
|
|
let template = RustMacrosTemplate {};
|
|
assert_eq!("Hello, world!", template.render().unwrap());
|
|
}
|