astonishing-waitress-71188
05/24/2023, 6:53 AMrust
#[derive(Serialize)]
struct Todo {
id: usize,
content: String,
.. etc
}
fn axum_handler() -> impl IntoResponse {
// probably passed in as State
let se = serde_htmx::Builder::new()
.div_container()
.css_class("class-name")
.build();
let todos = query_todos();
Html(se.to_html(todos))
}
The serializer would take care of creating <ul><li></li></ul>
etc (defaults + config if required). No template syntax needed.
Is something like that possible with Askama?