Skip to content

Commit

Permalink
Update docs, add basic FAQ section
Browse files Browse the repository at this point in the history
  • Loading branch information
rafales committed Dec 31, 2022
1 parent eff0de0 commit d1eed59
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ And that's pretty much it. You can `push_js`/`push_css`/`push_preload` from anyw

* Supports scripts, styles and preload directives
* Works with Jinja2
* Can be used outside of templates too
* if you want to render a custom (form) widget for example
* Can be used from Python code too
* simply use `head_context.push_js/push_css/push_preload` from Python code
* it needs to run during template rendering though (otherwise it wouldn't make sense)
* useful if you have form widget rendering written in Python for example
* or basically any kind of rendering written in Python


## Installation and setup

Expand Down Expand Up @@ -80,3 +84,10 @@ def create_app():
return app

```

## FAQ

### Does this work with `asyncio`?

`head-context` uses `contextvars` under the hood, which are compatible with `asyncio` but it integrates with `Jinja` in a way that won't work with templates which use `asyncio` rendering. If you have any good ideas how to make it work a PR would be welcome.

0 comments on commit d1eed59

Please sign in to comment.