fix: support suffix (in version 1.0 format) in calculation

This commit is contained in:
egarette@silique.fr 2025-02-19 16:43:32 +01:00
parent 97a8653b28
commit 604cfa0a1d
10 changed files with 315 additions and 4 deletions

View file

@ -328,4 +328,6 @@ class Annotator(Walk):
variable_path,
path,
)
elif version == '1.0' and '{{ suffix }}' in variable_path:
variable_path = variable_path.replace("{{ suffix }}", "{{ identifier }}")
return variable_path

View file

@ -0,0 +1,50 @@
== Variables for "Rougail"
[cols="1a,1a"]
|====
| Variable | Description
|
**rougail.var** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `unique` `multiple` |
A suffix variable. +
**Default**:
* val1
* val2
|====
=== a dynamic family
`standard`
This family builds families dynamically.
**Identifiers**: the value of the variable "rougail.var".
[cols="1a,1a"]
|====
| Variable | Description
|
**rougail.my_dyn_family___val1__.var** +
**rougail.my_dyn_family___val2__.var** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` |
A variable inside a dynamic family. +
**Default**: the value of the identifier.
|====
[cols="1a,1a"]
|====
| Variable | Description
|
**rougail.var2** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `unique` `multiple` |
A variable. +
**Default**:
* the value of the variable "rougail.my_dyn_family___val1__.var"
* the value of the variable "rougail.my_dyn_family___val2__.var"
|====

View file

@ -0,0 +1,149 @@
{
"rougail": {
"type": "namespace",
"informations": {
"paths": [
"rougail"
],
"names": [
"rougail"
],
"description": "Rougail",
"properties": [
{
"type": "mode",
"name": "standard"
}
]
},
"children": {
"rougail.var": {
"type": "variable",
"default": [
"val1",
"val2"
],
"properties": [
{
"type": "type",
"name": "string"
},
{
"type": "mode",
"name": "standard"
},
{
"type": "property",
"name": "mandatory"
},
{
"type": "property",
"name": "unique"
},
{
"type": "multiple",
"name": "multiple"
}
],
"paths": [
"rougail.var"
],
"names": [
"var"
],
"descriptions": [
"A suffix variable."
]
},
"my_dyn_family_{{ identifier }}": {
"type": "dynamic",
"informations": {
"paths": [
"rougail.my_dyn_family_val1",
"rougail.my_dyn_family_val2"
],
"names": [
"my_dyn_family_val1",
"my_dyn_family_val2"
],
"description": "a dynamic family",
"properties": [
{
"type": "mode",
"name": "standard"
}
],
"identifiers": "the value of the variable \"rougail.var\".",
"help": [
"This family builds families dynamically."
]
},
"children": {
"rougail.my_dyn_family_{{ identifier }}.var": {
"paths": [
"rougail.my_dyn_family_val1.var",
"rougail.my_dyn_family_val2.var"
],
"names": [
"var",
"var"
],
"type": "variable",
"default": "the value of the identifier.",
"properties": [
{
"type": "type",
"name": "string"
},
{
"type": "mode",
"name": "standard"
}
],
"descriptions": [
"A variable inside a dynamic family."
]
}
}
},
"rougail.var2": {
"type": "variable",
"default": [
"the value of the variable \"rougail.my_dyn_family_val1.var\"",
"the value of the variable \"rougail.my_dyn_family_val2.var\""
],
"properties": [
{
"type": "type",
"name": "string"
},
{
"type": "mode",
"name": "standard"
},
{
"type": "property",
"name": "mandatory"
},
{
"type": "property",
"name": "unique"
},
{
"type": "multiple",
"name": "multiple"
}
],
"paths": [
"rougail.var2"
],
"names": [
"var2"
],
"descriptions": [
"A variable."
]
}
}
}
}

View file

@ -0,0 +1,26 @@
---
gitea: none
include_toc: true
---
# Variables for "Rougail"
| Variable                                                                                                                       | Description                                                                                                                    |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **rougail.var**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | A suffix variable.<br/>**Default**: <br/>- val1<br/>- val2 |
## a dynamic family
`stand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sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **rougail.my_dyn_family_*val1*.var**<br/>**rougail.my_dyn_family_*val2*.var**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` | A variable inside a dynamic family.<br/>**Default**: the value of the identifier. |
| Variable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **rougail.var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | A variable.<br/>**Default**: <br/>- the value of the variable "rougail.my_dyn_family_*val1*.var"<br/>- the value of the variable "rougail.my_dyn_family_*val2*.var" |

View file

@ -0,0 +1,55 @@
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
Variables for "Rougail" ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
 Variable                               Description                           
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
rougail.var
string standard mandatory unique A suffix variable.
multiple
Default:
 • val1
 • val2
 |
a dynamic family
standard
This family builds families dynamically.
Identifiers: the value of the variable "rougail.var".
 Variable                               Description                           
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
rougail.my_dyn_family_val1.var
rougail.my_dyn_family_val2.var
string standard A variable inside a dynamic family.
Default: the value of the
identifier.
 Variable                                Description                          
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
rougail.var2
string standard mandatory unique A variable.
multiple
Default:
 • the value of the variable "rougail.my_dyn_family_val1.var"
 • the value of the variable "rougail.my_dyn_family_val2.var"
 |

View file

@ -40,7 +40,10 @@ A dynamic variable. +
This family builds families dynamically.
**Identifiers**: the value of the variable "rougail.dyn{{ suffix }}.var".
**Identifiers**:
* the value of the variable "rougail.dyn__val1__.var"
* the value of the variable "rougail.dyn__val2__.var"
[cols="1a,1a"]
|====

View file

@ -138,7 +138,10 @@
"name": "standard"
}
],
"identifiers": "the value of the variable \"rougail.dyn{{ suffix }}.var\".",
"identifiers": [
"the value of the variable \"rougail.dynval1.var\"",
"the value of the variable \"rougail.dynval2.var\""
],
"help": [
"This family builds families dynamically."
]

View file

@ -26,7 +26,7 @@ This family builds families dynamically.
This family builds families dynamically.
**Identifiers**: the value of the variable "rougail.dyn{{ suffix }}.var".
**Identifiers**: <br/>- the value of the variable "rougail.dyn*val1*.var"<br/>- the value of the variable "rougail.dyn*val2*.var"
| Variable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

View file

@ -45,7 +45,10 @@ This family builds families dynamically.
This family builds families dynamically.
Identifiers: the value of the variable "rougail.dyn{{ suffix }}.var".
Identifiers:
 • the value of the variable "rougail.dynval1.var"
 • the value of the variable "rougail.dynval2.var"

View file

@ -0,0 +1,20 @@
---
gitea: none
include_toc: true
---
# Example with all variables modifiable
```yaml
---
rougail:
var:
- val1
- val2
my_dyn_family_val1:
var: val1
my_dyn_family_val2:
var: val2
var2:
- val1
- val2
```