1
1
# Style for Templates
2
2
3
- This directory has templates in the [ Rinja templating language] [ rinjadoc ] , which is very
3
+ This directory has templates in the [ Askama templating language] [ askamadoc ] , which is very
4
4
similar to [ Jinja2] [ jinjadoc ] .
5
5
6
6
[ jinjadoc ] : https://jinja.palletsprojects.com/en/3.1.x/templates/
7
- [ rinjadoc ] : https://docs.rs/rinja /latest/rinja /
7
+ [ askamadoc ] : https://docs.rs/askama /latest/askama /
8
8
9
9
We want our rendered output to have as little unnecessary whitespace as
10
- possible, so that pages load quickly. To achieve that we use Rinja 's
10
+ possible, so that pages load quickly. To achieve that we use Askama 's
11
11
[ whitespace control] features. By default, whitespace characters are removed
12
12
around jinja tags (` {% %} ` for example). At the end of most lines, we put an
13
13
empty comment tag: ` {# #} ` . This causes all whitespace between the end of the
@@ -18,19 +18,19 @@ remove following whitespace but not preceding. We also use the whitespace
18
18
control characters in most instances of tags with control flow, for example
19
19
` {% if foo %} ` .
20
20
21
- [ whitespace control ] : https://rinja .readthedocs.io/en/stable/configuration.html#whitespace-control
21
+ [ whitespace control ] : https://askama .readthedocs.io/en/stable/configuration.html#whitespace-control
22
22
23
23
We want our templates to be readable, so we use indentation and newlines
24
24
liberally. We indent by four spaces after opening an HTML tag _ or_ a Jinja
25
25
tag. In most cases an HTML tag should be followed by a newline, but if the
26
26
tag has simple contents and fits with its close tag on a single line, the
27
27
contents don't necessarily need a new line.
28
28
29
- Rinja templates support quite sophisticated control flow. To keep our templates
29
+ Askama templates support quite sophisticated control flow. To keep our templates
30
30
simple and understandable, we use only a subset: ` if ` and ` for ` . In particular
31
- we avoid [ assignments in the template logic] [ assignments ] and [ Rinja
31
+ we avoid [ assignments in the template logic] [ assignments ] and [ Askama
32
32
macros] [ macros ] . This also may make things easier if we switch to a different
33
33
Jinja-style template system in the future.
34
34
35
- [ assignments ] : https://rinja .readthedocs.io/en/stable/template_syntax.html#assignments
36
- [ macros ] : https://rinja .readthedocs.io/en/stable/template_syntax.html#macros
35
+ [ assignments ] : https://askama .readthedocs.io/en/stable/template_syntax.html#assignments
36
+ [ macros ] : https://askama .readthedocs.io/en/stable/template_syntax.html#macros
0 commit comments