From df32364a0d8202cb165ee6771d612fdc06f1e8e0 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sun, 14 Jun 2026 21:49:24 +0200 Subject: [PATCH] [tutorial v1.1_200] A regexp variable (config and doc) --- CHANGELOG.md | 9 ++--- DOCUMENTATION.md | 8 ++-- README.md | 82 ++++++++++++++++------------------------ config/03/config.yml | 6 +-- config/03/output_ro.html | 34 ++++------------- tree.html | 30 +++++++-------- 6 files changed, 64 insertions(+), 105 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67ba96d..275b3bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,5 @@ -# New variables +# Modified variable -| Variable | Description | -|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------| -| **foxyproxy.proxies.title**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `standard` `unique` | Title or Description. | -| **foxyproxy.proxies.color**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | Color. | +| Variable | Description | +|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------| +| **foxyproxy.proxies.color**
~~`string`~~ [`regexp`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | Color.
**Validator**: text based with regular expressions "^#(?:[0-9a-f]{3}){1,2}$" | diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index fd62bf6..2a5da2f 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -96,7 +96,7 @@ > **Path**: foxyproxy.proxies\ > `basic` -| Variable | Description | -|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------| -| **foxyproxy.proxies.title**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `standard` `unique` | Title or Description. | -| **foxyproxy.proxies.color**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | Color. | +| Variable | Description | +|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------| +| **foxyproxy.proxies.title**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `standard` `unique` | Title or Description. | +| **foxyproxy.proxies.color**
[`regexp`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | Color.
**Validator**: text based with regular expressions "^#(?:[0-9a-f]{3}){1,2}$" | diff --git a/README.md b/README.md index f7adbc7..c0b6b95 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ - [List of all the tutorial steps](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md) -- [[Previous tutorial v1.1_181] New "FoxyProxy" namespace](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_181/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_190~1..v1.1_190)) +- [[Previous tutorial v1.1_190] A family with sequence type](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_190/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_200~1..v1.1_200)) -# [tutorial v1.1_190] A family with sequence type +# [tutorial v1.1_200] A regexp variable -- [Read the tutorial "A family with sequence type" in the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/sequence.html#a-family-with-sequence-type) -- [View the changes in the files](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_190~1..v1.1_190) +- [Read the tutorial "A regexp variable" in the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/regexp.html#a-regexp-variable) +- [View the changes in the files](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_200~1..v1.1_200) ## Screenshot @@ -26,27 +26,27 @@ pip install rougail-cli rougail-output-exporter rougail-output-doc rougail-user- Then switch to the tutorial page: ```shell -git switch --detach v1.1_190 +git switch --detach v1.1_200 ``` ## Structure

-.
- ├── 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
- ├── foxyproxy
- │   └── 00-foxyproxy.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
+ ├── foxyproxy
+ │   └── 00-foxyproxy.yml
+ └── types
+     └── proxy
+         └── 00-type.yml


