chainlit
chainlit copied to clipboard
Use Jinja2 template for index.html instead of placeholders
trafficstars
The current index.html uses custom placeholders for search and replace rather than a standardised template language.
Advantages
- Make the code more accessible to developers, they already know the language and so does their editor.
- Because of 1, will make it easier to extend the templates, e.g. allowing to add headers or parameters.
- Increase performance and security -- search and replace is really not the best way to do templating.
Question
Are there any reasons for not using Jinja2 or other production-grade templates?
Happy to contribute
I am happy to make a PR to this extend, my eventual goal being to allow injection of arbitrary headers -- but doing the template well seems a smell effort on the road. This ticket is to discuss the details before I'll make a go at it.
PS
❤️ ❤️ ❤️ chainlit. Great work, thanks for the Open Source love!