From 34554dd6a0b176b68b4c02babc9321cae236fb77 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 1 Dec 2025 22:25:58 +0100 Subject: [PATCH] [tutorial v1.1_101)] A choice variable (config and doc) --- README.md | 83 +++++++++++++++++++++++++++++----------- config/02/cmd_ro.txt | 1 + config/02/config.yml | 3 ++ config/02/output_ro.html | 12 ++++++ tree.html | 20 +++++----- 5 files changed, 87 insertions(+), 32 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 e48c1b0e..52d4dafa 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_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 @@ -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_100 +git switch --detach v1.1_101 ``` ## Structure @@ -39,16 +39,16 @@ git switch --detach v1.1_100

-.
- └── 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
+.
+ └── 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


Contents of the firefox/60-dns_over_https.yml file @@ -61,6 +61,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 ... ``` @@ -130,9 +141,10 @@ rougail -m firefox/ --modes_level basic standard advanced -o doc > **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" | ### Let's generate the changelog @@ -141,9 +153,9 @@ rougail -m firefox/ --modes_level basic standard advanced -o doc --doc.contents ``` #### 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" | ## User datas @@ -169,6 +181,33 @@ Variables: ┗━━ 📂 DNS over HTTPS ┗━━ 📓 Enable DNS over HTTPS: false +### 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 +``` +
╭────────────── Caption ───────────────╮
+│ Variable Default value               │
+│          Modified value              │
+│          (⏳ Original default value) │
+╰──────────────────────────────────────╯
+Variables:
+┣━━ 📓 Configure Proxy Access to the Internet: No proxy
+┗━━ 📂 DNS over HTTPS
+    ┣━━ 📓 Enable DNS over HTTPS: true ◀ loaded from the YAML file 
+    "config/02/config.yml" (⏳ false)
+    ┗━━ 📓 Use Provider: Cloudflare
+
+ + +- [[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)) diff --git a/config/02/cmd_ro.txt b/config/02/cmd_ro.txt new file mode 100644 index 00000000..b9994d96 --- /dev/null +++ b/config/02/cmd_ro.txt @@ -0,0 +1 @@ +rougail -m firefox/ --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..8a635449 --- /dev/null +++ b/config/02/output_ro.html @@ -0,0 +1,12 @@ +
╭────────────── Caption ───────────────╮
+│ Variable Default value               │
+│          Modified value              │
+│          (⏳ Original default value) │
+╰──────────────────────────────────────╯
+Variables:
+┣━━ 📓 Configure Proxy Access to the Internet: No proxy
+┗━━ 📂 DNS over HTTPS
+    ┣━━ 📓 Enable DNS over HTTPS: true ◀ loaded from the YAML file 
+    "config/02/config.yml" (⏳ false)
+    ┗━━ 📓 Use Provider: Cloudflare
+
diff --git a/tree.html b/tree.html index aee83da1..7b3f9850 100644 --- a/tree.html +++ b/tree.html @@ -25,16 +25,16 @@

Directory Tree

- .
- └── 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
+ .
+ └── 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


2 directories, 8 files