[tutorial v1.1_141] A choice variable (config and doc)

This commit is contained in:
egarette@silique.fr 2026-03-12 08:11:03 +01:00
parent 6584b103c9
commit 8176eae975
5 changed files with 97 additions and 37 deletions

View file

@ -1,9 +1,9 @@
- [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_130] A variable in avanced mode](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_130/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_140~1..v1.1_140)) - [[tutorial v1.1_140] A boolean variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_141~1..v1.1_141))
# [tutorial v1.1_140] A boolean variable # [tutorial v1.1_141] A choice variable
[Read the tutorial "A boolean variable" in the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/jinja.html#a-boolean-variable) [Read the tutorial "A choice variable" in the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/jinja.html#a-choice-variable)
## Screenshot ## Screenshot
@ -29,7 +29,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_140 git switch --detach v1.1_141
``` ```
## Structure ## Structure
@ -37,19 +37,19 @@ git switch --detach v1.1_140
<p> <p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./">.</a><br/> <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./">.</a><br/>
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/">firefox</a><br/> ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/">firefox</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/00-proxy.yml">00-proxy.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/10-manual.yml">10-manual.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/10-manual.yml">10-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/20-manual.yml">20-manual.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/20-manual.yml">20-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/30-auto.yml">30-auto.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/30-auto.yml">30-auto.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/40-no_proxy.yml">40-no_proxy.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/40-no_proxy.yml">40-no_proxy.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/50-prompt_authentication.yml">50-prompt_authentication.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/50-prompt_authentication.yml">50-prompt_authentication.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/55-proxy_dns_socks5.yml">55-proxy_dns_socks5.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/55-proxy_dns_socks5.yml">55-proxy_dns_socks5.yml</a><br/>
│   └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/60-dns_over_https.yml">60-dns_over_https.yml</a><br/> │   └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/60-dns_over_https.yml">60-dns_over_https.yml</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./types/">types</a><br/> └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./types/">types</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./types/proxy/">proxy</a><br/>     └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./types/proxy/">proxy</a><br/>
        └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./types/proxy/00_type.yml">00_type.yml</a><br/>         └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./types/proxy/00_type.yml">00_type.yml</a><br/>
<br/><br/></p> <br/><br/></p>
Contents of the firefox/60-dns_over_https.yml file Contents of the firefox/60-dns_over_https.yml file
@ -62,6 +62,17 @@ version: 1.1
dns_over_https: # DNS over HTTPS dns_over_https: # DNS over HTTPS
enable_dns_over_https: false # Enable DNS over HTTPS enable_dns_over_https: false # Enable DNS over HTTPS
provider:
description: Use Provider
choices:
- Cloudflare
- NextDNS
- Custom
default: Cloudflare
disabled:
variable: _.enable_dns_over_https
when: false
... ...
``` ```
@ -140,9 +151,10 @@ rougail -m firefox/ --types types/proxy --modes_level basic standard advanced -o
> **Path**: dns_over_https\ > **Path**: dns_over_https\
> `standard` > `standard`
| Variable | Description | | Variable | Description |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------| |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **<a id="dns_over_https.enable_dns_over_https" name="dns_over_https.enable_dns_over_https">dns_over_https.enable_dns_over_https</a>**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Enable DNS over HTTPS.<br/>**Default**: false | | **<a id="dns_over_https.enable_dns_over_https" name="dns_over_https.enable_dns_over_https">dns_over_https.enable_dns_over_https</a>**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Enable DNS over HTTPS.<br/>**Default**: false |
| **<a id="dns_over_https.provider" name="dns_over_https.provider">dns_over_https.provider</a>**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` *`disabled`* | Use Provider.<br/>**Choices**: <br/>&nbsp;Cloudflare **← (default)**<br/>&nbsp;NextDNS<br/>&nbsp;Custom<br/>**Disabled**: when the variable "[Enable DNS over HTTPS](#dns_over_https.enable_dns_over_https)" has the value "false" |
*** ***
@ -153,9 +165,9 @@ rougail -m firefox/ --types types/proxy --modes_level basic standard advanced -o
``` ```
#### New variable #### New variable
| Variable | Description | | Variable | Description |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------| |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **<a id="dns_over_https.enable_dns_over_https" name="dns_over_https.enable_dns_over_https">dns_over_https.enable_dns_over_https</a>**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Enable DNS over HTTPS.<br/>**Default**: false | | **<a id="dns_over_https.provider" name="dns_over_https.provider">dns_over_https.provider</a>**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` *`disabled`* | Use Provider.<br/>**Choices**: <br/>&nbsp;Cloudflare **← (default)**<br/>&nbsp;NextDNS<br/>&nbsp;Custom<br/>**Disabled**: when the variable "[Enable DNS over HTTPS](#dns_over_https.enable_dns_over_https)" has the value "false" |
*** ***
@ -188,6 +200,38 @@ Variables:
- :notebook: enable_dns_over_https (Enable DNS over HTTPS): <span style="color: #B8860B">false</span> - :notebook: enable_dns_over_https (Enable DNS over HTTPS): <span style="color: #B8860B">false</span>
*** ***
### Example 2
#### config/02/config.yml
- [[tutorial v1.1_141] A choice variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_141~1..v1.1_141)) ```yml
---
dns_over_https:
enable_dns_over_https: true
```
***
#### Output
```shell
rougail -m firefox/ --types types/proxy --modes_level basic standard advanced -u yaml -yf config/02/config.yml
```
> [!NOTE]
>
> **Caption:**
> - Variable
> - <span style="color: #B8860B">Default value</span>
> - <span style="color: #006400">Modified value</span>
> - (:hourglass_flowing_sand: Original default value)
Variables:
- :notebook: proxy_mode (Configure Proxy Access to the Internet): <span style="color: #B8860B">No proxy</span>
- :open_file_folder: dns_over_https (DNS over HTTPS)
- :notebook: enable_dns_over_https (Enable DNS over HTTPS): <span style="color: #006400">true</span> ← loaded from the YAML file "config/02/config.yml" (:hourglass_flowing_sand: false)
- :notebook: provider (Use Provider): <span style="color: #B8860B">Cloudflare</span>
***
- [[tutorial v1.1_142] A web_address variable ](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_142/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_142~1..v1.1_142))

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

