[tutorial v1.1_110)] Namespace (config and doc)

This commit is contained in:
egarette@silique.fr 2025-12-01 22:22:11 +01:00
parent 93dba1f065
commit 39ffb7c6ba
14 changed files with 30 additions and 245 deletions

188
README.md
View file

@ -1,11 +1,11 @@
- [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md)
- [[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))
- [[tutorial v1.1_103] A variable with custom validation](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_103~1..v1.1_103))
# [tutorial v1.1_103)] A variable with custom validation
# [tutorial v1.1_110)] Namespace
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_103~1..v1.1_103)
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_110~1..v1.1_110)
[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/calculation.html#a-variable-with-custom-validation)
[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/calculation.html#namespace)
## 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_103
git switch --detach v1.1_110
```
## Structure
@ -39,55 +39,25 @@ git switch --detach v1.1_103
<p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./">.</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/">firefox</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/10-manual.yml">10-manual.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/20-manual.yml">20-manual.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/30-auto.yml">30-auto.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/40-no_proxy.yml">40-no_proxy.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/50-prompt_authentication.yml">50-prompt_authentication.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/55-proxy_dns_socks5.yml">55-proxy_dns_socks5.yml</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/60-dns_over_https.yml">60-dns_over_https.yml</a><br/>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./">.</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/">firefox</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/10-manual.yml">10-manual.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/20-manual.yml">20-manual.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/30-auto.yml">30-auto.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/40-no_proxy.yml">40-no_proxy.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/50-prompt_authentication.yml">50-prompt_authentication.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/55-proxy_dns_socks5.yml">55-proxy_dns_socks5.yml</a><br/>
    ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/60-dns_over_https.yml">60-dns_over_https.yml</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/empty.yml">empty.yml</a><br/>
<br/><br/></p>
Contents of the firefox/60-dns_over_https.yml file
Contents of the firefox/empty.yml file
```yml
%YAML 1.2
---
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
custom_dns_url:
description: Custom DNS URL
type: web_address
validators:
- jinja: |-
{% if _.custom_dns_url.startswith('http://') %}
only https is allowed
{% endif %}
description: must starts with 'https://' only
disabled:
jinja: |-
{% if _.provider is propertyerror or _.provider != 'Custom' %}
provider is not custom
{% endif %}
description: if "_.provider" is not "Custom"
...
```
@ -163,128 +133,6 @@ rougail -m firefox/ --modes_level basic standard advanced -o doc
| **<a id="dns_over_https.provider" name="dns_over_https.provider">dns_over_https.provider</a>**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` *`disabled`* | Use Provider.<br/>**Choices**: <br/>&nbsp;Cloudflare **← (default)**<br/>&nbsp;NextDNS<br/>&nbsp;Custom<br/>**Disabled**: when the variable "[Enable DNS over HTTPS](#dns_over_https.enable_dns_over_https)" has the value "false" |
| **<a id="dns_over_https.custom_dns_url" name="dns_over_https.custom_dns_url">dns_over_https.custom_dns_url</a>**<br/>[`web address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` *`disabled`* | Custom DNS URL.<br/>**Validators**: <br/>&nbsp;well-known ports (1 to 1023) are allowed<br/>&nbsp;registred ports (1024 to 49151) are allowed<br/>&nbsp;type domainname<br/>&nbsp;the domain name can be a hostname<br/>&nbsp;must starts with 'https://' only<br/>**Disabled**: if "[Use Provider](#dns_over_https.provider)" is not "Custom" |
### Let's generate the changelog
```shell
rougail -m firefox/ --modes_level basic standard advanced -o doc --doc.contents changelog
```
#### Modified variable
| Variable | Description |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **<a id="dns_over_https.custom_dns_url" name="dns_over_https.custom_dns_url">dns_over_https.custom_dns_url</a>**<br/>[`web address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` *`disabled`* | Custom DNS URL.<br/>**Validators**: <br/>&nbsp;well-known ports (1 to 1023) are allowed<br/>&nbsp;registred ports (1024 to 49151) are allowed<br/>&nbsp;type domainname<br/>&nbsp;the domain name can be a hostname<br/>&nbsp;<ins>must starts with 'https://' only</ins><br/>**Disabled**: if "[Use Provider](#dns_over_https.provider)" is not "Custom" |
## User datas
### Example 1
#### config/01/config.yml
```yml
---
```
#### Output
```shell
rougail -m firefox/ --modes_level basic standard advanced -u yaml -yf config/01/config.yml
```
<pre>╭─────── Caption ────────╮
│ Variable <span style="color: #ffd700">Default value</span>
╰────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: <span style="color: #ffd700">No proxy</span>
<span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Enable DNS over HTTPS: <span style="color: #ffd700">false</span>
</pre>
### Example 2
#### config/02/config.yml
```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
```
<pre>╭────────────── Caption ───────────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #00aa00">Modified value</span>
│ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: <span style="color: #ffd700">No proxy</span>
<span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Enable DNS over HTTPS: <span style="color: #00aa00">true</span> ◀ loaded from the YAML file "config/02/config.yml" (⏳ false)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Use Provider: <span style="color: #ffd700">Cloudflare</span>
</pre>
### Example 3
#### config/03/config.yml
```yml
---
dns_over_https:
enable_dns_over_https: true
provider: Custom
custom_dns_url: http://dns.net
```
#### Output
```shell
rougail -m firefox/ --modes_level basic standard advanced -u yaml -yf config/03/config.yml
```
<pre><span style="font-weight: bold; color: #ffff00">🔔 WARNINGS</span>
<span style="color: #ffff00">┗━━ </span>the value "http://dns.net" is an invalid URL for "dns_over_https.custom_dns_url" (Custom DNS URL), only https is
<span style="color: #ffff00"> </span>allowed, it will be ignored when loading from the YAML file "config/03/config.yml"
╭────────────── Caption ───────────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #00aa00">Modified value</span>
│ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: <span style="color: #ffd700">No proxy</span>
<span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Enable DNS over HTTPS: <span style="color: #00aa00">true</span> ◀ loaded from the YAML file "config/03/config.yml" (⏳ false)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Use Provider: <span style="color: #00aa00">Custom</span> ◀ loaded from the YAML file "config/03/config.yml" (⏳ Cloudflare)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Custom DNS URL: <span style="color: #ffd700">null</span>
</pre>
### Example 4
#### config/04/config.yml
```yml
---
dns_over_https:
enable_dns_over_https: true
provider: Custom
custom_dns_url: https://dns.net
```
#### Output
```shell
rougail -m firefox/ --modes_level basic standard advanced -u yaml -yf config/04/config.yml
```
<pre>╭────────────── Caption ───────────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #00aa00">Modified value</span>
│ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: <span style="color: #ffd700">No proxy</span>
<span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Enable DNS over HTTPS: <span style="color: #00aa00">true</span> ◀ loaded from the YAML file "config/04/config.yml" (⏳ false)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Use Provider: <span style="color: #00aa00">Custom</span> ◀ loaded from the YAML file "config/04/config.yml" (⏳ Cloudflare)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Custom DNS URL: <span style="color: #00aa00">https://dns.net</span> ◀ loaded from the YAML file "config/04/config.yml"
</pre>
- [[tutorial v1.1_110] Namespace](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_111] xxx](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))

View file

@ -1 +0,0 @@
rougail -m firefox/ --modes_level basic standard advanced -u yaml -yf config/01/config.yml

View file

@ -1 +0,0 @@
---

View file

@ -1,8 +0,0 @@
<pre>╭─────── Caption ────────╮
│ Variable <span style="color: #ffd700">Default value</span>
╰────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: <span style="color: #ffd700">No proxy</span>
<span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Enable DNS over HTTPS: <span style="color: #ffd700">false</span>
</pre>

View file

@ -1 +0,0 @@
rougail -m firefox/ --modes_level basic standard advanced -u yaml -yf config/02/config.yml

View file

@ -1,3 +0,0 @@
---
dns_over_https:
enable_dns_over_https: true

View file

@ -1,11 +0,0 @@
<pre>╭────────────── Caption ───────────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #00aa00">Modified value</span>
│ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: <span style="color: #ffd700">No proxy</span>
<span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Enable DNS over HTTPS: <span style="color: #00aa00">true</span> ◀ loaded from the YAML file "config/02/config.yml" (⏳ false)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Use Provider: <span style="color: #ffd700">Cloudflare</span>
</pre>

View file

@ -1 +0,0 @@
rougail -m firefox/ --modes_level basic standard advanced -u yaml -yf config/03/config.yml

View file

@ -1,5 +0,0 @@
---
dns_over_https:
enable_dns_over_https: true
provider: Custom
custom_dns_url: http://dns.net

View file

@ -1,15 +0,0 @@
<pre><span style="font-weight: bold; color: #ffff00">🔔 WARNINGS</span>
<span style="color: #ffff00">┗━━ </span>the value "http://dns.net" is an invalid URL for "dns_over_https.custom_dns_url" (Custom DNS URL), only https is
<span style="color: #ffff00"> </span>allowed, it will be ignored when loading from the YAML file "config/03/config.yml"
╭────────────── Caption ───────────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #00aa00">Modified value</span>
│ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: <span style="color: #ffd700">No proxy</span>
<span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Enable DNS over HTTPS: <span style="color: #00aa00">true</span> ◀ loaded from the YAML file "config/03/config.yml" (⏳ false)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Use Provider: <span style="color: #00aa00">Custom</span> ◀ loaded from the YAML file "config/03/config.yml" (⏳ Cloudflare)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Custom DNS URL: <span style="color: #ffd700">null</span>
</pre>

View file

@ -1 +0,0 @@
rougail -m firefox/ --modes_level basic standard advanced -u yaml -yf config/04/config.yml

View file

@ -1,5 +0,0 @@
---
dns_over_https:
enable_dns_over_https: true
provider: Custom
custom_dns_url: https://dns.net

View file

@ -1,12 +0,0 @@
<pre>╭────────────── Caption ───────────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #00aa00">Modified value</span>
│ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: <span style="color: #ffd700">No proxy</span>
<span style="color: #5c5cff">┗━━ </span>📂 DNS over HTTPS
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Enable DNS over HTTPS: <span style="color: #00aa00">true</span> ◀ loaded from the YAML file "config/04/config.yml" (⏳ false)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 Use Provider: <span style="color: #00aa00">Custom</span> ◀ loaded from the YAML file "config/04/config.yml" (⏳ Cloudflare)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 Custom DNS URL: <span style="color: #00aa00">https://dns.net</span> ◀ loaded from the YAML file "config/04/config.yml"
</pre>

View file

@ -25,19 +25,20 @@
</head>
<body>
<h1>Directory Tree</h1><p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./">.</a><br>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/">firefox</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/00-proxy.yml">00-proxy.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/10-manual.yml">10-manual.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/20-manual.yml">20-manual.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/30-auto.yml">30-auto.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/40-no_proxy.yml">40-no_proxy.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/50-prompt_authentication.yml">50-prompt_authentication.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/55-proxy_dns_socks5.yml">55-proxy_dns_socks5.yml</a><br>
&nbsp;&nbsp;&nbsp; └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_103/./firefox/60-dns_over_https.yml">60-dns_over_https.yml</a><br>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./">.</a><br>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/">firefox</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/00-proxy.yml">00-proxy.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/10-manual.yml">10-manual.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/20-manual.yml">20-manual.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/30-auto.yml">30-auto.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/40-no_proxy.yml">40-no_proxy.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/50-prompt_authentication.yml">50-prompt_authentication.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/55-proxy_dns_socks5.yml">55-proxy_dns_socks5.yml</a><br>
&nbsp;&nbsp;&nbsp; ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/60-dns_over_https.yml">60-dns_over_https.yml</a><br>
&nbsp;&nbsp;&nbsp; └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_110/./firefox/empty.yml">empty.yml</a><br>
<br><br><p>
2 directories, 8 files
2 directories, 9 files
</p>
<hr>