diff --git a/CHANGELOG.md b/CHANGELOG.md index b2202fab..ec61a46a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,12 @@ All notable changes to MiniJinja are documented here. - Improve error reporting for failures in blocks and trying to `super()` when there is no parent block. - Performance improvements. +- Added support for `{% import %}` / `{% from .. import .. %}` + and `{% macro %}`. (#123) +- Added `Value::is_kwargs` which disambiugates if an object passed + to a function or filter is a normal object or if it represents + keyword arguments. +- Added the ability to call functions stored on objects. # 0.22.1 diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index d6ec57f4..7f1e05b5 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -38,6 +38,10 @@ mapping them to filter functions is tricky. This also means that some filters i MiniJinja do not accept the parameters with keyword arguments whereas in Jinja2 they do. +### Variadic Calls + +MiniJinja does not support the `*args` and `**kwargs` syntax for calls. + ### Undefined The Jinja2 undefined type tracks the origin of creation, in MiniJinja the undefined @@ -87,14 +91,19 @@ MiniJinja is different as mentioned above. ### `{% import %}` -This tag is currently not supported. If support for macros is added -this would make sense to add. +This tag is supported but the returned item is a map of the exported local +variables. This means that the rendered content of the template is lost. ### `{% macro %}` -This tag is currently not supported. +The macro tag works very similar to Jinja2 but with some differences. Most +importantly the special `caller`, `varargs` and `kwargs` arguments are not +supported. The external introspectable attributes `catch_kwargs`, `catch_varargs` +and `caller` are not supported. + +### `{% call %}` -**Tracking issue:** [#44](https://github.com/mitsuhiko/minijinja/issues/44) +This tag is not supported. ### `{% with %}` diff --git a/Makefile b/Makefile index dc2b6f75..0ef6fcdc 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ build: @cargo build --all doc: - @cd minijinja; RUSTC_BOOTSTRAP=1 RUSTDOCFLAGS="--cfg=docsrs --html-in-header doc-header.html" cargo doc --all --no-deps --features=$(DOC_FEATURES) + @cd minijinja; RUSTC_BOOTSTRAP=1 RUSTDOCFLAGS="--cfg=docsrs --html-in-header doc-header.html" cargo doc -p minijinja -p minijinja-autoreload --no-deps --features=$(DOC_FEATURES) test: @$(MAKE) run-tests FEATURES=$(TEST_FEATURES) diff --git a/doc-header.html b/doc-header.html index aaa01395..49c60eb8 100644 --- a/doc-header.html +++ b/doc-header.html @@ -4,7 +4,7 @@