From 2022c20632d5ca0165e80ccc8e3ba885ec7212be Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 23 Oct 2024 10:58:14 +0200 Subject: [PATCH] [tutorial 006] A variable with type choice (config and doc) --- README.md | 31 +++++++++++++++++++++---------- config/04/output_ro.html | 7 +++++-- config/05/output_ro.html | 3 ++- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 1f838b9..5190a6d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ - [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md) -- [[tutorial 004] The variable description](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_004/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_004~1..v1.1_004)) +- [[tutorial 005] A default value](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_005/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_005~1..v1.1_005)) -# [tutorial 005] A default value +# [tutorial 006] A variable with type choice -[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_005~1..v1.1_005) +[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_006~1..v1.1_006) ## Screenshot @@ -22,6 +22,13 @@ --- proxy_mode: description: Configure Proxy Access to the Internet + type: choice + choices: + - No proxy + - Auto-detect proxy settings for this network + - Use system proxy settings + - Manual proxy configuration + - Automatic proxy configuration URL default: No proxy ``` @@ -32,9 +39,9 @@ foo@bar:~$ rougail -v 1.1 -m firefox/ -o doc -do github ``` ### Variables -| Variable                                                                                        | Description                                                                                     | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **proxy_mode**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Configure Proxy Access to the Internet.
**Default**: No proxy | +| Variable                                                                                                                                                                                             | Description                                                                                                                                                                                          | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **proxy_mode**
[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Configure Proxy Access to the Internet.
**Choices**:
- No proxy ← (default)
- Auto-detect proxy settings for this network
- Use system proxy settings
- Manual proxy configuration
- Automatic proxy configuration URL | ## User data @@ -125,14 +132,17 @@ proxy_mode: foo ```console foo@bar:~$ rougail -v 1.1 -m firefox/ -u file -ff config/04/config.yaml ``` -
╭────────────────────────── Caption ──────────────────────────╮
+
🛑 ERRORS
+┗━━ "foo" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only "Auto-detect proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy configuration", "No
+    proxy" and "Use system proxy settings" are allowed
+╭────────────────────────── Caption ──────────────────────────╮
 │ Variable                           Default value            │
 │ Undocumented variable              Modified value           │
 │ Undocumented but modified variable (Original default value) │
 │ Unmodifiable variable                                       │
 ╰─────────────────────────────────────────────────────────────╯
 Variables:
-┗━━ 📓 proxy_mode: foo (No proxy)
+┗━━ 📓 proxy_mode: No proxy
 
### Example 5 @@ -150,7 +160,8 @@ proxy_mode: 1 foo@bar:~$ rougail -v 1.1 -m firefox/ -u file -ff config/05/config.yaml ```
🛑 ERRORS
-┗━━ "1" is an invalid string for "proxy_mode (Configure Proxy Access to the Internet)"
+┗━━ "1" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only "Auto-detect proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy configuration", "No 
+    proxy" and "Use system proxy settings" are allowed
 ╭────────────────────────── Caption ──────────────────────────╮
 │ Variable                           Default value            │
 │ Undocumented variable              Modified value           │
@@ -162,4 +173,4 @@ Variables:
 
-- [[tutorial 006] A variable with type choice](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_006/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_006~1..v1.1_006)) +- [[tutorial 007] Choice type is optional](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_007/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_007~1..v1.1_007)) diff --git a/config/04/output_ro.html b/config/04/output_ro.html index 55d31f3..3143f61 100644 --- a/config/04/output_ro.html +++ b/config/04/output_ro.html @@ -1,9 +1,12 @@ -
╭────────────────────────── Caption ──────────────────────────╮
+
🛑 ERRORS
+┗━━ "foo" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only "Auto-detect proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy configuration", "No
+    proxy" and "Use system proxy settings" are allowed
+╭────────────────────────── Caption ──────────────────────────╮
 │ Variable                           Default value            │
 │ Undocumented variable              Modified value           │
 │ Undocumented but modified variable (Original default value) │
 │ Unmodifiable variable                                       │
 ╰─────────────────────────────────────────────────────────────╯
 Variables:
-┗━━ 📓 proxy_mode: foo (No proxy)
+┗━━ 📓 proxy_mode: No proxy
 
diff --git a/config/05/output_ro.html b/config/05/output_ro.html index bf39385..3f037ac 100644 --- a/config/05/output_ro.html +++ b/config/05/output_ro.html @@ -1,5 +1,6 @@
🛑 ERRORS
-┗━━ "1" is an invalid string for "proxy_mode (Configure Proxy Access to the Internet)"
+┗━━ "1" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only "Auto-detect proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy configuration", "No 
+    proxy" and "Use system proxy settings" are allowed
 ╭────────────────────────── Caption ──────────────────────────╮
 │ Variable                           Default value            │
 │ Undocumented variable              Modified value           │