[tutorial v1.1_031] A variable with type's parameters (config and doc)

This commit is contained in:
egarette@silique.fr 2026-01-08 20:22:15 +01:00
parent 2cd85cd0f9
commit c3603b7ca5
6 changed files with 76 additions and 56 deletions

View file

@ -1,11 +1,11 @@
- [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md) - [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md)
- [[tutorial v1.1_022] Putting a variable inside of a family or a sub family](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_022/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_022~1..v1.1_022)) - [[tutorial v1.1_030] A variable with type "domainname"](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_030/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_030~1..v1.1_030))
# [tutorial v1.1_030] A variable with type "domainname" # [tutorial v1.1_031] A variable with type's parameters
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_030~1..v1.1_030) [View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_031~1..v1.1_031)
[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/disabled.html#a-variable-with-type-"domainname") [Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/disabled.html#a-variable-with-type's-parameters)
## Screenshot ## Screenshot
@ -31,7 +31,7 @@ pip install rougail-cli rougail-output-exporter rougail-output-doc rougail-user-
Then switch to the tutorial page: Then switch to the tutorial page:
```shell ```shell
git switch --detach v1.1_030 git switch --detach v1.1_031
``` ```
## Structure ## Structure
@ -39,10 +39,10 @@ git switch --detach v1.1_030
<p> <p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_030/./">.</a><br/> <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./">.</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_030/./firefox/">firefox</a><br/> └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/">firefox</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_030/./firefox/00-proxy.yml">00-proxy.yml</a><br/>     ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_030/./firefox/10-manual.yml">10-manual.yml</a><br/>     └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/10-manual.yml">10-manual.yml</a><br/>
<br/><br/></p> <br/><br/></p>
Contents of the firefox/10-manual.yml file Contents of the firefox/10-manual.yml file
@ -59,6 +59,8 @@ manual: # Manual proxy configuration
address: address:
description: HTTP address description: HTTP address
type: domainname type: domainname
params:
allow_ip: true
... ...
``` ```
@ -85,9 +87,9 @@ rougail -m firefox/ -o doc
> >
> **Path**: manual.http_proxy > **Path**: manual.http_proxy
| Variable | Description | | Variable | Description |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------| |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| **<a id="manual.http_proxy.address" name="manual.http_proxy.address">manual.http_proxy.address</a>**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address.<br/>**Validator**: type domainname | | **<a id="manual.http_proxy.address" name="manual.http_proxy.address">manual.http_proxy.address</a>**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address.<br/>**Validators**: <br/>&nbsp;type domainname<br/>&nbsp;the domain name can be an IP |
*** ***
@ -98,9 +100,9 @@ rougail -m firefox/ -o doc --doc.contents changelog
``` ```
#### Modified variable #### Modified variable
| Variable | Description | | Variable | Description |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------| |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| **<a id="manual.http_proxy.address" name="manual.http_proxy.address">manual.http_proxy.address</a>**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address.<br/>**Validator**: <ins>type domainname</ins> | | **<a id="manual.http_proxy.address" name="manual.http_proxy.address">manual.http_proxy.address</a>**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address.<br/>**Validators**: <br/>&nbsp;type domainname<br/>&nbsp;<ins>the domain name can be an IP</ins> |
*** ***
@ -156,13 +158,18 @@ manual:
```shell ```shell
rougail -m firefox/ -u yaml -yf config/02/config.yml rougail -m firefox/ -u yaml -yf config/02/config.yml
``` ```
> [!CAUTION] > [!NOTE]
> >
> - manual (Manual proxy configuration) > **Caption:**
> - http_proxy (HTTP Proxy) > - Variable
> - address (HTTP address) > - <span style="color: #B8860B">Default value</span>
> - [#EFBF04]:bell: the value "192.168.0.1" is an invalid domain name, must not be an IP, it will be ignored when loading from the YAML file "config/02/config.yml"[/#EFBF04] > - <span style="color: #006400">Modified value</span>
> - [#C23636]:stop_sign: mandatory variable but has no value[/#C23636]
Variables:
- :notebook: proxy_mode (Configure Proxy Access to the Internet): <span style="color: #B8860B">No proxy</span>
- :open_file_folder: manual (Manual proxy configuration)
- :open_file_folder: http_proxy (HTTP Proxy)
- :notebook: address (HTTP address): <span style="color: #006400">192.168.0.1</span> ← loaded from the YAML file "config/02/config.yml"
*** ***
#### Output when invalid user data is an error #### Output when invalid user data is an error
@ -170,11 +177,18 @@ rougail -m firefox/ -u yaml -yf config/02/config.yml
```shell ```shell
rougail -m firefox/ -u yaml -yf config/02/config.yml --cli.invalid_user_data_error rougail -m firefox/ -u yaml -yf config/02/config.yml --cli.invalid_user_data_error
``` ```
> [!CAUTION] > [!NOTE]
> >
> - manual (Manual proxy configuration) > **Caption:**
> - http_proxy (HTTP Proxy) > - Variable
> - address (HTTP address): :stop_sign: <span style="color: #C23636">the value "192.168.0.1" is an invalid domain name, must not be an IP, it has been loading from the YAML file "config/02/config.yml"</span> > - <span style="color: #B8860B">Default value</span>
> - <span style="color: #006400">Modified value</span>
Variables:
- :notebook: proxy_mode (Configure Proxy Access to the Internet): <span style="color: #B8860B">No proxy</span>
- :open_file_folder: manual (Manual proxy configuration)
- :open_file_folder: http_proxy (HTTP Proxy)
- :notebook: address (HTTP address): <span style="color: #006400">192.168.0.1</span> ← loaded from the YAML file "config/02/config.yml"
*** ***
### Example 3 ### Example 3
@ -200,7 +214,7 @@ rougail -m firefox/ -u yaml -yf config/03/config.yml
> - manual (Manual proxy configuration) > - manual (Manual proxy configuration)
> - http_proxy (HTTP Proxy) > - http_proxy (HTTP Proxy)
> - address (HTTP address) > - address (HTTP address)
> - [#EFBF04]:bell: the value "not a valid domain name.com" is an invalid domain name, must start with lowercase characters followed by lowercase characters, number, "-" and "." characters are allowed, it will be ignored when loading from the YAML file "config/03/config.yml"[/#EFBF04] > - [#EFBF04]:bell: the value "not a valid domain name.com" is an invalid domain name, could be a IP, otherwise must start with lowercase characters followed by lowercase characters, number, "-" and "." characters are allowed, it will be ignored when loading from the YAML file "config/03/config.yml"[/#EFBF04]
> - [#C23636]:stop_sign: mandatory variable but has no value[/#C23636] > - [#C23636]:stop_sign: mandatory variable but has no value[/#C23636]
*** ***
@ -213,9 +227,9 @@ rougail -m firefox/ -u yaml -yf config/03/config.yml --cli.invalid_user_data_err
> >
> - manual (Manual proxy configuration) > - manual (Manual proxy configuration)
> - http_proxy (HTTP Proxy) > - http_proxy (HTTP Proxy)
> - address (HTTP address): :stop_sign: <span style="color: #C23636">the value "not a valid domain name.com" is an invalid domain name, must start with lowercase characters followed by lowercase characters, number, "-" and "." characters are allowed, it has been loading from the YAML file "config/03/config.yml"</span> > - address (HTTP address): :stop_sign: <span style="color: #C23636">the value "not a valid domain name.com" is an invalid domain name, could be a IP, otherwise must start with lowercase characters followed by lowercase characters, number, "-" and "." characters are allowed, it has been loading from the YAML file "config/03/config.yml"</span>
*** ***
- [[tutorial v1.1_031] A variable with type's parameters](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_031~1..v1.1_031)) - [[tutorial v1.1_032] A variable with type "port"](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_032/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_032~1..v1.1_032))

View file

@ -1,7 +1,11 @@
<pre><span style="font-weight: bold; color: #ff0000">🛑 Caution</span> <pre>╭──────── Caption ────────╮
<span style="color: #ff0000">┗━━ </span>manual (Manual proxy configuration) │ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>http_proxy (HTTP Proxy) <span style="color: #00aa00">Modified value</span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>address (HTTP address): <span style="color: #ff0000">🛑 the value "192.168.0.1" is an invalid </span> ╰─────────────────────────╯
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">domain name, must not be an IP, it has been loading from the YAML </span> Variables:
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">file "config/02/config.yml"</span> <span style="color: #5c5cff">┣━━ </span>📓 proxy_mode (Configure Proxy Access to the Internet): <span style="color: #ffd700">No proxy</span>
<span style="color: #5c5cff">┗━━ </span>📂 manual (Manual proxy configuration)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📂 http_proxy (HTTP Proxy)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 address (HTTP address): <span style="color: #00aa00">192.168.0.1</span> ◀ loaded from the YAML file
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span>"config/02/config.yml"
</pre> </pre>

View file

@ -1,9 +1,11 @@
<pre><span style="font-weight: bold; color: #ff0000">🛑 Caution</span> <pre>╭──────── Caption ────────╮
<span style="color: #ff0000">┗━━ </span>manual (Manual proxy configuration) │ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>http_proxy (HTTP Proxy) <span style="color: #00aa00">Modified value</span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>address (HTTP address) ╰─────────────────────────╯
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┣━━ </span><span style="color: #ffff00">🔔 the value "192.168.0.1" is an invalid domain name, must not </span> Variables:
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"></span><span style="color: #ffff00">be an IP, it will be ignored when loading from the YAML file </span> <span style="color: #5c5cff">┣━━ </span>📓 proxy_mode (Configure Proxy Access to the Internet): <span style="color: #ffd700">No proxy</span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"></span><span style="color: #ffff00">"config/02/config.yml"</span> <span style="color: #5c5cff">┗━━ </span>📂 manual (Manual proxy configuration)
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span><span style="color: #ff0000">🛑 mandatory variable but has no value</span> <span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📂 http_proxy (HTTP Proxy)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 address (HTTP address): <span style="color: #00aa00">192.168.0.1</span> ◀ loaded from the YAML file
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span>"config/02/config.yml"
</pre> </pre>

View file

@ -2,8 +2,8 @@
<span style="color: #ff0000">┗━━ </span>manual (Manual proxy configuration) <span style="color: #ff0000">┗━━ </span>manual (Manual proxy configuration)
<span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>http_proxy (HTTP Proxy) <span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>http_proxy (HTTP Proxy)
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>address (HTTP address): <span style="color: #ff0000">🛑 the value "not a valid domain name.com" </span> <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>address (HTTP address): <span style="color: #ff0000">🛑 the value "not a valid domain name.com" </span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">is an invalid domain name, must start with lowercase characters </span> <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">is an invalid domain name, could be a IP, otherwise must start with </span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">followed by lowercase characters, number, "-" and "." characters are</span> <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">lowercase characters followed by lowercase characters, number, "-" </span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">allowed, it has been loading from the YAML file </span> <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">and "." characters are allowed, it has been loading from the YAML </span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">"config/03/config.yml"</span> <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">file "config/03/config.yml"</span>
</pre> </pre>

View file

@ -3,9 +3,9 @@
<span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>http_proxy (HTTP Proxy) <span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>http_proxy (HTTP Proxy)
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>address (HTTP address) <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>address (HTTP address)
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┣━━ </span><span style="color: #ffff00">🔔 the value "not a valid domain name.com" is an invalid domain </span> <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┣━━ </span><span style="color: #ffff00">🔔 the value "not a valid domain name.com" is an invalid domain </span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"></span><span style="color: #ffff00">name, must start with lowercase characters followed by lowercase</span> <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"></span><span style="color: #ffff00">name, could be a IP, otherwise must start with lowercase </span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"></span><span style="color: #ffff00">characters, number, "-" and "." characters are allowed, it will </span> <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"></span><span style="color: #ffff00">characters followed by lowercase characters, number, "-" and "."</span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"></span><span style="color: #ffff00">be ignored when loading from the YAML file </span> <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"></span><span style="color: #ffff00">characters are allowed, it will be ignored when loading from the</span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"></span><span style="color: #ffff00">"config/03/config.yml"</span> <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"></span><span style="color: #ffff00">YAML file "config/03/config.yml"</span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span><span style="color: #ff0000">🛑 mandatory variable but has no value</span> <span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span><span style="color: #ff0000">🛑 mandatory variable but has no value</span>
</pre> </pre>

View file

@ -1,6 +1,6 @@
<p> <p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_030/./">.</a><br/> <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./">.</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_030/./firefox/">firefox</a><br/> └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/">firefox</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_030/./firefox/00-proxy.yml">00-proxy.yml</a><br/>     ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_030/./firefox/10-manual.yml">10-manual.yml</a><br/>     └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/10-manual.yml">10-manual.yml</a><br/>
<br/><br/></p> <br/><br/></p>