refactor(hmpl,hectic): warnings

This commit is contained in:
2025-03-24 13:36:31 +00:00
parent 972e2d2968
commit d39ed7f9fe
13 changed files with 537 additions and 117 deletions

82
package/c/hmpl/README.md Normal file
View File

@@ -0,0 +1,82 @@
## interpolation tag
context
```json
{
"name": "Ioan",
"person": { "name": "Oleg" },
"family": {"person": { "name": "Taras" }},
}
```
template
```hmpl
{{name}}
{{person.name}}
{{family.person.name}}
```
result
```hmpl
Ioan
Oleg
Taras
```
## section/iteration tag
context
```json
{
"person": {"name": "persons"},
"persons": [
{"name": "Ioan", "number": 2},
{"name": "Oleg", "number": 1},
]
}
```
template # raise_exception
```hmpl
{{#{{person.name}} p}}
{{p.name}} is {{p.number}}
{{/persons}}
```
result
```hmpl
Ioan is 2
Oleg is 1
```
## include tag
json
```json
```
template
```hmpl
{{>template_name}}
```
result
```hmpl
```
## Order
used plain render
interpolation->section->include
so you cannot render interpolation in interpolation or section
Not allowed:
```hmpl
{{name_{{subname}}}}
{{#array_{{subname}}}}
```
But:
```hmpl
{{>{{template_name}}}}
```
allowed;
№ эксепшн на нераскрытые