@ -0,0 +1 @@
rougail -m firefox/ --types types/proxy --modes_level basic standard advanced -u yaml -yf config/02/config.yml

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

@ -0,0 +1,3 @@
---
dns_over_https:
enable_dns_over_https: true

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

@ -0,0 +1,12 @@
<pre>╭────────────── Caption ───────────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #00aa00">Modified value</span>
│ (⏳ Original default value) │
╰──────────────────────────────────────╯
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>📂 dns_over_https (DNS over HTTPS)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 enable_dns_over_https (Enable DNS over HTTPS): <span style="color: #00aa00">true</span> ◀ loaded from the
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"></span>YAML file "config/02/config.yml" (⏳ false)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 provider (Use Provider): <span style="color: #ffd700">Cloudflare</span>
</pre>

View file

@ -1,15 +1,15 @@
<p> <p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./">.</a><br/> <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./">.</a><br/>
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/">firefox</a><br/> ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/">firefox</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/00-proxy.yml">00-proxy.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/10-manual.yml">10-manual.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/10-manual.yml">10-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/20-manual.yml">20-manual.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/20-manual.yml">20-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/30-auto.yml">30-auto.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/30-auto.yml">30-auto.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/40-no_proxy.yml">40-no_proxy.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/40-no_proxy.yml">40-no_proxy.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/50-prompt_authentication.yml">50-prompt_authentication.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/50-prompt_authentication.yml">50-prompt_authentication.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/55-proxy_dns_socks5.yml">55-proxy_dns_socks5.yml</a><br/> │   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/55-proxy_dns_socks5.yml">55-proxy_dns_socks5.yml</a><br/>
│   └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./firefox/60-dns_over_https.yml">60-dns_over_https.yml</a><br/> │   └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./firefox/60-dns_over_https.yml">60-dns_over_https.yml</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./types/">types</a><br/> └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./types/">types</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./types/proxy/">proxy</a><br/>     └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./types/proxy/">proxy</a><br/>
        └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_140/./types/proxy/00_type.yml">00_type.yml</a><br/>         └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_141/./types/proxy/00_type.yml">00_type.yml</a><br/>
<br/><br/></p> <br/><br/></p>