[tutorial v1.1_050] A calculated default value (config and doc)

This commit is contained in:
egarette@silique.fr 2026-01-06 16:53:34 +01:00
parent 7453e7b8ac
commit f048e14479
6 changed files with 33 additions and 72 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_042] A hidden family](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_042/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_042~1..v1.1_042)) - [[tutorial v1.1_043] A conditional hidden family](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_043/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_043~1..v1.1_043))
# [tutorial v1.1_043] A conditional hidden family # [tutorial v1.1_050] A calculated default value
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_043~1..v1.1_043) [View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_050~1..v1.1_050)
[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/disabled.html#a-conditional-hidden-family) [Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/disabled.html#a-calculated-default-value)
## 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_043 git switch --detach v1.1_050
``` ```
## Structure ## Structure
@ -39,11 +39,11 @@ git switch --detach v1.1_043
<p> <p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_043/./">.</a><br/> <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_050/./">.</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_043/./firefox/">firefox</a><br/> └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_050/./firefox/">firefox</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_043/./firefox/00-proxy.yml">00-proxy.yml</a><br/>     ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_050/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_043/./firefox/10-manual.yml">10-manual.yml</a><br/>     ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_050/./firefox/10-manual.yml">10-manual.yml</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_043/./firefox/20-manual.yml">20-manual.yml</a><br/>     └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_050/./firefox/20-manual.yml">20-manual.yml</a><br/>
<br/><br/></p> <br/><br/></p>
Contents of the firefox/20-manual.yml file Contents of the firefox/20-manual.yml file
@ -64,14 +64,13 @@ manual:
address: address:
description: HTTPS address description: HTTPS address
type: domainname default:
params: variable: __.http_proxy.address
allow_ip: true
port: port:
description: HTTPS Port description: HTTPS Port
type: port default:
default: 8080 variable: __.http_proxy.port
... ...
``` ```
@ -115,22 +114,22 @@ rougail -m firefox/ -o doc
> *`hidden`*\ > *`hidden`*\
> **Hidden**: when the variable "[Also use this proxy for HTTPS](#manual.use_for_https)" has the value "true" > **Hidden**: when the variable "[Also use this proxy for HTTPS](#manual.use_for_https)" has the value "true"
| Variable | Description | | Variable | Description |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **<a id="manual.https_proxy.address" name="manual.https_proxy.address">manual.https_proxy.address</a>**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTPS address.<br/>**Validators**: <br/>&nbsp;type domainname<br/>&nbsp;the domain name can be an IP | | **<a id="manual.https_proxy.address" name="manual.https_proxy.address">manual.https_proxy.address</a>**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTPS address.<br/>**Validators**: <br/>&nbsp;type domainname<br/>&nbsp;the domain name can be an IP<br/>**Default**: the value of the variable "[HTTP address](#manual.http_proxy.address)" |
| **<a id="manual.https_proxy.port" name="manual.https_proxy.port">manual.https_proxy.port</a>**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTPS Port.<br/>**Validators**: <br/>&nbsp;well-known ports (1 to 1023) are allowed<br/>&nbsp;registred ports (1024 to 49151) are allowed<br/>&nbsp;private ports (greater than 49152) are allowed<br/>**Default**: 8080 | | **<a id="manual.https_proxy.port" name="manual.https_proxy.port">manual.https_proxy.port</a>**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTPS Port.<br/>**Validators**: <br/>&nbsp;well-known ports (1 to 1023) are allowed<br/>&nbsp;registred ports (1024 to 49151) are allowed<br/>&nbsp;private ports (greater than 49152) are allowed<br/>**Default**: the value of the variable "[HTTP Port](#manual.http_proxy.port)" |
### Let's generate the changelog ### Let's generate the changelog
```shell ```shell
rougail -m firefox/ -o doc --doc.contents changelog rougail -m firefox/ -o doc --doc.contents changelog
``` ```
#### New variables #### Modified variables
| Variable | Description | | Variable | Description |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **<a id="manual.https_proxy.address" name="manual.https_proxy.address">manual.https_proxy.address</a>**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTPS address.<br/>**Validators**: <br/>&nbsp;type domainname<br/>&nbsp;the domain name can be an IP | | **<a id="manual.https_proxy.address" name="manual.https_proxy.address">manual.https_proxy.address</a>**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTPS address.<br/>**Validators**: <br/>&nbsp;type domainname<br/>&nbsp;the domain name can be an IP<br/>**Default**: <ins>the value of the variable "[HTTP address](#manual.http_proxy.address)"</ins> |
| **<a id="manual.https_proxy.port" name="manual.https_proxy.port">manual.https_proxy.port</a>**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTPS Port.<br/>**Validators**: <br/>&nbsp;well-known ports (1 to 1023) are allowed<br/>&nbsp;registred ports (1024 to 49151) are allowed<br/>&nbsp;private ports (greater than 49152) are allowed<br/>**Default**: 8080 | | **<a id="manual.https_proxy.port" name="manual.https_proxy.port">manual.https_proxy.port</a>**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTPS Port.<br/>**Validators**: <br/>&nbsp;well-known ports (1 to 1023) are allowed<br/>&nbsp;registred ports (1024 to 49151) are allowed<br/>&nbsp;private ports (greater than 49152) are allowed<br/>**Default**: ~~8080~~<br/><ins>the value of the variable "[HTTP Port](#manual.http_proxy.port)"</ins> |
## User datas ## User datas
@ -172,32 +171,8 @@ Variables:
- :notebook: port (HTTP Port): <span style="color: #006400">3128</span> ← loaded from the YAML file "config/01/config.yml" (:hourglass_flowing_sand: 8080) - :notebook: port (HTTP Port): <span style="color: #006400">3128</span> ← loaded from the YAML file "config/01/config.yml" (:hourglass_flowing_sand: 8080)
- :notebook: use_for_https (Also use this proxy for HTTPS): <span style="color: #006400">false</span> ← loaded from the YAML file "config/01/config.yml" (:hourglass_flowing_sand: true) - :notebook: use_for_https (Also use this proxy for HTTPS): <span style="color: #006400">false</span> ← loaded from the YAML file "config/01/config.yml" (:hourglass_flowing_sand: true)
- :open_file_folder: https_proxy (HTTPS Proxy) - :open_file_folder: https_proxy (HTTPS Proxy)
- :notebook: address (HTTPS address): <span style="color: #006400">https.proxy.net</span> ← loaded from the YAML file "config/01/config.yml" - :notebook: address (HTTPS address): <span style="color: #006400">https.proxy.net</span> ← loaded from the YAML file "config/01/config.yml" (:hourglass_flowing_sand: http.proxy.net)
- :notebook: port (HTTPS Port): <span style="color: #B8860B">8080</span> - :notebook: port (HTTPS Port): <span style="color: #B8860B">3128</span>
### Example 2
#### config/02/config.yml
```yml - [[tutorial v1.1_060] Family: a dynamic family](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_060/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_060~1..v1.1_060))
---
proxy_mode: Manual proxy configuration
manual:
http_proxy:
address: http.proxy.net
port: 3128
use_for_https: true
```
#### Output
```shell
rougail -m firefox/ -u yaml -yf config/02/config.yml
```
> [!CAUTION]
>
> - manual (Manual proxy configuration)
> - https_proxy (HTTPS Proxy)
> - address (HTTPS address): :stop_sign: <span style="color: #C23636">mandatory variable but is inaccessible and has no value</span>
- [[tutorial v1.1_050] A calculated default value](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_050/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_050~1..v1.1_050))

