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

This commit is contained in:
egarette@silique.fr 2025-12-01 22:25:58 +01:00
parent e3bd605ac2
commit 34554dd6a0
5 changed files with 87 additions and 32 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_098] A variable in avanced mode](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_098/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_098~1..v1.1_098)) - [[tutorial v1.1_100] A boolean variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_100~1..v1.1_100))
# [tutorial v1.1_100)] A boolean variable # [tutorial v1.1_101)] A choice variable
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_100~1..v1.1_100) [View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_101~1..v1.1_101)
[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/calculation.html#a-boolean-variable) [Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/calculation.html#a-choice-variable)
## 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_100 git switch --detach v1.1_101
``` ```
## Structure ## Structure
@ -39,16 +39,16 @@ git switch --detach v1.1_100
<p> <p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./">.</a><br/> <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./">.</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/">firefox</a><br/> └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/">firefox</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/00-proxy.yml">00-proxy.yml</a><br/>     ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/10-manual.yml">10-manual.yml</a><br/>     ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/10-manual.yml">10-manual.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/20-manual.yml">20-manual.yml</a><br/>     ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/20-manual.yml">20-manual.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/30-auto.yml">30-auto.yml</a><br/>     ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/30-auto.yml">30-auto.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./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_101/./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_100/./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_101/./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_100/./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_101/./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_100/./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_101/./firefox/60-dns_over_https.yml">60-dns_over_https.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
@ -61,6 +61,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
... ...
``` ```
@ -131,8 +142,9 @@ rougail -m firefox/ --modes_level basic standard advanced -o doc
> `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" |
### Let's generate the changelog ### Let's generate the changelog
@ -142,8 +154,8 @@ rougail -m firefox/ --modes_level basic standard advanced -o doc --doc.contents
#### 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" |
## User datas ## User datas
@ -169,6 +181,33 @@ Variables:
<span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS <span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Enable DNS over HTTPS: <span style="color: #ffd700">false</span> <span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Enable DNS over HTTPS: <span style="color: #ffd700">false</span>
</pre> </pre>
### Example 2
#### config/02/config.yml
- [[tutorial v1.1_101] A choice variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_101~1..v1.1_101)) ```yml
---
dns_over_https:
enable_dns_over_https: true
```
#### Output
```shell
rougail -m firefox/ --modes_level basic standard advanced -u yaml -yf config/02/config.yml
```
<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>📓 Configure Proxy Access to the Internet: <span style="color: #ffd700">No proxy</span>
<span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Enable DNS over HTTPS: <span style="color: #00aa00">true</span> ◀ loaded from the YAML file
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"></span>"config/02/config.yml" (⏳ false)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Use Provider: <span style="color: #ffd700">Cloudflare</span>
</pre>
- [[tutorial v1.1_102] A web_address variable ](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_102/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_102~1..v1.1_102))

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

@ -0,0 +1 @@
rougail -m firefox/ --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>📓 Configure Proxy Access to the Internet: <span style="color: #ffd700">No proxy</span>
<span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Enable DNS over HTTPS: <span style="color: #00aa00">true</span> ◀ loaded from the YAML file
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"></span>"config/02/config.yml" (⏳ false)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Use Provider: <span style="color: #ffd700">Cloudflare</span>
</pre>

View file

@ -25,16 +25,16 @@
</head> </head>
<body> <body>
<h1>Directory Tree</h1><p> <h1>Directory Tree</h1><p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./">.</a><br> <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./">.</a><br>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/">firefox</a><br> └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/">firefox</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/00-proxy.yml">00-proxy.yml</a><br> &nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/00-proxy.yml">00-proxy.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/10-manual.yml">10-manual.yml</a><br> &nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/10-manual.yml">10-manual.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/20-manual.yml">20-manual.yml</a><br> &nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/20-manual.yml">20-manual.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/30-auto.yml">30-auto.yml</a><br> &nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/30-auto.yml">30-auto.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/40-no_proxy.yml">40-no_proxy.yml</a><br> &nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/40-no_proxy.yml">40-no_proxy.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/50-prompt_authentication.yml">50-prompt_authentication.yml</a><br> &nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/50-prompt_authentication.yml">50-prompt_authentication.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/55-proxy_dns_socks5.yml">55-proxy_dns_socks5.yml</a><br> &nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/55-proxy_dns_socks5.yml">55-proxy_dns_socks5.yml</a><br>
&nbsp;&nbsp;&nbsp; └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/./firefox/60-dns_over_https.yml">60-dns_over_https.yml</a><br> &nbsp;&nbsp;&nbsp; └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_101/./firefox/60-dns_over_https.yml">60-dns_over_https.yml</a><br>
<br><br><p> <br><br><p>
2 directories, 8 files 2 directories, 8 files