Contents of the foxyproxy/00-foxyproxy.yml file @@ -64,7 +64,9 @@ proxies: description: Title or Description mandatory: false - color: # Color + color: + description: Color + regexp: ^#(?:[0-9a-f]{3}){1,2}$ ... ``` @@ -167,11 +169,7 @@ Variables: foxyproxy: proxies: - title: My company - color: '#66cc66' - - title: An other company - color: '#cc66cc' - - title: WPAD - color: '#1166cc' + color: not a color ``` *** @@ -180,31 +178,15 @@ foxyproxy: ```shell rougail -m firefox/ -s Firefox -xn FoxyProxy -xd 0 foxyproxy/ --types types/proxy --modes_level basic standard advanced -u yaml -yf config/03/config.yml ``` -> [!NOTE] -> -> **Caption:** -> - Variable -> - Default value -> - Modified value - -Variables: -- :open_file_folder: firefox (Firefox) - - :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): false -- :open_file_folder: foxyproxy (FoxyProxy) - - :open_file_folder: proxies (Proxy configuration) - - :open_file_folder: title (Title or Description) - - :notebook: title (Title or Description): My company ← loaded from the YAML file "config/03/config.yml" - - :notebook: color (Color): #66cc66 ← loaded from the YAML file "config/03/config.yml" - - :open_file_folder: title (Title or Description) - - :notebook: title (Title or Description): An other company ← loaded from the YAML file "config/03/config.yml" - - :notebook: color (Color): #cc66cc ← loaded from the YAML file "config/03/config.yml" - - :open_file_folder: title (Title or Description) - - :notebook: title (Title or Description): WPAD ← loaded from the YAML file "config/03/config.yml" - - :notebook: color (Color): #1166cc ← loaded from the YAML file "config/03/config.yml" +> [!CAUTION] +> +> - foxyproxy (FoxyProxy) +> - proxies (Proxy configuration) +> - color (Color) +> - :bell: the value "not a color" is an invalid string, invalid value, it will be ignored when loading from the YAML file "config/03/config.yml" +> - :stop_sign: mandatory variable at index "0" but has no value *** -- [[Next tutorial v1.1_200] A regexp variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_200/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_200~1..v1.1_200)) +- [[Next tutorial v1.1_201] Calculate a random color](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_201/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_201~1..v1.1_201)) diff --git a/config/03/config.yml b/config/03/config.yml index 0d0d568..330d26b 100644 --- a/config/03/config.yml +++ b/config/03/config.yml @@ -2,8 +2,4 @@ foxyproxy: proxies: - title: My company - color: '#66cc66' - - title: An other company - color: '#cc66cc' - - title: WPAD - color: '#1166cc' + color: not a color diff --git a/config/03/output_ro.html b/config/03/output_ro.html index 621541b..35fbc5c 100644 --- a/config/03/output_ro.html +++ b/config/03/output_ro.html @@ -1,27 +1,9 @@ -
╭──────── Caption ────────╮
-│ Variable Default value  │
-│          Modified value │
-╰─────────────────────────╯
-Variables:
-┣━━ 📂 firefox (Firefox)
-┣━━ 📓 proxy_mode (Configure Proxy Access to the Internet): No proxy
-┗━━ 📂 dns_over_https (DNS over HTTPS)
-    ┗━━ 📓 enable_dns_over_https (Enable DNS over HTTPS): false
-┗━━ 📂 foxyproxy (FoxyProxy)
-    ┗━━ 📂 proxies (Proxy configuration)
-        ┣━━ 📂 title (Title or Description)
-        ┣━━ 📓 title (Title or Description): My company ◀ loaded from the 
-        YAML file "config/03/config.yml"
-        ┗━━ 📓 color (Color): #66cc66 ◀ loaded from the YAML file 
-            "config/03/config.yml"
-        ┣━━ 📂 title (Title or Description)
-        ┣━━ 📓 title (Title or Description): An other company ◀ loaded from 
-        the YAML file "config/03/config.yml"
-        ┗━━ 📓 color (Color): #cc66cc ◀ loaded from the YAML file 
-            "config/03/config.yml"
-        ┗━━ 📂 title (Title or Description)
-            ┣━━ 📓 title (Title or Description): WPAD ◀ loaded from the YAML 
-            file "config/03/config.yml"
-            ┗━━ 📓 color (Color): #1166cc ◀ loaded from the YAML file 
-                "config/03/config.yml"
+
🛑 Caution
+┗━━ foxyproxy (FoxyProxy)
+    ┗━━ proxies (Proxy configuration)
+        ┗━━ color (Color)
+            ┣━━ 🔔 the value "not a color" is an invalid string, invalid value, 
+            it will be ignored when loading from the YAML file 
+            "config/03/config.yml"
+            ┗━━ 🛑 mandatory variable at index "0" but has no value
 
diff --git a/tree.html b/tree.html index f30aec8..2d3f269 100644 --- a/tree.html +++ b/tree.html @@ -1,17 +1,17 @@

-.
- ├── 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
- ├── foxyproxy
- │   └── 00-foxyproxy.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
+ ├── foxyproxy
+ │   └── 00-foxyproxy.yml
+ └── types
+     └── proxy
+         └── 00-type.yml


\ No newline at end of file