Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Jinja2 template for index.html instead of placeholders #1091

Open
dokterbob opened this issue Jun 21, 2024 · 0 comments
Open

Use Jinja2 template for index.html instead of placeholders #1091

dokterbob opened this issue Jun 21, 2024 · 0 comments

Comments

@dokterbob
Copy link

dokterbob commented Jun 21, 2024

The current index.html uses custom placeholders for search and replace rather than a standardised template language.

Advantages

  1. Make the code more accessible to developers, they already know the language and so does their editor.
  2. Because of 1, will make it easier to extend the templates, e.g. allowing to add headers or parameters.
  3. 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant