jinja
jinja copied to clipboard
A very fast and expressive template engine.
Explain why the `PackageLoader` failed when the `package_path` directory is missing. - fixes #1705 Checklist: - [ ] Add tests that demonstrate the correct behavior of the change. Tests should...
When following [the basics of setting up jinja2](https://jinja.palletsprojects.com/en/3.1.x/api/#basics), if you don't create the appropriate `templates` directory in your package, you get this error message: ``` ValueError: The 'mypackage' package was...
- fixes #1701 Checklist: - [ ] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change. - [ ] Add or update relevant...
```python import jinja2 from jinja2.nativetypes import NativeEnvironment NativeEnvironment().from_string('{% block test %}{% for i in range(1) %}{{ loop.index }}{% endfor %}{% endblock %}{{ self.test() }}').render() ``` ``` Traceback (most recent call...
- fixes #1377 Checklist: - [x] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change. - [x] Add or update relevant docs, in...
The `ModuleLoader` example seems copy pasted from `ChoiceLoader`. As a result it's not immediately clear how their API differ. Checklist: - [x] Add tests that demonstrate the correct behavior of...
- fixes #1687 #1688 Additionaly: - changes `newline_re` so that it doesn't have group and doesn't require `[::2]` after `split` - simplified `Tuple[Failure]` to `Failure` - used faster `isspace` instead...
`filename` is provided to `name` arguments in `TemplateSyntaxError` in https://github.com/pallets/jinja/blob/7fb13bf94443f067c74204a1aee368fdf0591764/src/jinja2/lexer.py#L264 Environment: - Python version: 3.10 - Jinja version: 3.2.0.dev
Type of `lexer.Token.value` is `str` but should be `t.Any` as variable with this type that sometimes is `str`, sometimes `int` and sometime `float` is used for this field in https://github.com/pallets/jinja/blob/7fb13bf94443f067c74204a1aee368fdf0591764/src/jinja2/lexer.py#L665...
It seems that macros defined by a child block are not passed in the context sent to imported macros. In the example below, I have a macro which defines 'Foo'....