←back to thread

40 points Bogdanp | 1 comments | | HN request time: 0.199s | source
Show context
petcat ◴[] No.45116113[source]
> As part of my ongoing project to reimplement Django’s templating language in Rust, I have been adding support for custom template tags.

Cool project, but does the author know about minijinja [1]?

[1] https://github.com/mitsuhiko/minijinja

replies(2): >>45117000 #>>45119926 #
1. Rendello ◴[] No.45119926[source]
I just ported some code from Python to Rust, and spent a good few days pouring over the template/DOM ecosystem. What I really wanted was a Rust version of Python's Dominate library, which allows you to write your DOM nodes as regular objects and render the tree with nice (locally controllable) indentation. I didn't want templates, and I wanted something that allowed me to control indentation, leave comments in the HTML, and write code as code. I ended up spending a week implementing something similar to Dominate in Rust.

https://github.com/Knio/dominate