rougail-output-doc/tests/docs/base/04_7validators_variable_optional.adoc

60 lines
1.9 KiB
Text
Raw Permalink Normal View History

2024-07-10 21:27:48 +02:00
== 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 pour "rougail"
2024-07-10 21:27:48 +02:00
=== a family
`basic`
[cols="110a,110a",options="header"]
2024-07-10 21:27:48 +02:00
|====
| Variable | Description
2024-07-10 21:27:48 +02:00
|
**rougail.general.int** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `basic` `obligatoire` |
2024-07-10 21:27:48 +02:00
A first number. +
**Validators**:
* int and int2 must be different.
* int and int3 must be different.
**Exemple**: 5
2024-07-10 21:27:48 +02:00
|
**rougail.general.int2** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `obligatoire` |
2024-07-10 21:27:48 +02:00
A second number. +
**Défaut**: 1
2024-07-10 21:27:48 +02:00
|====