rougail-output-doc/tests/docs/no_namespace/04_7validators_variable_optional.md

49 lines
5.5 KiB
Markdown
Raw Normal View History

2024-07-10 21:27:48 +02:00
---
gitea: none
include_toc: true
---
# dictionaries/rougail/00-base.yml
```yaml
---
version: '1.1'
general: # a family
int:
description: a first number
type: number
test:
- 5
2024-07-10 21:27:48 +02:00
validators:
- jinja: |
2024-07-10 21:27:48 +02:00
{% if _.int == int2 %}
int and int2 must be different
{% endif %}
params:
int2:
variable: _.int2
optional: true
description: int and int2 must be different
- jinja: |
{% if int3 is defined and _.int == int3 %}
2024-07-10 21:27:48 +02:00
int and int3 must be different
{% endif %}
params:
int3:
variable: _.int3
optional: true
description: int and int3 must be different
int2: 1 # a second number
```
# Variables
## a family
`basic`
| Variable                                                                                                     | Description                                                                                                  |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **general.int**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | A first number.<br/>**Validators**:<br/>- int and int2 must be different.<br/>- int and int3 must be different.<br/>**Exemple**: 5 |
| **general.int2**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | A second number.<br/>**Défaut**: 1 |
2024-07-10 21:27:48 +02:00