35 points Bogdanp | 5 comments | | HN request time: 0.826s | source
1. 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 #
2. Klonoar ◴[] No.45117000[source]
There is little chance they don't know about minijinja/askama/tera/etc.

The repo for their project outlines why they're doing this, though: https://github.com/LilyAcorn/django-rusty-templates

It's seemingly being made for being used in Django as a template backend, not necessarily for use from Rust like the others (i.e native-ifying Django templates).

replies(1): >>45118513 #
3. aleyan ◴[] No.45118513{3}[source]
Setting aside the reason that hydrating django templates in rust from django is useful in ways that hydrating jinja templates in rust from django isn't useful. Petcat's comment could be useful and the author may not be aware of existing prior art. As engineers, there is sometimes a huge urge to build without looking around first. I am guilty of this myself. When I started on dela [0], I didn't know about 2 alternatives to it; I only learned about them through comments.

[0] https://github.com/aleyan/dela

4. 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