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

Consider jinja2-based Google Docs generation #112

Open
jpmckinney opened this issue Jan 21, 2023 · 0 comments
Open

Consider jinja2-based Google Docs generation #112

jpmckinney opened this issue Jan 21, 2023 · 0 comments

Comments

@jpmckinney
Copy link
Member

jpmckinney commented Jan 21, 2023

I had the idea early on to adapt jinja2, so that we can use its syntax, and the main thing we'd have to do is change how include and block (and probably some more logic) work.

A first (simple) step would be to change the tag syntax to conform to jinja2 (we can add backwards-compatibility, so that we don't need to rewrite all the templates right away – deprecation warnings can be bubbled up similar to failed_tags). Then, whether or not we switch the backend over, the frontend will remain the same.

Some Jinja2 benefits:

  • For-loops and if-statements for controlling output (e.g. if no quality issue, don't print failures...)

Some possible hiccups:

  • Sub-templates build the context by querying the database. As I understand, Jinja2 passes in a context to the main template. We might be able to carry over our approach, but I don't know yet.

The current system (post-refactor) is pretty good, code-wise. We should only progress this issue if we need new features that might be quicker and easier to implement via Jinja2.

@jpmckinney jpmckinney added this to the Cleanup milestone Jan 21, 2023
@jpmckinney jpmckinney removed this from the Cleanup milestone Jan 25, 2023
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