[tutorial v1.1_022] Putting a variable inside of a family or a sub family (config and doc)

This commit is contained in:
egarette@silique.fr 2026-01-08 20:22:09 +01:00
parent 007cfdce55
commit 92f70fdae8
11 changed files with 183 additions and 17 deletions

148
README.md
View file

@ -1,11 +1,11 @@
- [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md)
- [[tutorial v1.1_020] Creating a new family](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_020/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_020~1..v1.1_020))
- [[tutorial v1.1_021] Or a sub family](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_021/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_021~1..v1.1_021))
# [tutorial v1.1_021] Or a sub family
# [tutorial v1.1_022] Putting a variable inside of a family or a sub family
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_021~1..v1.1_021)
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_022~1..v1.1_022)
[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/proxymode.html#or-a-sub-family)
[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/proxymode.html#putting-a-variable-inside-of-a-family-or-a-sub-family)
## Screenshot
@ -31,7 +31,7 @@ pip install rougail-cli rougail-output-exporter rougail-output-doc rougail-user-
Then switch to the tutorial page:
```shell
git switch --detach v1.1_021
git switch --detach v1.1_022
```
## Structure
@ -39,10 +39,10 @@ git switch --detach v1.1_021
<p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_021/./">.</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_021/./firefox/">firefox</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_021/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_021/./firefox/10-manual.yml">10-manual.yml</a><br/>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_022/./">.</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_022/./firefox/">firefox</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_022/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_022/./firefox/10-manual.yml">10-manual.yml</a><br/>
<br/><br/></p>
Contents of the firefox/10-manual.yml file
@ -54,9 +54,9 @@ version: 1.1
manual: # Manual proxy configuration
http_proxy:
description: HTTP Proxy
type: family
http_proxy: # HTTP Proxy
address: # HTTP address
...
```
@ -71,8 +71,130 @@ rougail -m firefox/ -o doc
|------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **<a id="proxy_mode" name="proxy_mode">proxy_mode</a>**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Configure Proxy Access to the Internet.<br/>**Choices**: <br/>&nbsp;No proxy **← (default)**<br/>&nbsp;Auto-detect proxy settings for this network<br/>&nbsp;Use system proxy settings<br/>&nbsp;Manual proxy configuration<br/>&nbsp;Automatic proxy configuration URL |
#### Manual proxy configuration
> [!NOTE]
>
> **Path**: manual
##### HTTP Proxy
> [!NOTE]
>
> **Path**: manual.http_proxy
| Variable | Description |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
| **<a id="manual.http_proxy.address" name="manual.http_proxy.address">manual.http_proxy.address</a>**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address. |
***
### Let's generate the changelog
```shell
rougail -m firefox/ -o doc --doc.contents changelog
```
#### New variable
| Variable | Description |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
| **<a id="manual.http_proxy.address" name="manual.http_proxy.address">manual.http_proxy.address</a>**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address. |
***
## User datas
### Example 1
#### config/01/config.yml
```yml
---
```
***
#### Output
```shell
rougail -m firefox/ -u yaml -yf config/01/config.yml
```
> [!CAUTION]
>
> - manual (Manual proxy configuration)
> - http_proxy (HTTP Proxy)
> - address (HTTP address): :stop_sign: <span style="color: #C23636">mandatory variable but has no value</span>
***
### Example 2
#### config/02/config.yml
```yml
---
manual:
http_proxy:
address: example.net
```
***
#### Output
```shell
rougail -m firefox/ -u yaml -yf config/02/config.yml
```
> [!NOTE]
>
> **Caption:**
> - Variable
> - <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">example.net</span> ← loaded from the YAML file "config/02/config.yml"
***
### Example 3
#### config/03/config.yml
```yml
---
manual:
http_proxy:
address: example.net
port: 3128
```
***
#### Output
```shell
rougail -m firefox/ -u yaml -yf config/03/config.yml
```
> [!WARNING]
>
> - variable or family "manual.http_proxy.port" does not exist, it will be ignored when loading from the YAML file "config/03/config.yml"
> [!NOTE]
>
> **Caption:**
> - Variable
> - <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">example.net</span> ← loaded from the YAML file "config/03/config.yml"
***
- [[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))

1
config/01/cmd_ro.txt Normal file
View file

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

1
config/01/config.yml Normal file
View file

@ -0,0 +1 @@
---

5
config/01/output_ro.html Normal file
View file

@ -0,0 +1,5 @@
<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>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">🛑 mandatory variable but has no value</span>
</pre>

1
config/02/cmd_ro.txt Normal file
View file

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

4
config/02/config.yml Normal file
View file

@ -0,0 +1,4 @@
---
manual:
http_proxy:
address: example.net

11
config/02/output_ro.html Normal file
View file

@ -0,0 +1,11 @@
<pre>╭──────── Caption ────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #00aa00">Modified value</span>
╰─────────────────────────╯
Variables:
<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">example.net</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>

1
config/03/cmd_ro.txt Normal file
View file

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

5
config/03/config.yml Normal file
View file

@ -0,0 +1,5 @@
---
manual:
http_proxy:
address: example.net
port: 3128

15
config/03/output_ro.html Normal file
View file

@ -0,0 +1,15 @@
<pre><span style="font-weight: bold; color: #ffff00">🔔 Warning</span>
<span style="color: #ffff00">┗━━ </span>variable or family "manual.http_proxy.port" does not exist, it will be
<span style="color: #ffff00"> </span>ignored when loading from the YAML file "config/03/config.yml"
╭──────── Caption ────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #00aa00">Modified value</span>
╰─────────────────────────╯
Variables:
<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">example.net</span> ◀ loaded from the YAML file
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span>"config/03/config.yml"
</pre>

View file

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