NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #1627 most downloaded on crates.io
a powerful template engine for Rust with minimal dependencies
Last release 3 days ago
04 Oct 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
5 years old
117 releases · first in 2021
One column per quarter.
Moved the trim_blocks , lstrip_blocks and keep_trailing_newline settings from Environment into SyntaxConfig . SyntaxConfig::builder , Environment::set
trim_blocks, lstrip_blocks and keep_trailing_newline settings from Environment into SyntaxConfig. SyntaxConfig::builder, Environment::set_syntax and Environment::syntax are now available without the custom_syntax feature, and SyntaxConfig::to_builder was added to modify an existing configuration. Template introspection via Template::undeclared_variables now honors the whitespace settings. #470AutoEscape::Custom to hold a Cow<'static, str> so custom auto escape formats can be determined at runtime. AutoEscape is no longer Copy and State::auto_escape now returns a reference. The Python bindings no longer leak custom auto escape names.list, join or sort, the in operator and serialization processed them like other items. The new ValueIter::checked helper provides the same behavior for custom code.TemplateSource with an up-to-date check in addition to a plain String, and the environment re-invokes the loader when a template is looked up that is no longer up to date. path_loader attaches a check based on the file's modification time and size. Auto reloading is enabled by default and can be disabled with Environment::set_auto_reload. Templates are reloaded through a shared reference so the environment no longer needs to be recreated or guarded by a lock. The memo-map dependency was removed. #819minijinja-autoreload crate. Templates loaded via path_loader are now reloaded automatically and environments no longer need to be guarded by a lock to reload. See UPDATING.md for migration instructions.deserialization feature. Deserialization support is now part of the serde feature.json feature no longer depends on serde and serde_json. The tojson filter and JSON auto escaping now use a built-in JSON serializer. Invalid values now fail the serialization rather than being emitted as null. Floats are formatted like recent versions of serde_json do (for instance 1e+16 instead of 1e16). The speedups feature now uses zmij and itoa to format numbers in JSON; the output is the same without it.curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/3.0.0-alpha.3/minijinja-cli-installer.sh | shpowershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/3.0.0-alpha.3/minijinja-cli-installer.ps1 | iex"| File | Platform | Checksum |
|---|---|---|
| minijinja-cli-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| minijinja-cli-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| minijinja-cli-aarch64-pc-windows-msvc.zip | ARM64 Windows | checksum |
| minijinja-cli-i686-pc-windows-msvc.zip | x86 Windows | checksum |
| minijinja-cli-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| minijinja-cli-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| minijinja-cli-i686-unknown-linux-gnu.tar.xz | x86 Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |
| minijinja-cli-armv7-unknown-linux-gnueabihf.tar.xz | ARMv7 Linux | checksum |
| minijinja-cli-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| minijinja-cli-i686-unknown-linux-musl.tar.xz | x86 MUSL Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |
Fixed large Python integers within MiniJinja's native integer range being silently rounded through f64 conversion. #944
f64 conversion. #944and and or expressions returning booleans instead of preserving their operands. #945round filter to use round-half-even semantics and fixed decimal rounding edge cases in Rust and Go. #948sequence test to classify undefined values as sequences in Rust and Go. #951upper and lower tests to reject non-strings and handle titlecase characters correctly in Rust and Go. #952curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/3.0.0-alpha.2/minijinja-cli-installer.sh | shpowershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/3.0.0-alpha.2/minijinja-cli-installer.ps1 | iex"| File | Platform | Checksum |
|---|---|---|
| minijinja-cli-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| minijinja-cli-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| minijinja-cli-aarch64-pc-windows-msvc.zip | ARM64 Windows | checksum |
| minijinja-cli-i686-pc-windows-msvc.zip | x86 Windows | checksum |
| minijinja-cli-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| minijinja-cli-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| minijinja-cli-i686-unknown-linux-gnu.tar.xz | x86 Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |
| minijinja-cli-armv7-unknown-linux-gnueabihf.tar.xz | ARMv7 Linux | checksum |
| minijinja-cli-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| minijinja-cli-i686-unknown-linux-musl.tar.xz | x86 MUSL Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |
Switched minijinja-contrib date and time filters from time / time-tz to Jiff. Custom formats now use strftime -style syntax instead of time format des
minijinja-contrib date and time filters from time/time-tz to Jiff. Custom formats now use strftime-style syntax instead of time format descriptions. #694Environment.SetUnknownMethodCallback to the Go port. #934title filter treating every ASCII punctuation character as a word boundary in Rust and Go. Words now start after whitespace or one of -, (, {, [ and < as in Jinja2, so "don't"|title renders as Don't instead of Don'T. #930loop.changed() always reporting a change in the Go port. #936curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/3.0.0-alpha.1/minijinja-cli-installer.sh | shpowershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/3.0.0-alpha.1/minijinja-cli-installer.ps1 | iex"| File | Platform | Checksum |
|---|---|---|
| minijinja-cli-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| minijinja-cli-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| minijinja-cli-aarch64-pc-windows-msvc.zip | ARM64 Windows | checksum |
| minijinja-cli-i686-pc-windows-msvc.zip | x86 Windows | checksum |
| minijinja-cli-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| minijinja-cli-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| minijinja-cli-i686-unknown-linux-gnu.tar.xz | x86 Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |
| minijinja-cli-armv7-unknown-linux-gnueabihf.tar.xz | ARMv7 Linux | checksum |
| minijinja-cli-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| minijinja-cli-i686-unknown-linux-musl.tar.xz | x86 MUSL Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |
chore(release): 3.0.0-alpha.0
chore(release): 3.0.0-alpha.0
State the canonical path for functions, filters, tests, objects, methods, formatters, and nested macro calls. Read-only typed callbacks can continue to use &State; state mutation and dynamic calls now require &mut State. Added typed render-local extensions that persist through includes, blocks, and macros.State::get_or_set_temp_object; use typed render-local extensions instead of object wrappers and interior mutability.Template::render_and_return_state, Template::render_to_write, Template::eval_to_state, the Filter, Test, TestResult, and ViaDeserialize aliases, value::intern, and the no-op key_interning feature. The no-op loader feature was also removed; loader APIs remain available unconditionally.serde optional, explicit, and disabled by default. Rendering APIs now accept Into<Value>; enable the feature and use the value::Serde wrapper for Serde conversion. Disabling the feature fully removes the dependency and no longer substitutes a fallback serialization trait. #528tojson to use Jinja2-compatible separator spacing. #785/v2 to /v3.semi_strict undefined behavior spelling.context! and args! to consume values and convert exclusively through Into<Value>; wrap Serde values in value::Serde.Value::from_pairs. Collecting pairs directly into Value now creates a sequence of tuples rather than a map.ViaDeserialize with the unified value::Serde adapter for both explicit serialization and function argument deserialization.Value function arguments to reject implicit keyword-argument values. Variadic functions that intentionally capture them can use ValueOrKwargs. #596Added the wordwrap filter to the Python bindings. #885
wordwrap filter to the Python bindings. #885context! sorting keys when the preserve_order feature is enabled. #920curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/2.24.0/minijinja-cli-installer.sh | shpowershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/2.24.0/minijinja-cli-installer.ps1 | iex"| File | Platform | Checksum |
|---|---|---|
| minijinja-cli-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| minijinja-cli-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| minijinja-cli-aarch64-pc-windows-msvc.zip | ARM64 Windows | checksum |
| minijinja-cli-i686-pc-windows-msvc.zip | x86 Windows | checksum |
| minijinja-cli-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| minijinja-cli-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| minijinja-cli-i686-unknown-linux-gnu.tar.xz | x86 Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |
| minijinja-cli-armv7-unknown-linux-gnueabihf.tar.xz | ARMv7 Linux | checksum |
| minijinja-cli-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| minijinja-cli-i686-unknown-linux-musl.tar.xz | x86 MUSL Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |
Fixed Unicode identifiers in templates rendered through the Python bindings.
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/2.23.0/minijinja-cli-installer.sh | shpowershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/2.23.0/minijinja-cli-installer.ps1 | iex"| File | Platform | Checksum |
|---|---|---|
| minijinja-cli-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| minijinja-cli-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| minijinja-cli-aarch64-pc-windows-msvc.zip | ARM64 Windows | checksum |
| minijinja-cli-i686-pc-windows-msvc.zip | x86 Windows | checksum |
| minijinja-cli-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| minijinja-cli-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| minijinja-cli-i686-unknown-linux-gnu.tar.xz | x86 Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |
| minijinja-cli-armv7-unknown-linux-gnueabihf.tar.xz | ARMv7 Linux | checksum |
| minijinja-cli-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| minijinja-cli-i686-unknown-linux-musl.tar.xz | x86 MUSL Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |
Changed rendering of none and boolean values to None , True , and False for Jinja2 compatibility in Rust and Go. #913
None, True, and False for Jinja2 compatibility in Rust and Go. #913StringInput for custom Rust filters and functions that transform strings while preserving safety provenance.split filter to return a sequence, enabling negative indexing and slicing in Rust and Go. #909curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/2.22.0/minijinja-cli-installer.sh | shpowershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/2.22.0/minijinja-cli-installer.ps1 | iex"| File | Platform | Checksum |
|---|---|---|
| minijinja-cli-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| minijinja-cli-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| minijinja-cli-aarch64-pc-windows-msvc.zip | ARM64 Windows | checksum |
| minijinja-cli-i686-pc-windows-msvc.zip | x86 Windows | checksum |
| minijinja-cli-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| minijinja-cli-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| minijinja-cli-i686-unknown-linux-gnu.tar.xz | x86 Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |
| minijinja-cli-armv7-unknown-linux-gnueabihf.tar.xz | ARMv7 Linux | checksum |
| minijinja-cli-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| minijinja-cli-i686-unknown-linux-musl.tar.xz | x86 MUSL Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |
Fixed a panic when comparing two numbers that have no common lossless representation, such as a float against an integer that cannot be represented ex
f64 (for example 1.0 < 9007199254740993). #904curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/2.21.0/minijinja-cli-installer.sh | shpowershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/2.21.0/minijinja-cli-installer.ps1 | iex"| File | Platform | Checksum |
|---|---|---|
| minijinja-cli-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| minijinja-cli-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| minijinja-cli-aarch64-pc-windows-msvc.zip | ARM64 Windows | checksum |
| minijinja-cli-i686-pc-windows-msvc.zip | x86 Windows | checksum |
| minijinja-cli-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| minijinja-cli-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| minijinja-cli-i686-unknown-linux-gnu.tar.xz | x86 Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |
| minijinja-cli-armv7-unknown-linux-gnueabihf.tar.xz | ARMv7 Linux | checksum |
| minijinja-cli-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| minijinja-cli-i686-unknown-linux-musl.tar.xz | x86 MUSL Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |
Added support for Jinja-style required blocks in Rust and Go, including scoped required parsing compatibility and validation that required blocks only
required blocks in Rust and Go, including scoped required parsing compatibility and validation that required blocks only contain whitespace or comments.a < b < c) in Rust and Go to match Jinja/Python semantics.foo.0.bar) for Jinja compatibility. #900multi_template disabled by gating block-only APIs behind the feature.curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/2.20.0/minijinja-cli-installer.sh | shpowershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/2.20.0/minijinja-cli-installer.ps1 | iex"| File | Platform | Checksum |
|---|---|---|
| minijinja-cli-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| minijinja-cli-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| minijinja-cli-aarch64-pc-windows-msvc.zip | ARM64 Windows | checksum |
| minijinja-cli-i686-pc-windows-msvc.zip | x86 Windows | checksum |
| minijinja-cli-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| minijinja-cli-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| minijinja-cli-i686-unknown-linux-gnu.tar.xz | x86 Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |
| minijinja-cli-armv7-unknown-linux-gnueabihf.tar.xz | ARMv7 Linux | checksum |
| minijinja-cli-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| minijinja-cli-i686-unknown-linux-musl.tar.xz | x86 MUSL Linux | checksum |
| minijinja-cli-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |
Fixed strict undefined behavior for comparison operators (such as ==), string concatenation (~), and undefined needles in the in operator to better ma
==), string concatenation (~), and undefined needles in the in operator to better match Jinja2. #886 #888default filter in strict undefined mode so an explicitly passed undefined fallback argument errors instead of being treated like a missing argument. #887Deprecated render_and_return_state, eval_to_state, and render_to_write in favor of the new render_captured / render_captured_to / Captured API.
width, first, blank) to the indent filter for Jinja2 compatibility in Rust and Go. #864foo.0) in Rust and Go for Jinja compatibility. #881foo . bar . baz) for Jinja compatibility. #879\s) for Jinja compatibility in Rust and Go. #880minijinja-cabi ownership and pointer-safety issues that could leak mj_value
values on error paths.minijinja-cabi APIs for callback-based functions/filters/tests,
globals, loaders, path joining, auto-escape configuration, and fuel limits.minijinja-cabi header maintenance to manual source-based syncing and
removed cbindgen-based generation tooling.minijinja-cabi (via make -C minijinja-cabi test)
with coverage across all exported C ABI functions, and wired them into top-level
testing and CI.render_captured and render_captured_to methods on Template which
return a Captured type holding the rendered output and the template state.into_output method on Captured to consume and return the output string.render_and_return_state, eval_to_state, and render_to_write
in favor of the new render_captured / render_captured_to / Captured API.Re-release of 2.17.0 to fix release automation.
Added 'c' (character) format type support for format filters and str.format-style formatting. #868
'c' (character) format type support for format filters and str.format-style formatting. #868minijinja-cli release targets for aarch64-pc-windows-msvc (Windows ARM64) and armv7-unknown-linux-gnueabihf.Rest<String> and Vec<String> conversions. #877maturin by moving stripping from global config to release wheel build arguments.Added musllinux wheel builds for Python release artifacts.
|escape to honor custom formatters. #861keys and values filters from the Go port for parity. #863Re-release of 2.15.0 because of a bad release.
Added py.typed marker for PEP 561 typing support in Python bindings. #853
py.typed marker for PEP 561 typing support in Python bindings. #853map.get() method in pycompat. #852|sort filter when using reverse=true. #856SemiStrict undefined mapping in Python bindings. #859Added support for tuple unpacking in {% set %} statements. #847
{% set %} statements. #847Added multi-key support to the |sort filter. #827
|sort filter. #827format filter and str.format method for pycompat. #835not undefined with strict undefined behavior. #838setLoader and setPathJoinCallback to the JavaScript bindings. #842Item or attribute lookup will no longer swallow all errors in Python. #814
|zip filter. #818break_on_hyphens for the |wordwrap filter. #823unknown_method_callback. #824.jinja and .jinja2 as extensions in auto escape. #832Fixed incorrect joining of leading undefineds or empty strings in the |join filter. This was inconsistent with Jinja2 and the filter itself for undefi
|join filter. This was inconsistent with
Jinja2 and the filter itself for undefineds in other
positions. #794range function and change
range to isize. #799isize as argument type. #799\x escape sequences in strings
as well as octals. #805|chain filter. #807Fixed an issue with the function bounds that caused the next-generation trait resolver to fail. #787
Re-release of 2.10.0 because of a broken release process.
Nothing published for this version
Fix incorrect permissions when --output is used in the CLI. #772
--output is used in the CLI. #772mj_err_get_debug_info to the C-ABI. #775{% import 'template.j2' as x %} and you
then render {{ x }} the output of template.j2 is rendered as
if it was included. #778Do not panic if too large templates (too many lines or too many columns) are loaded. The error reporting will be wrong in those cases but the template
merge_maps which is a dynamic version of the context!
merge feature, and fixed enumeration behavior when non-map objects
are attempted to be merged. #745mj_value_new_bytes to the C-ABI. #749mj_value_as_bytes to the C-ABI to borrow from strings or
byte values. #750mj_err_get_detail and mj_err_get_template_name. These
did not work correctly. To fix them the return value now needs to be
freed. #754AtomicU64 is
not available in minijinja-contrib. #755with context and without context for
imports. #759default filter is now also registered as d for Jinja2
compatibility. #763default filter now accepts a second argument to enable lax
defaulting. #764striptags filter to the contrib module. #765pycompat by default for the Python bindings and register
the default contrib filters and tests. #767Added SemiStrict undefined mode that is like strict but allows to be checked for truthiness. Additionally an if expression without an else block will
SemiStrict undefined mode that is like strict but allows
to be checked for truthiness. Additionally an if expression without
an else block will always produce a silent undefined object that
never errors for compatibility with Jinja2. #687ViaDeserialize stricter. Now the type
can only be constructed if the type implements DeserializeOwned.
This is not a new requirement for passing the function to
add_function but bad code will now error earlier for better
error reporting. #689rand module. #696Environment.undeclared_variables_in_template and
Environnent.undeclared_variables_in_str to Python binding. #699loop_controls for Python in-line with the CLI. #704Object::custom_cmp to allow objects to influence how they
compare against themselves. This also fixes Python objects in the
Python binding not to compare correctly. #707undeclared_variables would incorrectly handle
variables referenced by macros. #714__bool__ correctly now for custom
objects in if-conditions and filters. #719}} caused a syntax error in expressions with
open parentheses, braces or brackets. #723State::known_variables to return a list of known variables
and Environment::globals. #724caller. #725Filters and Tests traits. They remain as
hidden aliases to Function. #726load_from_path to python. #736loop.nextitem is now a lazy operation. This prevents issues when iterating over one-shot iterators combined with {% break %} and it now ensures that t
loop.nextitem is now a lazy operation. This prevents issues when
iterating over one-shot iterators combined with {% break %} and
it now ensures that the iterator is not running "one item ahead". #677serde_yml to serde_yaml. #684Added truncate filter to minijinja-contrib. #647
sum filter. #648truncate filter to minijinja-contrib. #647wordcount filter to minijinja-contrib. #649wordwrap filter to minijinja-contrib. #651unsafe code block from the Kwargs type internally
which was probably unsafe. #659Value::make_object_map to create projections from object
into maps, similar to how it was already possible to create
iterators that were projected from objects. #663|items filter will no longer allocate a list and instead
return an iterator. #665lstrip_blocks to act too eager. #674minijinja-cli now supports preservation of order in maps. #611
minijinja-cli now supports preservation of order in maps. #611minijinja-cli. #611lines filter to split a string into lines.Value::from_bytes without having to go via serde, and they are now
producing a nicer looking debug output. #616string filter from Jinja2. #617minijinja-cli now allows the template name to be set to an empty
string when --template is used, to allow suppliying a data file. #624sameas filter from Jinja2. #6251 is sameas 1). #626minijinja-cli now has all features enabled by default as documented
(that means also shell completion and ini). #633minijinja-cli now does not convert INI files to lowercase anymore. This was
an unintended behavior. #633*args for variable args and **kwargs
for keyword arguments) and fixed a bug where sometimes maps and keyword
arguments were created in inverse order. #642Updated version of minijinja-cli with support for better documentation, config file and environment variable support. #602
minijinja-cli with support for better documentation,
config file and environment variable support. #602minijinja-cli now supports template source passed by parameter for
simple cases. #606minijinja-cli now has a --syntax-help argument that prints out the
primer on the syntax. #607minijinja-cli now installs to ~/.local/bin by default. #608String/Cow<str> argument types will no longer implicitly convert
keyword arguments to string form. This was an unintended foot gun. #605Fixes a regression in PartialEq / Eq in Value caused by changes in 2.3.0. #584
PartialEq / Eq in Value caused by changes
in 2.3.0. #584Fixes some compiler warnings in Rust 1.81. #575
groupby filter. #570unique filter now is case insensitive by default like in
Jinja2 and supports an optional flag to make it case sensitive.
It also now lets one check individual attributes instead of
values. #571Ord to avoid accidentally non total order
that could cause panics on Rust 1.81. #579Value::is_integer method to allow a user to tell floats
and true integers apart. #580Fixes a bug where some enums did not deserialize correctly when used with ViaDeserialize. #554
ViaDeserialize. #554IntoDeserializer for Value and &Value. #555filesizeformat to minijinja-contrib. #556loop_controls feature which adds
{% break %} and {% continue %}. #558Flush filter and test cache when processing extended template. This fixes a bug that caused the wrong filters to be used in some cases. #551
Added indent parameter to tojson filter. #546
indent parameter to tojson filter. #546randrange, lipsum, random, cycler and joiner to
minijinja-contrib. #547&T and Arc<T> as parameters
to filters and functions if T is an Object. #548minijinja-cli now also enables the datetime, timezone and rand features. #549int filter closer to Jinja2. #549minijinja-cli now supports .ini files. #532
.ini files. #532self_cell to 1.0.4. #540serde feature is disabled. This is in
anticipation of removing the serde dependency in the future. #541State::resolve. It now can resolve the
initial template context in macro calls even if no closure has been
created. #542Added new methods to pycompat: str.endswith, str.rfind, str.isalnum, str.isalpha, str.isascii, str.isdigit, str.isnumeric, str.join, str.startswith. #
str.endswith, str.rfind,
str.isalnum, str.isalpha, str.isascii, str.isdigit,
str.isnumeric, str.join, str.startswith. #522boolean, divisibleby, lower and upper. #592Implemented sequence (+ some iterator) and string repeating with the * operator to match Jinja2 behavior. #519
*
operator to match Jinja2 behavior. #519minijinja::pycompat module which allows one to register
an unknown method callback that provides most built-in Python methods.
This makes things such as dict.keys work. Also adds a new
--py-compat flag to minijinja-cli that enables it. This improves
the compatibility with Python based templates. #521|split filter that works like the .split method in Python. #517Fixed an issue that caused custom delimiters to not work in the Python binding. #506
This is a major update to MiniJinja that changes a lot of core internals and cleans up some APIs. In particular it resolves some limitations in the en
This is a major update to MiniJinja that changes a lot of core internals and cleans up some APIs. In particular it resolves some limitations in the engine in relation to working with dynamic objects, unlocks potentials for future performance improvements and enhancements.
It's very likely that you will need to do changes to your code when upgrading, particular when implementing dynamic objects. In short:
StructObject and SeqObject are gone. They have been replaced by improved
APIs directly on Object. Please refer to the updated documentation to see
how these objects behave now. For the most part code should become quite a bit
clearer during the upgrade.ObjectKind has been replaced by ObjectRepr. Rather than holding a reference
to a StructObject or SeqObject this now is a simple enum that just indicates
how that object serializes, renders and behaves.Object no longer uses fmt::Display for rendering. Instead the new
Object::render method is used which has a default implementation.Object trait has been completely transformed and the new type-erased type
DynObject has been added to work with unknown objects. This trait has an
improved user experience and more flexibility. It's now possible to implement
any non-primitive value type including maps with non string keys which was previously
not possible.ValueKind is now non exhaustive and got a log of new value types. This resolves
various issues in particular in relationship with iterators. As a result of this
functions will no longer accidentally serialize into empty objects for example.Value::from_iterator has been replaced by the new Value::make_iterable,
Value::make_object_iterable and Value::make_one_shot_iterator. The direct
replacement is Value::make_one_shot_iterator but for most uses it's strongly
recommended to use one of the other APIs instead. This results in a much improved
user experience as it's possible to iterate over such values more than once.Syntax type has been replaced by the SyntaxConfig type. It uses a builder
pattern to reconfigure the delimiters.For upgrade instructions read the UPDATING guide.
Other Changes:
Environment::templates method that iterates over loaded templates. #471Value::try_iter now holds a reference
to the Value internally via reference counting.DynObject now replaces Arc<Object>.iterable test. #475Value::from_serializable is now Value::from_serialize.Value::from is now implemented for Error as public API to create invalid values.
Previously this behavior was hidden internally in the serde support. #495UndefinedBehavior::Strict now acts more delayed. This means that now value.key is defined will no longer fail.--syntax to reconfigure syntax flags such as delimiters. #504Nothing published for this version
Fixed an issue with the function bounds that caused the next-generation trait resolver to fail. #790
Fixed an issue where lstrip_blocks unintentionally also applied to variable expression blocks. #502
lstrip_blocks unintentionally also applied to
variable expression blocks. #502Added support for implicit string concatenation for Jinja2 compatibility. #489
Deprecated Value::from_iterator and introduced replacement Value::make_one_shot_iterator API which also exists in 2.x. #487
Value::from_iterator and introduced replacement
Value::make_one_shot_iterator API which also exists in 2.x. #487Fixed an endless loop in undeclared_variables. #486
undeclared_variables. #486Deprecated Value::from_serializable for the improved replacement method Value::from_serialize. #482
Option<Into<Value>> as return value from
functions. #452Value::from_serializable for the improved replacement
method Value::from_serialize. #482Tolerate underscores in number literals. #443
trim_blocks and lstrip_blocks for Jinja2
compatibility. #447unstable_machinery. The tokenize function got an
extra argument for the WhitespaceConfig. It's however recommended
to use the new Tokenizer struct instead. parse_expr was added,
the parse function now takes a SyntaxConfig and WhitespaceConfig. #447Resolved a compiler warning for Rust 1.77. #440
call_method. Now UnknownMethod
is returned instead of InvalidOperation correctly. #439Environment::set_unknown_method_callback which allows a user
to intercept method calls on primitives. The motivation here is that
this can be used to implement python like methods to improve the
compatibility with Jinja2 Python templates. #441Fixed a bug with broken closure handling when working with nested {% macro %} or {% call %} blocks. #435
{% macro %} or {% call %} blocks. #435minijinja-cli now supports an -o or --output parameter to write into a target file. #405
minijinja-cli now supports an -o or --output parameter to write
into a target file. #405minijinja-cli now accepts the --safe-path parameter to disallow
includes or extends from paths not explicitly allowlisted. #432Error::display_debug_info which displays just the
debug info, same way as alternative display on the error does. #420namespace() function from Jinja2 and the ability to assign
to it via {% set %}. #422minijinja-autoreload now supports on_should_reload_callback which
lets one register a callback to be called just before an auto reload
should be performed. #424Value::from_iterator, IteratorObject and
ObjectKind::Iterator. #4260b/0o/0x prefixed integer literals for
binary, octal and hexadecimal notation. #433The urlencode filter now correctly skips over none and undefined. #394
urlencode filter now correctly skips over none and undefined. #394dict function now supports merging in of extra arguments. #395Added Environment::compile_expression_owned to allow compiled expressions to be held without requiring a reference. #383
Environment::compile_expression_owned to allow compiled expressions
to be held without requiring a reference. #383minijinja-embed crate which provides a simple way to embed templates
directly in the binary. #392Added int and float filters. #372
int and float filters. #372integer and float tests. #373repl feature
was disabled. #374-n / --no-newline option to CLI. #375Fixed a memory leak involving macros. Previously using macros was leaking memory due to an undetected cycle. #359
debug function in templates can now also be used to print out
the debug output of a variable. #356stacker feature which allows raising of the recursion
limits. It enables monitoring of the call stack via stacker
and automatically acquires additional memory when the call stack
runs out of space. #354Large integer literals in templates are now correctly handled. #353
Value::downcast_object_ref /
Object::downcast_ref / Object::is and added support for downcasting
of types that were directly created with Value::from_seq_object
and Value::from_struct_object. #349Added support for keep_trailing_newlines which allows you to disable the automatic trimming of trailing newlines. #334
keep_trailing_newlines which allows you to disable
the automatic trimming of trailing newlines. #334minijinja-cli which lets you render and debug templates from
the command line. #331Value::UNDEFINED and Value::from(()) is now
undefined and none rather than Undefined and None. This was
an accidental inconsistency.Environment::set_path_join_callback and State::get_template
to support path joining. This is for greater compatibility with Jinja2
where path joining was overridable. With this you can configure the
engine so that paths used by include or extends can be relative to
the current template. #328.html.j2 as alias for
.html as well as for all other choices. In general .j2 as an extension
is now generally supported.Fixed iso datetime formatting not handling negative offsets correctly. #327
Value directly from the crate root for convenience.deserialize from a Value. Additionally the
ViaDeserialize<T> argument type was added to support value conversions
via serde as argument type. #325Added the ability to merge multiple values with the context! macro.
context!
macro. (#317)Option<T> now accepts none in filters. Previously only
undefined values were accepted. This bugfix might have a minor impact
on code that relied in this behavior. (#320)minijinja-contrib if the timezone
feature is not enabled.Added the args! macro which can be used to create an argument slice on the stack.
args! macro which can be used to create an argument
slice on the stack. (#311)chrono support to the time filters in the minijinja-contrib crate.Your coding agent can read these notes before it upgrades. Set up the MCP server →