From 7443c4bf1c3d540140f43051aa60be557c4ee097 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 23 Oct 2024 20:01:44 +0200 Subject: [PATCH] [tutorial 051] A conditional disabled variable (config and doc) --- README.md | 54 +++++++++++++++++++++------------------- config/01/output_ro.html | 7 +++--- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 3c66245..f57b009 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 041] Variable: "shorthand" mode](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_041/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_041~1..v1.1_041)) +- [[tutorial 050] A variable with type "web_address"](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_050/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_050~1..v1.1_050)) -# [tutorial 050] A variable with type "web_address" +# [tutorial 051] A conditional disabled variable -[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_050~1..v1.1_050) +[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_051~1..v1.1_051) ## Screenshot @@ -110,6 +110,9 @@ manual: auto: description: Automatic proxy configuration URL type: web_address + disabled: + variable: proxy_mode + when_not: Automatic proxy configuration URL ``` ### Generated documentation @@ -119,9 +122,9 @@ foo@bar:~$ rougail -v 1.1 -m firefox/ -o doc -do github ``` ### Variables -| 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 | +| 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 | #### Manual proxy configuration @@ -131,14 +134,14 @@ _`disabled`_ ##### HTTP Proxy -| Variable                                                                                             | Description                                                                                          | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **manual.http_proxy.address**
[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address.
**Validator**: the domain name can be an IP | -| **manual.http_proxy.port**
[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP Port.
**Default**: 8080 | +| Variable                                                                                                          | Description                                                                                                       | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **manual.http_proxy.address**
[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address.
**Validator**: the domain name can be an IP | +| **manual.http_proxy.port**
[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP Port.
**Default**: 8080 | -| Variable                                                                                             | Description                                                                                          | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **manual.use_for_https**
[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Also use this proxy for HTTPS.
**Default**: True | +| Variable                                                                                                          | Description                                                                                                       | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **manual.use_for_https**
[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Also use this proxy for HTTPS.
**Default**: True | ##### "*HTTPS* Proxy" or "*SOCKS* Proxy" @@ -151,15 +154,15 @@ This family builds families dynamically. **Identifiers**:
- HTTPS
- SOCKS -| Variable                                                                                             | Description                                                                                          | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **manual.https_proxy.address** or **manual.socks_proxy.address**
[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | "*HTTPS* address" or "*SOCKS* address".
**Validator**: the domain name can be an IP
**Default**: the value of the variable "manual.http_proxy.address". | -| **manual.https_proxy.port** or **manual.socks_proxy.port**
[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | "*HTTPS* port" or "*SOCKS* port".
**Default**: the value of the variable "manual.http_proxy.port". | -| **manual.https_proxy.version** or **manual.socks_proxy.version**
[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` _`disabled`_ | SOCKS host version used by proxy.
**Choices**:
- v4
- v5 ← (default)
**Disabled**: when the identifier is "HTTPS". | +| Variable                                                                                                          | Description                                                                                                       | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **manual.https_proxy.address** or **manual.socks_proxy.address**
[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | "*HTTPS* address" or "*SOCKS* address".
**Validator**: the domain name can be an IP
**Default**: the value of the variable "manual.http_proxy.address". | +| **manual.https_proxy.port** or **manual.socks_proxy.port**
[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | "*HTTPS* port" or "*SOCKS* port".
**Default**: the value of the variable "manual.http_proxy.port". | +| **manual.https_proxy.version** or **manual.socks_proxy.version**
[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` _`disabled`_ | SOCKS host version used by proxy.
**Choices**:
- v4
- v5 ← (default)
**Disabled**: when the identifier is "HTTPS". | -| Variable                                                                                             | Description                                                                                          | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **auto**
[`web_address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Automatic proxy configuration URL. | +| Variable                                                                                                          | Description                                                                                                       | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **auto**
[`web_address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` _`disabled`_ | Automatic proxy configuration URL.
**Disabled**: proxy_mode. | ## User data @@ -179,15 +182,16 @@ auto: https://auto.proxy.net/wpad.dat ```console foo@bar:~$ rougail -v 1.1 -m firefox/ -u file -ff config/01/config.yaml ``` -
╭────────────────────────── Caption ──────────────────────────╮
+
🛑 ERRORS
+┗━━ cannot access to option "auto" (Automatic proxy configuration URL) because has property "disabled"
+╭────────────────────────── Caption ──────────────────────────╮
 │ Variable                           Default value            │
 │ Undocumented variable              Modified value           │
 │ Undocumented but modified variable (Original default value) │
 │ Unmodifiable variable                                       │
 ╰─────────────────────────────────────────────────────────────╯
 Variables:
-┣━━ 📓 proxy_mode: No proxy
-┗━━ 📓 auto: https://auto.proxy.net/wpad.dat
+┗━━ 📓 proxy_mode: No proxy
 
### Example 2 @@ -236,4 +240,4 @@ Variables:
-- [[tutorial 051] A conditional disabled variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_051/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_051~1..v1.1_051)) +- [[tutorial 060] A variable with type "domainname", parameters type and disabled](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_060/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_060~1..v1.1_060)) diff --git a/config/01/output_ro.html b/config/01/output_ro.html index 4009618..671632f 100644 --- a/config/01/output_ro.html +++ b/config/01/output_ro.html @@ -1,10 +1,11 @@ -
╭────────────────────────── Caption ──────────────────────────╮
+
🛑 ERRORS
+┗━━ cannot access to option "auto" (Automatic proxy configuration URL) because has property "disabled"
+╭────────────────────────── Caption ──────────────────────────╮
 │ Variable                           Default value            │
 │ Undocumented variable              Modified value           │
 │ Undocumented but modified variable (Original default value) │
 │ Unmodifiable variable                                       │
 ╰─────────────────────────────────────────────────────────────╯
 Variables:
-┣━━ 📓 proxy_mode: No proxy
-┗━━ 📓 auto: https://auto.proxy.net/wpad.dat
+┗━━ 📓 proxy_mode: No proxy