Skip to content

Commit 23cdc79

Browse files
GuillaumeGomezKijewski
authored andcommitted
Update duplicated blocks warning message and add warning about not compiling starting next version
1 parent 67354d7 commit 23cdc79

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

askama_derive/src/heritage.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ impl<'a> Context<'a> {
119119
"⚠️ {:#}: block `{}` was already called at `{:#}` so the previous one will be ignored",
120120
current, &*b.name, prev,
121121
);
122+
eprintln!(
123+
" You can repeat blocks by using the `template` proc-macro blocks: \
124+
https://askama.readthedocs.io/en/latest/creating_templates.html#blocks"
125+
);
126+
eprintln!("⚠️⚠️⚠️ This will stop compiling starting next version!");
122127
} else if extends.is_none() {
123128
called_blocks.check_if_already_called(*b.name, current);
124129
called_blocks
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
⚠️ Foo.txt:3:3: block `foo` was already called at `Foo.txt:2:3` so the previous one will be ignored
2+
You can repeat blocks by using the `template` proc-macro blocks: https://askama.readthedocs.io/en/latest/creating_templates.html#blocks
3+
⚠️⚠️⚠️ This will stop compiling starting next version!
24
⚠️ testing/templates/extend-duplicated.html:4:3: block `content` was already called at `testing/templates/extend-duplicated.html:3:3` so the previous one will be ignored
5+
You can repeat blocks by using the `template` proc-macro blocks: https://askama.readthedocs.io/en/latest/creating_templates.html#blocks
6+
⚠️⚠️⚠️ This will stop compiling starting next version!
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
⚠️ X.txt:4:3: block `content` was already called at `X.txt:3:3` so the previous one will be ignored
2+
You can repeat blocks by using the `template` proc-macro blocks: https://askama.readthedocs.io/en/latest/creating_templates.html#blocks
3+
⚠️⚠️⚠️ This will stop compiling starting next version!

0 commit comments

Comments
 (0)