From e14a5e6c87ea61ea5d192d8440f9820b635b1dff Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 7 Mar 2026 20:37:00 +0100 Subject: [PATCH] [tutorial v1.1_111] A choice variable (config and doc) --- README.md | 94 +++++++++++++++++++++++++++++----------- config/02/cmd_ro.txt | 1 + config/02/config.yml | 3 ++ config/02/output_ro.html | 12 +++++ tree.html | 26 +++++------ 5 files changed, 98 insertions(+), 38 deletions(-) create mode 100644 config/02/cmd_ro.txt create mode 100644 config/02/config.yml create mode 100644 config/02/output_ro.html diff --git a/README.md b/README.md index a368e2ef..436a0a78 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ - [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md) -- [[tutorial v1.1_108] A variable in avanced mode](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_108/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_108~1..v1.1_108)) +- [[tutorial v1.1_110] A boolean variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_110~1..v1.1_110)) -# [tutorial v1.1_110] A boolean variable +# [tutorial v1.1_111] A choice variable -[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_110~1..v1.1_110) +[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_111~1..v1.1_111) -[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/jinja.html#a-boolean-variable) +[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/jinja.html#a-choice-variable) ## 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_110 +git switch --detach v1.1_111 ``` ## Structure @@ -39,19 +39,19 @@ git switch --detach v1.1_110

-.
- ├── firefox
- │   ├── 00-proxy.yml
- │   ├── 10-manual.yml
- │   ├── 20-manual.yml
- │   ├── 30-auto.yml
- │   ├── 40-no_proxy.yml
- │   ├── 50-prompt_authentication.yml
- │   ├── 55-proxy_dns_socks5.yml
- │   └── 60-dns_over_https.yml
- └── types
-     └── proxy
-         └── 00_type.yml
+.
+ ├── firefox
+ │   ├── 00-proxy.yml
+ │   ├── 10-manual.yml
+ │   ├── 20-manual.yml
+ │   ├── 30-auto.yml
+ │   ├── 40-no_proxy.yml
+ │   ├── 50-prompt_authentication.yml
+ │   ├── 55-proxy_dns_socks5.yml
+ │   └── 60-dns_over_https.yml
+ └── types
+     └── proxy
+         └── 00_type.yml


Contents of the firefox/60-dns_over_https.yml file @@ -64,6 +64,17 @@ version: 1.1 dns_over_https: # 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 ... ``` @@ -142,9 +153,10 @@ rougail -m firefox/ --types types/proxy --modes_level basic standard advanced -o > **Path**: dns_over_https\ > `standard` -| Variable | Description | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------| -| **dns_over_https.enable_dns_over_https**
[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Enable DNS over HTTPS.
**Default**: false | +| Variable | Description | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **dns_over_https.enable_dns_over_https**
[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Enable DNS over HTTPS.
**Default**: false | +| **dns_over_https.provider**
[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` *`disabled`* | Use Provider.
**Choices**:
• Cloudflare **← (default)**
• NextDNS
• Custom
**Disabled**: when the variable "[Enable DNS over HTTPS](#dns_over_https.enable_dns_over_https)" has the value "false" | *** @@ -155,9 +167,9 @@ rougail -m firefox/ --types types/proxy --modes_level basic standard advanced -o ``` #### New variable -| Variable | Description | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------| -| **dns_over_https.enable_dns_over_https**
[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Enable DNS over HTTPS.
**Default**: false | +| Variable | Description | +|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **dns_over_https.provider**
[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` *`disabled`* | Use Provider.
**Choices**:
• Cloudflare **← (default)**
• NextDNS
• Custom
**Disabled**: when the variable "[Enable DNS over HTTPS](#dns_over_https.enable_dns_over_https)" has the value "false" | *** @@ -190,6 +202,38 @@ Variables: - :notebook: enable_dns_over_https (Enable DNS over HTTPS): false *** +### Example 2 + +#### config/02/config.yml -- [[tutorial v1.1_111] A choice variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_111/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_111~1..v1.1_111)) +```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 +> - Default value +> - Modified value +> - (:hourglass_flowing_sand: Original default value) + +Variables: +- :notebook: proxy_mode (Configure Proxy Access to the Internet): No proxy +- :open_file_folder: dns_over_https (DNS over HTTPS) + - :notebook: enable_dns_over_https (Enable DNS over HTTPS): true ← loaded from the YAML file "config/02/config.yml" (:hourglass_flowing_sand: false) + - :notebook: provider (Use Provider): Cloudflare + +*** + + +- [[tutorial v1.1_112] A web_address variable ](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_112/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_112~1..v1.1_112)) diff --git a/config/02/cmd_ro.txt b/config/02/cmd_ro.txt new file mode 100644 index 00000000..44796ffd --- /dev/null +++ b/config/02/cmd_ro.txt @@ -0,0 +1 @@ +rougail -m firefox/ --types types/proxy --modes_level basic standard advanced -u yaml -yf config/02/config.yml \ No newline at end of file diff --git a/config/02/config.yml b/config/02/config.yml new file mode 100644 index 00000000..aee4796f --- /dev/null +++ b/config/02/config.yml @@ -0,0 +1,3 @@ +--- +dns_over_https: + enable_dns_over_https: true diff --git a/config/02/output_ro.html b/config/02/output_ro.html new file mode 100644 index 00000000..de930b83 --- /dev/null +++ b/config/02/output_ro.html @@ -0,0 +1,12 @@ +
╭────────────── Caption ───────────────╮
+│ Variable Default value               │
+│          Modified value              │
+│          (⏳ Original default value) │
+╰──────────────────────────────────────╯
+Variables:
+┣━━ 📓 proxy_mode (Configure Proxy Access to the Internet): No proxy
+┗━━ 📂 dns_over_https (DNS over HTTPS)
+    ┣━━ 📓 enable_dns_over_https (Enable DNS over HTTPS): true ◀ loaded from the
+    YAML file "config/02/config.yml" (⏳ false)
+    ┗━━ 📓 provider (Use Provider): Cloudflare
+
diff --git a/tree.html b/tree.html index a46475fd..2cc0e098 100644 --- a/tree.html +++ b/tree.html @@ -1,15 +1,15 @@

-.
- ├── firefox
- │   ├── 00-proxy.yml
- │   ├── 10-manual.yml
- │   ├── 20-manual.yml
- │   ├── 30-auto.yml
- │   ├── 40-no_proxy.yml
- │   ├── 50-prompt_authentication.yml
- │   ├── 55-proxy_dns_socks5.yml
- │   └── 60-dns_over_https.yml
- └── types
-     └── proxy
-         └── 00_type.yml
+.
+ ├── firefox
+ │   ├── 00-proxy.yml
+ │   ├── 10-manual.yml
+ │   ├── 20-manual.yml
+ │   ├── 30-auto.yml
+ │   ├── 40-no_proxy.yml
+ │   ├── 50-prompt_authentication.yml
+ │   ├── 55-proxy_dns_socks5.yml
+ │   └── 60-dns_over_https.yml
+ └── types
+     └── proxy
+         └── 00_type.yml


\ No newline at end of file