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

38 lines
5.1 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'
var1:
description: a first variable
type: string
default: oui
validators:
- type: jinja
jinja: |
{% if _.var1 == _.var2 %}
var1 must be different than var2
{% endif %}
description: var1 must be different than var2
var2: no # A second variable
```
# Variables
| Variable                                                                                                   | Description                                                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A first variable.<br/>**Validator**: var1 must be different than var2.<br/>**Default**: oui |
| **var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A second variable.<br/>**Default**: no |
# Example with all variables modifiable
```yaml
---
var1: oui
var2: no
```