You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZeroIntensity opened this issue
May 5, 2024
· 0 comments
Labels
apiThis has to do with the Python API (view)complexThis should only be looked at by someone who knows what they're doingdelayedDelayed due to another issuefeatureNew feature
Jinja2 is quite popular when it comes to Python templating. It lets you integrate Python into your HTML with syntax that looks kind of like:
<p>Hello, {{ world }}</P>
Personally, I don't think this syntax is very pretty - but that's not really up for me to decide. Jinja support was added in #126. However, theoretically, with some black magic at runtime, Python code itself could be used to take Jinja variables. This could integrate nicely with #12, whenever that gets done.
This could then be used from Jinja templates, somehow:
env.render_template("app/index.py") # Very speculative, I'm not sure if Jinja would even allow this
This feature would allow for some nice, easy integration with tools that require Jinja, such as MkDocs. If doing it through render_template isn't possible, maybe Jinja has some way to call Python files, and view.py could mess around with the stack to get the scope?
The text was updated successfully, but these errors were encountered:
apiThis has to do with the Python API (view)complexThis should only be looked at by someone who knows what they're doingdelayedDelayed due to another issuefeatureNew feature
Proposal:
Jinja2 is quite popular when it comes to Python templating. It lets you integrate Python into your HTML with syntax that looks kind of like:
Personally, I don't think this syntax is very pretty - but that's not really up for me to decide. Jinja support was added in #126. However, theoretically, with some black magic at runtime, Python code itself could be used to take Jinja variables. This could integrate nicely with #12, whenever that gets done.
I'm thinking it could look something like:
This could then be used from Jinja templates, somehow:
This feature would allow for some nice, easy integration with tools that require Jinja, such as MkDocs. If doing it through
render_template
isn't possible, maybe Jinja has some way to call Python files, and view.py could mess around with the stack to get the scope?The text was updated successfully, but these errors were encountered: