├── askama ├── README.md ├── deny.toml ├── LICENSE-MIT ├── _typos.toml ├── clippy.toml ├── .rustfmt.toml ├── LICENSE-APACHE ├── tomlfmt.toml └── benches │ └── escape.rs ├── bench-build ├── deny.toml ├── LICENSE-MIT ├── _typos.toml ├── clippy.toml ├── .rustfmt.toml ├── LICENSE-APACHE ├── tomlfmt.toml ├── templates │ ├── hello_world.html │ └── greeting.html ├── run.sh └── Cargo.toml ├── clippy.toml ├── fuzzing ├── _typos.toml ├── clippy.toml ├── deny.toml ├── .rustfmt.toml ├── tomlfmt.toml ├── fuzz │ ├── src │ │ ├── ascii_str.rs │ │ └── html │ │ │ └── html.rs │ ├── artifacts │ │ ├── .gitattributes │ │ ├── derive │ │ │ ├── clusterfuzz-testcase-minimized-derive-4654117948817408 │ │ │ ├── clusterfuzz-testcase-minimized-derive-4793932351602688 │ │ │ ├── clusterfuzz-testcase-minimized-derive-4955521990066176 │ │ │ ├── clusterfuzz-testcase-minimized-derive-5037184261619712 │ │ │ ├── clusterfuzz-testcase-minimized-derive-5064777150038016 │ │ │ ├── clusterfuzz-testcase-minimized-derive-5107711304073216 │ │ │ ├── clusterfuzz-testcase-minimized-derive-5144827852554240 │ │ │ ├── clusterfuzz-testcase-minimized-derive-5353647120908288 │ │ │ ├── clusterfuzz-testcase-minimized-derive-5387873899839488 │ │ │ ├── clusterfuzz-testcase-minimized-derive-5611392537526272 │ │ │ ├── clusterfuzz-testcase-minimized-derive-5780292277436416 │ │ │ ├── clusterfuzz-testcase-minimized-derive-6051930453639168 │ │ │ ├── clusterfuzz-testcase-minimized-derive-6236623325167616 │ │ │ ├── clusterfuzz-testcase-minimized-derive-6380739026550784 │ │ │ ├── clusterfuzz-testcase-minimized-derive-6503980895371264 │ │ │ ├── clusterfuzz-testcase-minimized-derive-6542584430526464 │ │ │ ├── clusterfuzz-testcase-minimized-derive-6573215117017088 │ │ │ ├── clusterfuzz-testcase-minimized-derive-6617490908315648 │ │ │ ├── clusterfuzz-testcase-minimized-derive-6639137261420544 │ │ │ └── clusterfuzz-testcase-minimized-derive-6696196543676416 │ │ └── filters │ │ │ └── minimized-from-b44b4bd1da1759dee0924a8586a6001e80da76fa │ └── fuzz_targets │ │ ├── all.rs │ │ ├── html.rs │ │ ├── derive.rs │ │ ├── filters.rs │ │ └── parser.rs ├── Cargo.toml └── README.md ├── testing ├── LICENSE-MIT ├── _typos.toml ├── clippy.toml ├── deny.toml ├── templates │ ├── no-block.txt │ ├── foo.askama │ ├── foo.html │ ├── foo.jinja │ ├── latex-file.tex │ ├── included │ │ └── fragment.html │ ├── attr.html │ ├── foo.html.askama │ ├── foo.html.jinja │ ├── use-var.txt │ ├── filters.html │ ├── generics.html │ ├── hello.html │ ├── included.html │ ├── composition.html │ ├── filters_join.html │ ├── format.html │ ├── if.html │ ├── invalid_syntax.html │ ├── cycle1.html │ ├── cycle2.html │ ├── nested-attr.html │ ├── rust-macros.html │ ├── let-base.html │ ├── tuple-attr.html │ ├── char-literals │ │ ├── char-literal-1.txt │ │ ├── char-literal-2.txt │ │ ├── char-literal-5.txt │ │ ├── char-literal-3.txt │ │ ├── char-literal-4.txt │ │ ├── char-literal-6.txt │ │ └── char-literal-7.txt │ ├── nested │ │ ├── sub-nested │ │ │ └── included.html │ │ └── included.html │ ├── else.html │ ├── no-block-with-include.txt │ ├── rust-macros-full-path.html │ ├── transclude-there.html │ ├── a_file_that_is_actually_a_folder.html │ │ └── .gitignore │ ├── include_invalid_syntax.html │ ├── let.html │ ├── literals.html │ ├── raw-simple.html │ ├── if-let-shadowing.html │ ├── if-let.html │ ├── no-block-with-include-times-2.txt │ ├── size-parent.txt │ ├── base-decl.txt │ ├── no-block-with-base-template.txt │ ├── else-if.html │ ├── include.html │ ├── raw-ws.html │ ├── extend_and_import.html │ ├── include-base.html │ ├── match-no-ws.html │ ├── include-nested.html │ ├── size-child-super.txt │ ├── import.html │ ├── nested-base.html │ ├── if-let-struct.html │ ├── include-extends-included.html │ ├── leaf-templates │ │ └── includer.html │ ├── option.html │ ├── size-child.txt │ ├── base.html │ ├── child.html │ ├── deep-import-parent.html │ ├── deep-nested-macro.html │ ├── include-extends.html │ ├── raw-complex.html │ ├── block_in_include_partial.html │ ├── let-child.html │ ├── include-macro.html │ ├── macro-self-arg.html │ ├── nested-child.html │ ├── match-literal-num.html │ ├── big-table.html │ ├── let-decl.html │ ├── ranges.txt │ ├── render_in_place.html │ ├── deep-import-child.html │ ├── let-destruct-tuple.html │ ├── nested-for.html │ ├── simple.html │ ├── block_in_include_base.html │ ├── included-macro.html │ ├── literals-escape.html │ ├── macro-import-callexpr.html │ ├── macro-recursion-1.html │ ├── macro-recursion-2.html │ ├── macro-recursion-3.html │ ├── simple-no-escape.txt │ ├── match-literal-char.html │ ├── precedence.html │ ├── if-let-else.html │ ├── match-literal.html │ ├── include-extends-base.html │ ├── match-opt.html │ ├── fragment-base.html │ ├── match-opt-bool.html │ ├── precedence-for.html │ ├── fragment-mid-super.html │ ├── fragment-simple.html │ ├── blocks.txt │ ├── match-enum-or.html │ ├── nested-macro-callexpr.html │ ├── deep-kid.html │ ├── for.html │ ├── fragment-super.html │ ├── fragment-nested-super.html │ ├── fragment-unused-expr.html │ ├── nested-macro.html │ ├── block_in_include_extended.html │ ├── nested-macro-args.html │ ├── rust-macro-args.html │ ├── macro-with-caller.html │ ├── fragment-nested-block.html │ ├── match-option-result-option.html │ ├── macro-call-raw-string-many-hashes.html │ ├── macro-import-str-cmp.html │ ├── macro-no-args.html │ ├── deep-base.html │ ├── for-break-continue.html │ ├── for-range.html │ ├── named-end.html │ ├── macro-import-str-cmp-macro.html │ ├── match-custom-enum.html │ ├── html-base.html │ ├── teams.html │ ├── macro-short-circuit.html │ ├── macro.html │ ├── filter-recursion.html │ ├── let-shadow.html │ ├── deep-mid.html │ ├── operators.html │ ├── num-literals.html │ ├── compare.html │ └── if-coerce.html ├── .rustfmt.toml ├── tomlfmt.toml ├── LICENSE-APACHE ├── jinja2-assumptions │ ├── .python-version │ ├── .gitignore │ ├── README.md │ ├── test.sh │ └── pyproject.toml ├── folder-config.toml │ └── .gitignore ├── test_minimize.toml ├── test_trim.toml ├── delim-too-short.toml ├── issue-128.toml ├── issue-128-2.toml ├── operator-plus-config.toml ├── delim-clash.toml ├── operator-paren-config.toml ├── tests │ ├── ui │ │ ├── no_template_attribute.rs │ │ ├── cycle.rs │ │ ├── cycle2.rs │ │ ├── incorrect_path.rs │ │ ├── union.stderr │ │ ├── no_template_attribute.stderr │ │ ├── ref_deref.rs │ │ ├── empty-match.rs │ │ ├── macro-caller.rs │ │ ├── macro-super.rs │ │ ├── references.rs │ │ ├── duplicated_template_attribute.stderr │ │ ├── filter-recursion.rs │ │ ├── lit_on_assignment_lhs.rs │ │ ├── union.rs │ │ ├── fuzzing.stderr │ │ ├── name_mismatch_endblock.rs │ │ ├── extend.rs │ │ ├── fuzzed_recursion_depth_mul_deref.rs │ │ ├── include-a-folder.rs │ │ ├── name_mismatch_endmacro.rs │ │ ├── json-too-many-args.rs │ │ ├── multiple_extends.rs │ │ ├── break_outside_of_loop.rs │ │ ├── number.rs │ │ ├── pluralize.rs │ │ ├── fuzzing.rs │ │ ├── filter_block_ws.rs │ │ ├── ref_deref.stderr │ │ ├── cycle2.stderr │ │ ├── typo_in_keyword.rs │ │ ├── lit_on_assignment_lhs.stderr │ │ ├── duplicated_template_attribute.rs │ │ ├── loop-fields.rs │ │ ├── block_and_vars.rs │ │ ├── declare.rs │ │ ├── macro-args.stderr │ │ ├── incorrect_path.stderr │ │ ├── macro-args.rs │ │ ├── transclude-missing.rs │ │ ├── extend.stderr │ │ ├── block_and_vars.stderr │ │ ├── loop-fields.stderr │ │ ├── loop_cycle_wrong_argument_count.rs │ │ ├── json-too-many-args.stderr │ │ ├── break_outside_of_loop.stderr │ │ ├── macro-super.stderr │ │ ├── macro-caller.stderr │ │ ├── cycle.stderr │ │ ├── empty-match.stderr │ │ ├── name_mismatch_endblock.stderr │ │ ├── references.stderr │ │ ├── name_mismatch_endmacro.stderr │ │ ├── escape-filter-invalid-kind.rs │ │ ├── multiple_extends.stderr │ │ ├── ambiguous-ws-raw.rs │ │ ├── error_file_path.rs │ │ ├── filter_block_ws.stderr │ │ ├── filter-recursion.stderr │ │ ├── match_with_extra.rs │ │ ├── typo_in_keyword.stderr │ │ ├── macro-caller-with-callexpr.rs │ │ ├── loop_cycle_wrong_argument_count.stderr │ │ ├── match-unit-structs.rs │ │ ├── block_in_filter_block.rs │ │ ├── loop_cycle_empty.rs │ │ ├── macro-caller-with-callexpr.stderr │ │ ├── terminator-operator.rs │ │ ├── fuzzed_recursion_depth_mul_deref.stderr │ │ ├── include-a-folder.stderr │ │ ├── block_in_filter_block.stderr │ │ ├── num-suffix.rs │ │ ├── match_with_extra.stderr │ │ ├── declare.stderr │ │ ├── macro_default_value.rs │ │ ├── vars.rs │ │ ├── no-such-escaper.rs │ │ ├── blocks_below_top_level.rs │ │ ├── truncate.rs │ │ ├── escape-filter-invalid-kind.stderr │ │ ├── num-suffix.stderr │ │ ├── pluralize.stderr │ │ ├── terminator-operator.stderr │ │ ├── no-block.rs │ │ ├── loop_cycle_empty.stderr │ │ ├── as-primitive-type.rs │ │ ├── number.stderr │ │ ├── excessive_nesting.stderr │ │ ├── macro-args-hashtag.rs │ │ ├── iso646.rs │ │ ├── transclude-missing.stderr │ │ ├── iso646.stderr │ │ ├── wrong-end.rs │ │ ├── error_file_path.stderr │ │ ├── broken-config.rs │ │ ├── underscore.rs │ │ ├── is_defined.rs │ │ ├── garbled-closing-blocks.rs │ │ ├── macro_default_value.stderr │ │ ├── expr_fn_calls.rs │ │ ├── ambiguous-ws-raw.stderr │ │ ├── let_destructuring_has_rest.rs │ │ ├── macro-args-hashtag.stderr │ │ ├── vars.stderr │ │ ├── no-block.stderr │ │ ├── values.rs │ │ ├── end-block.rs │ │ ├── invalid_array_repeat.rs │ │ ├── macro-named-crate.rs │ │ ├── macro-recursion.rs │ │ ├── enum.stderr │ │ ├── comments-in-macro-calls.rs │ │ ├── struct-expressions.rs │ │ ├── named_filter_arguments.rs │ │ ├── unexpected-tag.rs │ │ └── comparator-chaining.rs │ ├── custom_ui │ │ ├── duplicated_block_calls.stderr │ │ └── duplicated_block_calls.rs │ ├── path.rs │ ├── coerce.rs │ ├── hello.rs │ ├── if.rs │ ├── rest_pattern.rs │ ├── no_implicit_prelude.rs │ ├── reexported-askama.rs │ ├── extend.rs │ ├── cow_str_implements_fast_writable.rs │ ├── declare.rs │ ├── size_hint.rs │ ├── render_in_place.rs │ └── blocks.rs ├── build.rs └── Cargo.toml ├── askama_derive ├── deny.toml ├── empty_test_config.toml ├── templates │ ├── a.html │ ├── b.html │ ├── include3.html │ ├── sub │ │ ├── b.html │ │ ├── c.html │ │ └── sub1 │ │ │ └── d.html │ ├── include1.html │ └── include2.html ├── .rustfmt.toml ├── LICENSE-MIT ├── _typos.toml ├── clippy.toml ├── tomlfmt.toml ├── LICENSE-APACHE ├── src │ ├── html.rs │ ├── ascii_str.rs │ └── generator │ │ └── helpers │ │ └── mod.rs └── README.md ├── askama_escape ├── deny.toml ├── .rustfmt.toml ├── LICENSE-MIT ├── _typos.toml ├── clippy.toml ├── tomlfmt.toml ├── LICENSE-APACHE ├── src │ ├── html.rs │ └── ascii_str.rs ├── benches │ ├── strings.inc │ └── all.rs └── Cargo.toml ├── askama_macros ├── deny.toml ├── .rustfmt.toml ├── LICENSE-MIT ├── _typos.toml ├── clippy.toml ├── tomlfmt.toml ├── LICENSE-APACHE ├── src │ └── lib.rs ├── README.md └── Cargo.toml ├── askama_parser ├── deny.toml ├── .rustfmt.toml ├── LICENSE-MIT ├── _typos.toml ├── clippy.toml ├── tomlfmt.toml ├── LICENSE-APACHE ├── src │ └── ascii_str.rs ├── benches │ └── librustdoc │ │ ├── item_info.html │ │ ├── type_layout_size.html │ │ ├── LICENSE.md │ │ ├── source.html │ │ ├── short_item_info.html │ │ ├── print_item.html │ │ └── item_union.html ├── README.md └── Cargo.toml ├── testing-alloc ├── deny.toml ├── .rustfmt.toml ├── LICENSE-MIT ├── _typos.toml ├── clippy.toml ├── tomlfmt.toml ├── LICENSE-APACHE ├── templates │ └── hello-world.html └── Cargo.toml ├── testing-no-std ├── deny.toml ├── LICENSE-MIT ├── _typos.toml ├── clippy.toml ├── tomlfmt.toml ├── .rustfmt.toml ├── LICENSE-APACHE ├── templates │ └── hello-world.html └── Cargo.toml ├── testing-renamed ├── deny.toml ├── LICENSE-MIT ├── _typos.toml ├── clippy.toml ├── tomlfmt.toml ├── .rustfmt.toml ├── LICENSE-APACHE ├── templates │ └── hello-world.html └── Cargo.toml ├── examples ├── axum-app │ ├── deny.toml │ ├── LICENSE-MIT │ ├── _typos.toml │ ├── clippy.toml │ ├── tomlfmt.toml │ ├── .rustfmt.toml │ ├── LICENSE-APACHE │ ├── templates │ │ └── error.html │ └── README.md ├── poem-app │ ├── deny.toml │ ├── LICENSE-MIT │ ├── _typos.toml │ ├── clippy.toml │ ├── tomlfmt.toml │ ├── .rustfmt.toml │ ├── LICENSE-APACHE │ ├── templates │ │ └── error.html │ ├── README.md │ └── Cargo.toml ├── salvo-app │ ├── deny.toml │ ├── LICENSE-MIT │ ├── _typos.toml │ ├── clippy.toml │ ├── .rustfmt.toml │ ├── LICENSE-APACHE │ ├── tomlfmt.toml │ ├── templates │ │ └── error.html │ └── README.md ├── warp-app │ ├── deny.toml │ ├── LICENSE-MIT │ ├── _typos.toml │ ├── clippy.toml │ ├── tomlfmt.toml │ ├── .rustfmt.toml │ ├── LICENSE-APACHE │ ├── templates │ │ └── error.html │ └── README.md ├── actix-web-app │ ├── deny.toml │ ├── LICENSE-MIT │ ├── _typos.toml │ ├── clippy.toml │ ├── tomlfmt.toml │ ├── .rustfmt.toml │ ├── LICENSE-APACHE │ ├── templates │ │ └── error.html │ └── README.md └── rocket-app │ ├── LICENSE-MIT │ ├── _typos.toml │ ├── clippy.toml │ ├── deny.toml │ ├── .rustfmt.toml │ ├── tomlfmt.toml │ ├── LICENSE-APACHE │ ├── templates │ └── error.html │ ├── README.md │ └── Cargo.toml ├── .gitignore ├── book ├── .gitignore ├── book.toml ├── src │ └── SUMMARY.md ├── ethicalads-theme.css ├── ethicalads-theme.sass └── 404.html ├── .gitattributes ├── .gitmodules ├── .github ├── dependabot.yml └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── deny.toml ├── Cargo.toml ├── .rustfmt.toml ├── tomlfmt.toml ├── _typos.toml └── LICENSE-MIT /askama/README.md: -------------------------------------------------------------------------------- 1 | ../README.md -------------------------------------------------------------------------------- /askama/deny.toml: -------------------------------------------------------------------------------- 1 | ../deny.toml -------------------------------------------------------------------------------- /askama/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /askama/_typos.toml: -------------------------------------------------------------------------------- 1 | ../_typos.toml -------------------------------------------------------------------------------- /askama/clippy.toml: -------------------------------------------------------------------------------- 1 | ../clippy.toml -------------------------------------------------------------------------------- /bench-build/deny.toml: -------------------------------------------------------------------------------- 1 | ../deny.toml -------------------------------------------------------------------------------- /clippy.toml: -------------------------------------------------------------------------------- 1 | msrv = "1.88.0" 2 | -------------------------------------------------------------------------------- /fuzzing/_typos.toml: -------------------------------------------------------------------------------- 1 | ../_typos.toml -------------------------------------------------------------------------------- /fuzzing/clippy.toml: -------------------------------------------------------------------------------- 1 | ../clippy.toml -------------------------------------------------------------------------------- /fuzzing/deny.toml: -------------------------------------------------------------------------------- 1 | ../deny.toml -------------------------------------------------------------------------------- /testing/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /testing/_typos.toml: -------------------------------------------------------------------------------- 1 | ../_typos.toml -------------------------------------------------------------------------------- /testing/clippy.toml: -------------------------------------------------------------------------------- 1 | ../clippy.toml -------------------------------------------------------------------------------- /testing/deny.toml: -------------------------------------------------------------------------------- 1 | ../deny.toml -------------------------------------------------------------------------------- /testing/templates/no-block.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /askama/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../.rustfmt.toml -------------------------------------------------------------------------------- /askama/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /askama/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../tomlfmt.toml -------------------------------------------------------------------------------- /askama_derive/deny.toml: -------------------------------------------------------------------------------- 1 | ../deny.toml -------------------------------------------------------------------------------- /askama_derive/empty_test_config.toml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /askama_derive/templates/a.html: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /askama_derive/templates/b.html: -------------------------------------------------------------------------------- 1 | bar 2 | -------------------------------------------------------------------------------- /askama_escape/deny.toml: -------------------------------------------------------------------------------- 1 | ../deny.toml -------------------------------------------------------------------------------- /askama_macros/deny.toml: -------------------------------------------------------------------------------- 1 | ../deny.toml -------------------------------------------------------------------------------- /askama_parser/deny.toml: -------------------------------------------------------------------------------- 1 | ../deny.toml -------------------------------------------------------------------------------- /bench-build/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /bench-build/_typos.toml: -------------------------------------------------------------------------------- 1 | ../_typos.toml -------------------------------------------------------------------------------- /bench-build/clippy.toml: -------------------------------------------------------------------------------- 1 | ../clippy.toml -------------------------------------------------------------------------------- /fuzzing/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../.rustfmt.toml -------------------------------------------------------------------------------- /fuzzing/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../tomlfmt.toml -------------------------------------------------------------------------------- /testing-alloc/deny.toml: -------------------------------------------------------------------------------- 1 | ../deny.toml -------------------------------------------------------------------------------- /testing-no-std/deny.toml: -------------------------------------------------------------------------------- 1 | ../deny.toml -------------------------------------------------------------------------------- /testing-renamed/deny.toml: -------------------------------------------------------------------------------- 1 | ../deny.toml -------------------------------------------------------------------------------- /testing/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../.rustfmt.toml -------------------------------------------------------------------------------- /testing/templates/foo.askama: -------------------------------------------------------------------------------- 1 | foo.askama -------------------------------------------------------------------------------- /testing/templates/foo.html: -------------------------------------------------------------------------------- 1 | foo.html -------------------------------------------------------------------------------- /testing/templates/foo.jinja: -------------------------------------------------------------------------------- 1 | foo.jinja -------------------------------------------------------------------------------- /testing/templates/latex-file.tex: -------------------------------------------------------------------------------- 1 | empty. -------------------------------------------------------------------------------- /testing/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../tomlfmt.toml -------------------------------------------------------------------------------- /askama_derive/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../.rustfmt.toml -------------------------------------------------------------------------------- /askama_derive/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /askama_derive/_typos.toml: -------------------------------------------------------------------------------- 1 | ../_typos.toml -------------------------------------------------------------------------------- /askama_derive/clippy.toml: -------------------------------------------------------------------------------- 1 | ../clippy.toml -------------------------------------------------------------------------------- /askama_derive/templates/include3.html: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /askama_derive/templates/sub/b.html: -------------------------------------------------------------------------------- 1 | bar 2 | -------------------------------------------------------------------------------- /askama_derive/templates/sub/c.html: -------------------------------------------------------------------------------- 1 | baz 2 | -------------------------------------------------------------------------------- /askama_derive/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../tomlfmt.toml -------------------------------------------------------------------------------- /askama_escape/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../.rustfmt.toml -------------------------------------------------------------------------------- /askama_escape/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /askama_escape/_typos.toml: -------------------------------------------------------------------------------- 1 | ../_typos.toml -------------------------------------------------------------------------------- /askama_escape/clippy.toml: -------------------------------------------------------------------------------- 1 | ../clippy.toml -------------------------------------------------------------------------------- /askama_escape/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../tomlfmt.toml -------------------------------------------------------------------------------- /askama_macros/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../.rustfmt.toml -------------------------------------------------------------------------------- /askama_macros/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /askama_macros/_typos.toml: -------------------------------------------------------------------------------- 1 | ../_typos.toml -------------------------------------------------------------------------------- /askama_macros/clippy.toml: -------------------------------------------------------------------------------- 1 | ../clippy.toml -------------------------------------------------------------------------------- /askama_macros/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../tomlfmt.toml -------------------------------------------------------------------------------- /askama_parser/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../.rustfmt.toml -------------------------------------------------------------------------------- /askama_parser/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /askama_parser/_typos.toml: -------------------------------------------------------------------------------- 1 | ../_typos.toml -------------------------------------------------------------------------------- /askama_parser/clippy.toml: -------------------------------------------------------------------------------- 1 | ../clippy.toml -------------------------------------------------------------------------------- /askama_parser/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../tomlfmt.toml -------------------------------------------------------------------------------- /bench-build/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../.rustfmt.toml -------------------------------------------------------------------------------- /bench-build/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /bench-build/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../tomlfmt.toml -------------------------------------------------------------------------------- /examples/axum-app/deny.toml: -------------------------------------------------------------------------------- 1 | ../../deny.toml -------------------------------------------------------------------------------- /examples/poem-app/deny.toml: -------------------------------------------------------------------------------- 1 | ../../deny.toml -------------------------------------------------------------------------------- /examples/salvo-app/deny.toml: -------------------------------------------------------------------------------- 1 | ../../deny.toml -------------------------------------------------------------------------------- /examples/warp-app/deny.toml: -------------------------------------------------------------------------------- 1 | ../../deny.toml -------------------------------------------------------------------------------- /testing-alloc/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../.rustfmt.toml -------------------------------------------------------------------------------- /testing-alloc/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /testing-alloc/_typos.toml: -------------------------------------------------------------------------------- 1 | ../_typos.toml -------------------------------------------------------------------------------- /testing-alloc/clippy.toml: -------------------------------------------------------------------------------- 1 | ../clippy.toml -------------------------------------------------------------------------------- /testing-alloc/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../tomlfmt.toml -------------------------------------------------------------------------------- /testing-no-std/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /testing-no-std/_typos.toml: -------------------------------------------------------------------------------- 1 | ../_typos.toml -------------------------------------------------------------------------------- /testing-no-std/clippy.toml: -------------------------------------------------------------------------------- 1 | ../clippy.toml -------------------------------------------------------------------------------- /testing-no-std/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../tomlfmt.toml -------------------------------------------------------------------------------- /testing-renamed/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /testing-renamed/_typos.toml: -------------------------------------------------------------------------------- 1 | ../_typos.toml -------------------------------------------------------------------------------- /testing-renamed/clippy.toml: -------------------------------------------------------------------------------- 1 | ../clippy.toml -------------------------------------------------------------------------------- /testing-renamed/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../tomlfmt.toml -------------------------------------------------------------------------------- /testing/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /testing/templates/included/fragment.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /askama_derive/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /askama_derive/templates/sub/sub1/d.html: -------------------------------------------------------------------------------- 1 | echo 2 | -------------------------------------------------------------------------------- /askama_escape/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /askama_macros/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /askama_parser/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /examples/actix-web-app/deny.toml: -------------------------------------------------------------------------------- 1 | ../../deny.toml -------------------------------------------------------------------------------- /examples/axum-app/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /examples/axum-app/_typos.toml: -------------------------------------------------------------------------------- 1 | ../../_typos.toml -------------------------------------------------------------------------------- /examples/axum-app/clippy.toml: -------------------------------------------------------------------------------- 1 | ../../clippy.toml -------------------------------------------------------------------------------- /examples/axum-app/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../../tomlfmt.toml -------------------------------------------------------------------------------- /examples/poem-app/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /examples/poem-app/_typos.toml: -------------------------------------------------------------------------------- 1 | ../../_typos.toml -------------------------------------------------------------------------------- /examples/poem-app/clippy.toml: -------------------------------------------------------------------------------- 1 | ../../clippy.toml -------------------------------------------------------------------------------- /examples/poem-app/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../../tomlfmt.toml -------------------------------------------------------------------------------- /examples/rocket-app/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /examples/rocket-app/_typos.toml: -------------------------------------------------------------------------------- 1 | ../../_typos.toml -------------------------------------------------------------------------------- /examples/rocket-app/clippy.toml: -------------------------------------------------------------------------------- 1 | ../../clippy.toml -------------------------------------------------------------------------------- /examples/rocket-app/deny.toml: -------------------------------------------------------------------------------- 1 | ../../deny.toml -------------------------------------------------------------------------------- /examples/salvo-app/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /examples/salvo-app/_typos.toml: -------------------------------------------------------------------------------- 1 | ../../_typos.toml -------------------------------------------------------------------------------- /examples/salvo-app/clippy.toml: -------------------------------------------------------------------------------- 1 | ../../clippy.toml -------------------------------------------------------------------------------- /examples/warp-app/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /examples/warp-app/_typos.toml: -------------------------------------------------------------------------------- 1 | ../../_typos.toml -------------------------------------------------------------------------------- /examples/warp-app/clippy.toml: -------------------------------------------------------------------------------- 1 | ../../clippy.toml -------------------------------------------------------------------------------- /examples/warp-app/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../../tomlfmt.toml -------------------------------------------------------------------------------- /testing-alloc/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /testing-no-std/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../.rustfmt.toml -------------------------------------------------------------------------------- /testing-no-std/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /testing-renamed/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../.rustfmt.toml -------------------------------------------------------------------------------- /testing-renamed/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /testing/templates/attr.html: -------------------------------------------------------------------------------- 1 | {{ inner.a }} 2 | -------------------------------------------------------------------------------- /testing/templates/foo.html.askama: -------------------------------------------------------------------------------- 1 | foo.html.askama -------------------------------------------------------------------------------- /testing/templates/foo.html.jinja: -------------------------------------------------------------------------------- 1 | foo.html.jinja -------------------------------------------------------------------------------- /testing/templates/use-var.txt: -------------------------------------------------------------------------------- 1 | {{ variable }} 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | Cargo.lock 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /askama_derive/src/html.rs: -------------------------------------------------------------------------------- 1 | ../../askama/src/html.rs -------------------------------------------------------------------------------- /askama_escape/src/html.rs: -------------------------------------------------------------------------------- 1 | ../../askama/src/html.rs -------------------------------------------------------------------------------- /examples/actix-web-app/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /examples/actix-web-app/_typos.toml: -------------------------------------------------------------------------------- 1 | ../../_typos.toml -------------------------------------------------------------------------------- /examples/actix-web-app/clippy.toml: -------------------------------------------------------------------------------- 1 | ../../clippy.toml -------------------------------------------------------------------------------- /examples/actix-web-app/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../../tomlfmt.toml -------------------------------------------------------------------------------- /examples/axum-app/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../../.rustfmt.toml -------------------------------------------------------------------------------- /examples/axum-app/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /examples/poem-app/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../../.rustfmt.toml -------------------------------------------------------------------------------- /examples/poem-app/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /examples/rocket-app/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../../.rustfmt.toml -------------------------------------------------------------------------------- /examples/rocket-app/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../../tomlfmt.toml -------------------------------------------------------------------------------- /examples/salvo-app/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../../.rustfmt.toml -------------------------------------------------------------------------------- /examples/salvo-app/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /examples/salvo-app/tomlfmt.toml: -------------------------------------------------------------------------------- 1 | ../../tomlfmt.toml -------------------------------------------------------------------------------- /examples/warp-app/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../../.rustfmt.toml -------------------------------------------------------------------------------- /examples/warp-app/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /testing/jinja2-assumptions/.python-version: -------------------------------------------------------------------------------- 1 | 3.13 2 | -------------------------------------------------------------------------------- /testing/templates/filters.html: -------------------------------------------------------------------------------- 1 | {{ strvar|e }} 2 | -------------------------------------------------------------------------------- /testing/templates/generics.html: -------------------------------------------------------------------------------- 1 | {{ t }}{{ u }} 2 | -------------------------------------------------------------------------------- /testing/templates/hello.html: -------------------------------------------------------------------------------- 1 | Hello, {{ name }}! 2 | -------------------------------------------------------------------------------- /testing/templates/included.html: -------------------------------------------------------------------------------- 1 | INCLUDED: {{ s }} 2 | -------------------------------------------------------------------------------- /book/.gitignore: -------------------------------------------------------------------------------- 1 | /book 2 | /.sass-cache 3 | /src/doc 4 | -------------------------------------------------------------------------------- /examples/actix-web-app/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | ../../.rustfmt.toml -------------------------------------------------------------------------------- /examples/actix-web-app/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /examples/rocket-app/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /testing/templates/composition.html: -------------------------------------------------------------------------------- 1 | composed: {{ foo }} 2 | -------------------------------------------------------------------------------- /testing/templates/filters_join.html: -------------------------------------------------------------------------------- 1 | {{ s|join(", ") }} 2 | -------------------------------------------------------------------------------- /testing/templates/format.html: -------------------------------------------------------------------------------- 1 | {{ "{:?}"|format(var) }} 2 | -------------------------------------------------------------------------------- /testing/templates/if.html: -------------------------------------------------------------------------------- 1 | {% if cond %}true{% endif %} 2 | -------------------------------------------------------------------------------- /testing/templates/invalid_syntax.html: -------------------------------------------------------------------------------- 1 | {% let 12 = 0 } 2 | -------------------------------------------------------------------------------- /askama_derive/src/ascii_str.rs: -------------------------------------------------------------------------------- 1 | ../../askama/src/ascii_str.rs -------------------------------------------------------------------------------- /askama_escape/src/ascii_str.rs: -------------------------------------------------------------------------------- 1 | ../../askama/src/ascii_str.rs -------------------------------------------------------------------------------- /askama_parser/src/ascii_str.rs: -------------------------------------------------------------------------------- 1 | ../../askama/src/ascii_str.rs -------------------------------------------------------------------------------- /fuzzing/fuzz/src/ascii_str.rs: -------------------------------------------------------------------------------- 1 | ../../../askama/src/ascii_str.rs -------------------------------------------------------------------------------- /fuzzing/fuzz/src/html/html.rs: -------------------------------------------------------------------------------- 1 | ../../../../askama/src/html.rs -------------------------------------------------------------------------------- /testing/folder-config.toml/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /testing/templates/cycle1.html: -------------------------------------------------------------------------------- 1 | {% extends "cycle1.html" %} 2 | -------------------------------------------------------------------------------- /testing/templates/cycle2.html: -------------------------------------------------------------------------------- 1 | {% extends "cycle1.html" %} 2 | -------------------------------------------------------------------------------- /testing/templates/nested-attr.html: -------------------------------------------------------------------------------- 1 | {{ inner.holder.a }} 2 | -------------------------------------------------------------------------------- /testing/templates/rust-macros.html: -------------------------------------------------------------------------------- 1 | Hello, {{ hello!() }}! 2 | -------------------------------------------------------------------------------- /askama_escape/benches/strings.inc: -------------------------------------------------------------------------------- 1 | ../../askama/benches/strings.inc -------------------------------------------------------------------------------- /testing/templates/let-base.html: -------------------------------------------------------------------------------- 1 | {% block body %}{% endblock %} 2 | -------------------------------------------------------------------------------- /testing/templates/tuple-attr.html: -------------------------------------------------------------------------------- 1 | {{ tuple.0 }}{{ tuple.1 }} 2 | -------------------------------------------------------------------------------- /testing/test_minimize.toml: -------------------------------------------------------------------------------- 1 | [general] 2 | whitespace = "minimize" 3 | -------------------------------------------------------------------------------- /testing/test_trim.toml: -------------------------------------------------------------------------------- 1 | [general] 2 | whitespace = "suppress" 3 | -------------------------------------------------------------------------------- /testing/templates/char-literals/char-literal-1.txt: -------------------------------------------------------------------------------- 1 | {% let s = '\a' %} 2 | -------------------------------------------------------------------------------- /testing/templates/char-literals/char-literal-2.txt: -------------------------------------------------------------------------------- 1 | {% let s = '\x' %} 2 | -------------------------------------------------------------------------------- /testing/templates/char-literals/char-literal-5.txt: -------------------------------------------------------------------------------- 1 | {% let s = '\u' %} 2 | -------------------------------------------------------------------------------- /testing/templates/nested/sub-nested/included.html: -------------------------------------------------------------------------------- 1 | INCLUDED: {{ s }} 2 | -------------------------------------------------------------------------------- /bench-build/templates/hello_world.html: -------------------------------------------------------------------------------- 1 |
| {{ col|escape }} | {% endfor %}
Below me is the header
3 | {% block header %}{% endblock %} 4 |Above me is the header
5 |Parent body content
6 | {% endblock %} 7 | {% block other_body %}{% endblock %} 8 | 9 | 10 | -------------------------------------------------------------------------------- /testing/templates/match-opt-bool.html: -------------------------------------------------------------------------------- 1 | {% match item %} 2 | {% when Some with (true) %} 3 | Found Some(true) 4 | {% when Some with (false) %} 5 | Found Some(false) 6 | {% when None %} 7 | Not Found 8 | {% endmatch %} 9 | -------------------------------------------------------------------------------- /testing/templates/precedence-for.html: -------------------------------------------------------------------------------- 1 | {% for s in strings %} 2 | {{- loop.index0 }}. {{ s }}{{ 2 * loop.index }}{% if !loop.first %}{% else %} (first){% endif %}{% if loop.last %} (last){% endif %} 3 | {% endfor %} 4 | -------------------------------------------------------------------------------- /bench-build/templates/greeting.html: -------------------------------------------------------------------------------- 1 | {%- block hello -%} 2 | Hello 3 | {%- endblock -%} 4 | 5 | {%- block hey -%} 6 | Hey 7 | {%- endblock -%} 8 | 9 | {%- block hi -%} 10 | Hi 11 | {%- endblock -%} 12 | -------------------------------------------------------------------------------- /fuzzing/fuzz/artifacts/filters/minimized-from-b44b4bd1da1759dee0924a8586a6001e80da76fa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/askama-rs/askama/HEAD/fuzzing/fuzz/artifacts/filters/minimized-from-b44b4bd1da1759dee0924a8586a6001e80da76fa -------------------------------------------------------------------------------- /testing/templates/fragment-mid-super.html: -------------------------------------------------------------------------------- 1 | {% extends "fragment-base.html" %} 2 | 3 | {% block body %} 4 | [{{ super() }}] 5 | {% endblock %} 6 | 7 | {% block other_body %} 8 | ({{ super() }}) 9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /testing/tests/ui/duplicated_template_attribute.stderr: -------------------------------------------------------------------------------- 1 | error: must specify `source`, `path` or `is_doc` exactly once 2 | --> tests/ui/duplicated_template_attribute.rs:9:5 3 | | 4 | 9 | source = "🙃", 5 | | ^^^^^^ 6 | -------------------------------------------------------------------------------- /testing/tests/ui/filter-recursion.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template(path = "filter-recursion.html")] 5 | struct Filtered { 6 | s: &'static str, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /testing/tests/ui/lit_on_assignment_lhs.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template( 5 | source = "{%let 7=x%}", 6 | ext = "txt" 7 | )] 8 | struct MyTemplate; 9 | 10 | fn main() { 11 | } 12 | -------------------------------------------------------------------------------- /testing/tests/ui/union.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template(source = "a={{ a }} b={{ b }}", ext = "html")] 5 | union Tmpl { 6 | a: i32, 7 | b: u32, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /testing/jinja2-assumptions/.gitignore: -------------------------------------------------------------------------------- 1 | # Python-generated files 2 | __pycache__/ 3 | *.py[oc] 4 | build/ 5 | dist/ 6 | wheels/ 7 | *.egg-info 8 | 9 | # Virtual environments 10 | .venv 11 | 12 | .pytest_cache 13 | uv.lock 14 | -------------------------------------------------------------------------------- /testing/tests/ui/fuzzing.stderr: -------------------------------------------------------------------------------- 1 | error: failed to parse template source 2 | -->Hello {{ name }}!
5 | {% endblock %} 6 | 7 | {% block other_body %} 8 |Don't render me.
9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /testing/tests/ui/extend.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template( 5 | source = r##"bla 6 | {% extends "base.html" %} 7 | "##, 8 | ext = "txt", 9 | )] 10 | pub struct X; 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /testing/templates/blocks.txt: -------------------------------------------------------------------------------- 1 | {% block index %} 2 | Section: {{ s1 }} 3 | {% endblock %} 4 | 5 | {% block section -%} 6 | [ 7 | {%- for value in values -%} 8 | {{ value }} 9 | {%- endfor -%} 10 | ] 11 | {%- endblock %} 12 | -------------------------------------------------------------------------------- /testing/templates/match-enum-or.html: -------------------------------------------------------------------------------- 1 | The card is 2 | {%- match suit %} 3 | {%- when Suit::Clubs or Suit::Spades -%} 4 | {{ " black" }} 5 | {%- when Suit::Diamonds or Suit::Hearts -%} 6 | {{ " red" }} 7 | {%- endmatch %} 8 | 9 | -------------------------------------------------------------------------------- /testing/tests/ui/fuzzed_recursion_depth_mul_deref.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template(path = "fuzzed-recursion-mul-deref.txt")] 5 | struct Filtered { 6 | s: &'static str, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /testing/tests/ui/include-a-folder.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template(ext = "txt", source = r#"{% include "a_file_that_is_actually_a_folder.html" %}"#)] 5 | struct YouCannotIncludeFolders; 6 | 7 | fn main() { 8 | } 9 | -------------------------------------------------------------------------------- /testing/tests/ui/name_mismatch_endmacro.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template(source = "{% macro foo(arg) %} {{arg}} {% endmacro not_foo %}", ext = "html")] 5 | struct NameMismatchEndMacro; 6 | 7 | fn main() { 8 | } 9 | -------------------------------------------------------------------------------- /testing/tests/ui/json-too-many-args.rs: -------------------------------------------------------------------------------- 1 | #![cfg(feature = "serde_json")] 2 | 3 | use askama::Template; 4 | 5 | #[derive(Template)] 6 | #[template(ext = "txt", source = "{{ 1|json(2, 3) }}")] 7 | struct OneTwoThree; 8 | 9 | fn main() { 10 | } 11 | -------------------------------------------------------------------------------- /testing/tests/ui/multiple_extends.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template(source = r#" 5 | {% extends "let.html" %} 6 | {% extends "foo.html" %} 7 | "#, ext = "txt")] 8 | struct MyTemplate4; 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /testing/tests/ui/break_outside_of_loop.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template( 5 | source = "Have a {%break%}, have a parsing error!", 6 | ext = "txt" 7 | )] 8 | struct MyTemplate; 9 | 10 | fn main() { 11 | } 12 | -------------------------------------------------------------------------------- /testing/templates/nested-macro-callexpr.html: -------------------------------------------------------------------------------- 1 | {%- macro child0() -%} 2 | foo 3 | {%- endmacro -%} 4 | 5 | {%- macro child1() -%} 6 | {{ child0() }} 7 | {%- endmacro -%} 8 | 9 | {%- macro parent() -%} 10 | {{ child1() }} 11 | {%- endmacro -%} 12 | -------------------------------------------------------------------------------- /testing/tests/ui/number.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template(source = r#"{{ e!(0o08) }}"#, ext = "html")] 5 | struct A; 6 | 7 | #[derive(Template)] 8 | #[template(source = r#"{{ e!(0b3) }}"#, ext = "html")] 9 | struct B; 10 | -------------------------------------------------------------------------------- /testing/tests/ui/pluralize.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template( 5 | ext = "html", 6 | source = "{{ input|pluralize }}", 7 | )] 8 | struct Pluralize { 9 | input: &'static str, 10 | } 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /testing/templates/deep-kid.html: -------------------------------------------------------------------------------- 1 | {% extends "deep-mid.html" %} 2 | {% import "macro.html" as libk %} 3 | 4 | {% block head %} 5 | 6 | {% endblock %} 7 | 8 | {% block content %} 9 | {% call libk::thrice(item) %}{% endcall %} 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /testing/templates/for.html: -------------------------------------------------------------------------------- 1 | {% for s in strings %} 2 | {{- loop.index0 }}. {{ s }}{% if loop.first %} (first){% endif %} 3 | {% endfor %} 4 | {% for (s1, s2, ) in tuple_strings %} 5 | {{- loop.index0 }}. {{ s1 }},{{ s2 }}{% if loop.first %} (first){% endif %} 6 | {% endfor %} 7 | -------------------------------------------------------------------------------- /testing/templates/fragment-super.html: -------------------------------------------------------------------------------- 1 | {% extends "fragment-base.html" %} 2 | 3 | {% block body %} 4 |Hello {{ name }}!
5 | {{ super() }} 6 | {% endblock %} 7 | 8 | {% block other_body %} 9 |Don't render me.
10 | {{ super() }} 11 | {% endblock %} 12 | 13 | -------------------------------------------------------------------------------- /testing/tests/ui/fuzzing.rs: -------------------------------------------------------------------------------- 1 | // Test file specifically for parser bugs uncovered with fuzzing. 2 | 3 | use askama::Template; 4 | 5 | #[derive(Template)] 6 | #[template( 7 | source = r#"{{..{Ւ{"#, 8 | ext = "html", 9 | )] 10 | struct T; 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "cargo" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /testing/tests/custom_ui/duplicated_block_calls.stderr: -------------------------------------------------------------------------------- 1 | ⚠️ X.txt:4:3: block `content` was already called at `X.txt:3:3` so the previous one will be ignored 2 | ⚠️ X2.txt:3:3: block `content` was already called at `testing/templates/child.html:2:3` so the previous one will be ignored 3 | -------------------------------------------------------------------------------- /testing/tests/ui/filter_block_ws.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template(source = "{% filter lower|indent(2) - %} 5 | HELLO 6 | {{v}} 7 | {%- endfilter %}", ext = "html")] 8 | struct A; 9 | 10 | fn main() { 11 | A.render().unwrap(); 12 | } 13 | -------------------------------------------------------------------------------- /testing/tests/ui/ref_deref.stderr: -------------------------------------------------------------------------------- 1 | error: failed to parse template source 2 | -->Hello {{ name }}!
5 | {{ super() }} 6 | {% endblock %} 7 | 8 | {% block other_body %} 9 |Don't render me.
10 | {{ super() }} 11 | {% endblock %} 12 | 13 | -------------------------------------------------------------------------------- /testing/templates/fragment-unused-expr.html: -------------------------------------------------------------------------------- 1 | {% extends "fragment-base.html" %} 2 | 3 | {{ not_required }} 4 | 5 | {% block body %} 6 |{{ required }}
7 | {% endblock %} 8 | 9 | {% block other_body %} 10 | {{ not_required_2 }} 11 |Don't render me.
12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /testing/templates/nested-macro.html: -------------------------------------------------------------------------------- 1 | {%- macro child0() -%} 2 | foo 3 | {%- endmacro -%} 4 | 5 | {%- macro child1() -%} 6 | {% call child0() %}{% endcall %} 7 | {%- endmacro -%} 8 | 9 | {%- macro parent() -%} 10 | {% call child1() %}{% endcall %} 11 | {%- endmacro -%} 12 | -------------------------------------------------------------------------------- /testing/tests/ui/lit_on_assignment_lhs.stderr: -------------------------------------------------------------------------------- 1 | error: literals are not allowed on the left-hand side of an assignment 2 | --> MyTemplate.txt:1:2 3 | "let 7=x%}" 4 | --> tests/ui/lit_on_assignment_lhs.rs:5:14 5 | | 6 | 5 | source = "{%let 7=x%}", 7 | | ^^^^^^^^^^^^^ 8 | -------------------------------------------------------------------------------- /testing/templates/block_in_include_extended.html: -------------------------------------------------------------------------------- 1 | {%- extends "block_in_include_base.html" -%} 2 | 3 | {%- block block_in_base -%} 4 | block_in_base: from extended! 5 | {% endblock -%} 6 | 7 | {%- block block_in_partial -%} 8 | block_in_partial: from extended! 9 | {% endblock -%} 10 | -------------------------------------------------------------------------------- /testing/templates/nested-macro-args.html: -------------------------------------------------------------------------------- 1 | {%- macro outer(first) -%} 2 | {%- call inner(first, "second") -%}{%- endcall -%} 3 | {%- endmacro -%} 4 | 5 | {%- macro inner(first, second) -%} 6 | {{ first }} {{ second }} 7 | {%- endmacro -%} 8 | 9 | {%- call outer("first") -%}{%- endcall -%} 10 | -------------------------------------------------------------------------------- /testing/tests/ui/duplicated_template_attribute.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template( 5 | source = "🙂", 6 | ext = "txt" 7 | )] 8 | #[template( 9 | source = "🙃", 10 | ext = "txt" 11 | )] 12 | struct TwoEmojis; 13 | 14 | fn main() { 15 | } 16 | -------------------------------------------------------------------------------- /testing/templates/rust-macro-args.html: -------------------------------------------------------------------------------- 1 | {{ call_a_or_b_on_tail!((a: year, b: month, c: day), call a: 2021, "July", (0+2)) }} 2 | {{ call_a_or_b_on_tail!((a: year, b: month, c: day), call b: 2021, "July", (0+2)) }} 3 | {{ call_a_or_b_on_tail!((a: year, b: day, c: month), call b: 2021, "July", (0+2)) }} 4 | -------------------------------------------------------------------------------- /testing/tests/ui/loop-fields.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | // Fail on unknown `loop` fields 4 | 5 | #[derive(Template)] 6 | #[template( 7 | source = "{% for _ in 0..10 %} {{ loop.index1 }} {% endfor %}", 8 | ext = "txt" 9 | )] 10 | struct UnknownLoopField; 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /testing/tests/ui/block_and_vars.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template(source = r#"{% extends "extend_and_import.html" %} 5 | 6 | {% let x = 12 %} 7 | {% block header -%} 8 | {{ x }} 9 | {% endblock %}"#, ext = "html")] 10 | struct A; 11 | 12 | fn main() { 13 | } 14 | -------------------------------------------------------------------------------- /testing/tests/ui/declare.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template(source = "{% decl x = 'a' %}", ext = "html")] 5 | struct Declare1; 6 | 7 | #[derive(Template)] 8 | #[template(source = "{% declare x = 'a' %}", ext = "html")] 9 | struct Declare2; 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /testing/tests/ui/macro-args.stderr: -------------------------------------------------------------------------------- 1 | error: you are missing a space to separate two string literals 2 | -->Don't render me!
5 | {% block nested %} 6 |I should be here.
7 | {% endblock %} 8 | {% endblock %} 9 | 10 | {% block other_body %} 11 |Don't render me!
12 | {% endblock %} 13 | 14 | -------------------------------------------------------------------------------- /testing/tests/ui/macro-args.rs: -------------------------------------------------------------------------------- 1 | // This test ensures that the proc-macro fails if two arguments are not separated. 2 | 3 | use askama::Template; 4 | 5 | #[derive(Template)] 6 | #[template( 7 | source = r###"{{e!{ r#""#r" \ "}}}"###, 8 | ext = "html" 9 | )] 10 | struct Example; 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /testing/tests/ui/transclude-missing.rs: -------------------------------------------------------------------------------- 1 | use askama::Template; 2 | 3 | #[derive(Template)] 4 | #[template(path = "transclude-there.html")] 5 | struct Indirect; 6 | 7 | #[derive(Template)] 8 | #[template(source = r#"{% include "transclude-there.html" %}"#, ext = "html")] 9 | struct Direct; 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /.rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2021" 2 | group_imports = "StdExternalCrate" 3 | imports_granularity = "Module" 4 | newline_style = "Unix" 5 | normalize_comments = true 6 | style_edition = "2024" 7 | unstable_features = true 8 | use_field_init_shorthand = true 9 | 10 | ignore = [ 11 | "testing/tests/hello.rs", 12 | ] 13 | -------------------------------------------------------------------------------- /testing/jinja2-assumptions/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | if ! which uv > /dev/null; then 6 | echo 'Please install `uv` first:{{ err }}
22 | {%- endmatch -%}
23 |
24 | {{ err }}
22 | {%- endmatch -%}
23 |
24 | {{ err }}
22 | {%- endmatch -%}
23 |
24 | {{ err }}
22 | {%- endmatch -%}
23 |
24 | {{ err }}
21 | {% else -%}
22 | {%- endmatch -%}
23 |
24 |
5 | {% for line in lines.clone() %}
6 | {% if embedded %}
7 | {{line|safe}}
8 | {%~ else %}
9 | {{line|safe}}
10 | {%~ endif %}
11 | {% endfor %}
12 | {# #}
14 |
15 | {% if needs_expansion %}
16 |
17 | {% endif %}
18 | {{code_html|safe}}
19 | {# #}
20 | {# #}
21 | {{ err }}
23 | {% when AppError::Render(err) -%} {{ err }}
24 | {%- endmatch -%}
25 |
26 | {{feature}} {# #}
13 | {% match tracking %}
14 | {% when Some with ((url, num)) %}
15 | #{{num}} {# #}
16 | {% when None %}
17 | {% endmatch %}
18 | ) {# #}
19 | {# #}
20 |
2 | {{ self.render_attributes_in_pre()|safe }}
3 | {{ self.render_union()|safe }}
4 |
5 | {{ self.document()|safe }}
6 | {% if self.fields_iter().peek().is_some() %}
7 | {{ name }}: {{+ self.print_ty(ty)|safe }} {# #}
16 |
17 | {% if let Some(stability_class) = self.stability_field(field) %}
18 |
19 | {% endif %}
20 | {{ self.document_field(field)|safe }}
21 | {% endfor %}
22 | {% endif %}
23 | {{ self.render_assoc_items()|safe }}
24 | {{ self.document_type_layout()|safe }}
25 |
--------------------------------------------------------------------------------
/testing/tests/size_hint.rs:
--------------------------------------------------------------------------------
1 | use askama::Template;
2 |
3 | macro_rules! test_size {
4 | ($source:literal, $expected:expr) => {{
5 | #[derive(Template)]
6 | #[allow(dead_code)]
7 | #[template(source = $source, ext = "txt")]
8 | struct T(bool);
9 |
10 | assert_eq!(T::SIZE_HINT, $expected);
11 | }};
12 | }
13 |
14 | #[test]
15 | fn test_cond_size_hint() {
16 | test_size!("{% if self.0 %}12345{% else %}12345{% endif %}", 10);
17 | }
18 |
19 | #[test]
20 | fn test_match_size_hint() {
21 | test_size!(
22 | "{% match self.0 %}{% when true %}12345{% else %}12345{% endmatch %}",
23 | 5
24 | );
25 | }
26 |
27 | #[test]
28 | fn test_loop_size_hint() {
29 | test_size!("{% for i in 0..1 %}12345{% endfor %}", 7);
30 | }
31 |
32 | #[test]
33 | fn test_block_size_hint() {
34 | #[derive(Template)]
35 | #[template(path = "size-child.txt")]
36 | struct T;
37 |
38 | assert_eq!(T::SIZE_HINT, 3);
39 | }
40 |
41 | #[test]
42 | fn test_super_size_hint() {
43 | #[derive(Template)]
44 | #[template(path = "size-child-super.txt")]
45 | struct T;
46 |
47 | assert_eq!(T::SIZE_HINT, 5);
48 | }
49 |
--------------------------------------------------------------------------------
/testing/tests/ui/invalid_array_repeat.rs:
--------------------------------------------------------------------------------
1 | use askama::Template;
2 |
3 | #[derive(Template)]
4 | #[template(source = r#"{% let my_arr = [;] %}"#, ext = "txt")]
5 | struct Empty;
6 |
7 | #[derive(Template)]
8 | #[template(source = r#"{% let my_arr = [;0] %}"#, ext = "txt")]
9 | struct EmptyElement;
10 |
11 | #[derive(Template)]
12 | #[template(source = r#"{% let my_arr = ["";] %}"#, ext = "txt")]
13 | struct EmptyCount;
14 |
15 | #[derive(Template)]
16 | #[template(source = r#"{% let my_arr = [,;] %}"#, ext = "txt")]
17 | struct StrayElementComma;
18 |
19 | #[derive(Template)]
20 | #[template(source = r#"{% let my_arr = [; 10, 10] %}"#, ext = "txt")]
21 | struct StrayCountComma;
22 |
23 | #[derive(Template)]
24 | #[template(source = r#"{% let my_arr = [,;,] %}"#, ext = "txt")]
25 | struct StrayCommas;
26 |
27 | #[derive(Template)]
28 | #[template(source = r#"{% let my_arr = ["";10;10] %}"#, ext = "txt")]
29 | struct MultipleSemicolons;
30 |
31 | #[derive(Template)]
32 | #[template(
33 | source = r#"{{ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ }}"#,
34 | ext = "txt"
35 | )]
36 | struct RecursionLimit;
37 |
38 | fn main() {}
39 |
--------------------------------------------------------------------------------
/testing/tests/ui/macro-named-crate.rs:
--------------------------------------------------------------------------------
1 | // The names `crate`, `self`, `Self` and `super` cannot be raw identifiers, so they can never
2 | // be valid macro names.
3 |
4 | #[derive(askama::Template)]
5 | #[template(source = "{{ crate!() }}", ext = "txt")]
6 | struct MacroCrate;
7 |
8 | #[derive(askama::Template)]
9 | #[template(source = "{{ self!() }}", ext = "txt")]
10 | struct MacroSelf;
11 |
12 | #[derive(askama::Template)]
13 | #[template(source = "{{ Self!() }}", ext = "txt")]
14 | struct MacroSelfType;
15 |
16 | #[derive(askama::Template)]
17 | #[template(source = "{{ super!() }}", ext = "txt")]
18 | struct MacroSuper;
19 |
20 | #[derive(askama::Template)]
21 | #[template(source = "{{ some::path::crate!() }}", ext = "txt")]
22 | struct MacroPathCrate;
23 |
24 | #[derive(askama::Template)]
25 | #[template(source = "{{ some::path::self!() }}", ext = "txt")]
26 | struct MacroPathSelf;
27 |
28 | #[derive(askama::Template)]
29 | #[template(source = "{{ some::path::Self!() }}", ext = "txt")]
30 | struct MacroPathSelfType;
31 |
32 | #[derive(askama::Template)]
33 | #[template(source = "{{ some::path::super!() }}", ext = "txt")]
34 | struct MacroPathSuper;
35 |
36 | fn main() {
37 | }
38 |
--------------------------------------------------------------------------------
/testing/tests/ui/macro-recursion.rs:
--------------------------------------------------------------------------------
1 | use askama::Template;
2 |
3 | #[derive(Template)]
4 | #[template(
5 | source = "
6 | {% macro one %}{% call one %}{% endcall %}{% endmacro %}
7 | {% call one %}{% endcall %}
8 | ",
9 | ext = "html"
10 | )]
11 | struct Direct;
12 |
13 | #[derive(Template)]
14 | #[template(
15 | source = "
16 | {% macro one %}{% call two %}{% endcall %}{% endmacro %}
17 | {% macro two %}{% call three %}{% endcall %}{% endmacro %}
18 | {% macro three %}{% call four %}{% endcall %}{% endmacro %}
19 | {% macro four %}{% call five %}{% endcall %}{% endmacro %}
20 | {% macro five %}{% call one %}{% endcall %}{% endmacro %}
21 | {% call one %}{% endcall %}
22 | ",
23 | ext = "html"
24 | )]
25 | struct Indirect;
26 |
27 | #[derive(Template)]
28 | #[template(
29 | source = r#"
30 | {% import "macro-recursion-1.html" as next %}
31 | {% macro some_macro %}
32 | {% call next::some_macro %}{% endcall %}
33 | {% endmacro %}
34 | {% call some_macro %}{% endcall %}
35 | "#,
36 | ext = "html"
37 | )]
38 | struct AcrossImports;
39 |
40 | fn main() {
41 | }
42 |
--------------------------------------------------------------------------------
/testing/templates/if-coerce.html:
--------------------------------------------------------------------------------
1 | {% macro foo(b) -%}
2 | {% if b %}t{% else %}f{% endif -%}
3 | {% endmacro -%}
4 |
5 | {% macro bar(b) -%}
6 | {%- call foo(b) -%}{%- endcall -%}
7 | {% endmacro -%}
8 |
9 | {% macro baz(b) -%}
10 | {%- call bar(b) -%}{%- endcall -%}
11 | {% endmacro -%}
12 |
13 | {% macro qux(b) -%}
14 | {%- call baz(b) -%}{%- endcall -%}
15 | {% endmacro -%}
16 |
17 | {%- call foo(false) -%}{%- endcall -%}
18 | {%- call bar(true) -%}{%- endcall -%}
19 | {%- call baz(false) -%}{%- endcall -%}
20 | {%- call qux(true) -%}{%- endcall -%}
21 |
22 | {%- call qux(true && false) -%}{%- endcall -%}
23 | {%- call qux(false || true) -%}{%- endcall -%}
24 |
25 | {%- call qux(self.t) -%}{%- endcall -%}
26 | {%- call qux(self.f) -%}{%- endcall -%}
27 | {%- call qux(self.f || self.t) -%}{%- endcall -%}
28 |
29 | {%- if false -%}
30 | if
31 | {%- else if false || true -%}
32 | elseif
33 | {%- else -%}
34 | else
35 | {%- endif -%}
36 |
37 | {%- if true && false -%}
38 | if
39 | {%- else if false -%}
40 | elseif
41 | {%- else -%}
42 | else
43 | {%- endif -%}
44 |
45 | {%- if false || true -%}
46 | if
47 | {%- else if (true && false) -%}
48 | elseif
49 | {%- else -%}
50 | else
51 | {%- endif -%}
52 |
--------------------------------------------------------------------------------
/testing/tests/render_in_place.rs:
--------------------------------------------------------------------------------
1 | use askama::Template;
2 |
3 | #[test]
4 | fn test_render_in_place() {
5 | #[derive(Template)]
6 | #[template(path = "render_in_place.html")]
7 | struct RenderInPlace<'a> {
8 | s1: SectionOne<'a>,
9 | s2: SectionTwo<'a>,
10 | s3: &'a Vec