mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-02 15:25:19 +00:00

Using `#[template(source = "…")]` is tiresome, because you have to escape the input. That makes it difficult to read, too. Using `#[template(path = "…")` can be tiresome, too, if the code is small and/or if you just want to prototype something. This PR adds a third option to supply the source of a template: You can supply the source in the comments of a template. This works similar to doctest. Any <code>```rinja```</code> block gets extracted, and the combined blocks are the source code of the template.