View file

@ -17,6 +17,6 @@ Variables:
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"></span>the YAML file "config/01/config.yml" (⏳ true) <span style="color: #5c5cff"> </span><span style="color: #5c5cff"></span>the YAML file "config/01/config.yml" (⏳ true)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📂 https_proxy (HTTPS Proxy) <span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📂 https_proxy (HTTPS Proxy)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 address (HTTPS address): <span style="color: #00aa00">https.proxy.net</span> ◀ loaded from the YAML <span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 address (HTTPS address): <span style="color: #00aa00">https.proxy.net</span> ◀ loaded from the YAML
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff"></span>file "config/01/config.yml" <span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff"></span>file "config/01/config.yml" (⏳ http.proxy.net)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 port (HTTPS Port): <span style="color: #ffd700">8080</span> <span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 port (HTTPS Port): <span style="color: #ffd700">3128</span>
</pre> </pre>

View file

@ -1 +0,0 @@
rougail -m firefox/ -u yaml -yf config/02/config.yml

View file

@ -1,7 +0,0 @@
---
proxy_mode: Manual proxy configuration
manual:
http_proxy:
address: http.proxy.net
port: 3128
use_for_https: true

View file

@ -1,6 +0,0 @@
<pre><span style="font-weight: bold; color: #ff0000">🛑 Caution</span>
<span style="color: #ff0000">┗━━ </span>manual (Manual proxy configuration)
<span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>https_proxy (HTTPS Proxy)
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">┗━━ </span>address (HTTPS address): <span style="color: #ff0000">🛑 mandatory variable but is inaccessible </span>
<span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000"> </span><span style="color: #ff0000">and has no value</span>
</pre>

View file

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