[tutorial v1.1_171] Calculate a random color (config and doc)

This commit is contained in:
egarette@silique.fr 2026-03-09 07:59:02 +01:00
parent 1db39dde4c
commit d3c75fdd0e
2 changed files with 51 additions and 44 deletions

View file

@ -1,9 +1,9 @@
- [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md)
- [[tutorial v1.1_160] A leadership family](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_160/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_170~1..v1.1_170))
- [[tutorial v1.1_170] Regexp type](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_171~1..v1.1_171))
# [tutorial v1.1_170] Regexp type
# [tutorial v1.1_171] Calculate a random color
[Read the tutorial "Regexp type" in the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/jinja.html#regexp-type)
[Read the tutorial "Calculate a random color" in the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/jinja.html#calculate-a-random-color)
## Screenshot
@ -29,7 +29,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_170
git switch --detach v1.1_171
```
## Structure
@ -37,21 +37,21 @@ git switch --detach v1.1_170
<p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./">.</a><br/>
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./firefox/">firefox</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./firefox/10-manual.yml">10-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./firefox/20-manual.yml">20-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./firefox/30-auto.yml">30-auto.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./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_170/./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_170/./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_170/./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_170/./foxyproxy/">foxyproxy</a><br/>
│   └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./foxyproxy/00-foxyproxy.yml">00-foxyproxy.yml</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./types/">types</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./types/proxy/">proxy</a><br/>
        └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./types/proxy/00_type.yml">00_type.yml</a><br/>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./">.</a><br/>
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./firefox/">firefox</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./firefox/10-manual.yml">10-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./firefox/20-manual.yml">20-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./firefox/30-auto.yml">30-auto.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./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_171/./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_171/./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_171/./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_171/./foxyproxy/">foxyproxy</a><br/>
│   └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./foxyproxy/00-foxyproxy.yml">00-foxyproxy.yml</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./types/">types</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./types/proxy/">proxy</a><br/>
        └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./types/proxy/00_type.yml">00_type.yml</a><br/>
<br/><br/></p>
Contents of the foxyproxy/00-foxyproxy.yml file
@ -72,6 +72,13 @@ proxies:
color:
description: Color
regexp: ^#(?:[0-9a-f]{3}){1,2}$
default:
jinja: >-
#
{%- for i in range(6) -%}
{{- '0123456789abcdef' | random -}}
{%- endfor -%}
description: random color value
...
```
@ -170,7 +177,7 @@ rougail -m firefox/ -s Firefox -xn FoxyProxy -xd 0 foxyproxy/ --types types/prox
>
> This family is a namespace.\
> **Path**: foxyproxy\
> `basic`
> `standard`
##### Proxy configuration
@ -178,12 +185,12 @@ rougail -m firefox/ -s Firefox -xn FoxyProxy -xd 0 foxyproxy/ --types types/prox
>
> This family contains lists of variable blocks.\
> **Path**: foxyproxy.proxies\
> `basic`
> `standard`
| Variable | Description |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| **<a id="foxyproxy.proxies.title" name="foxyproxy.proxies.title">foxyproxy.proxies.title</a>**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `standard` `unique` | Title or Description. |
| **<a id="foxyproxy.proxies.color" name="foxyproxy.proxies.color">foxyproxy.proxies.color</a>**<br/>[`regexp`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | Color.<br/>**Validator**: text based with regular expressions "^#(?:[0-9a-f]{3}){1,2}$" |
| Variable | Description |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| **<a id="foxyproxy.proxies.title" name="foxyproxy.proxies.title">foxyproxy.proxies.title</a>**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `standard` `unique` | Title or Description. |
| **<a id="foxyproxy.proxies.color" name="foxyproxy.proxies.color">foxyproxy.proxies.color</a>**<br/>[`regexp`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Color.<br/>**Validator**: text based with regular expressions "^#(?:[0-9a-f]{3}){1,2}$"<br/>**Default**: random color value |
***
@ -194,9 +201,9 @@ rougail -m firefox/ -s Firefox -xn FoxyProxy -xd 0 foxyproxy/ --types types/prox
```
#### Modified variable
| Variable | Description |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| **<a id="foxyproxy.proxies.color" name="foxyproxy.proxies.color">foxyproxy.proxies.color</a>**<br/>[`regexp`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | Color.<br/>**Validator**: <ins>text based with regular expressions "^#(?:[0-9a-f]{3}){1,2}$"</ins> |
| Variable | Description |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| **<a id="foxyproxy.proxies.color" name="foxyproxy.proxies.color">foxyproxy.proxies.color</a>**<br/>~~`basic`~~ <ins>`standard`</ins> [`regexp`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Color.<br/>**Validator**: text based with regular expressions "^#(?:[0-9a-f]{3}){1,2}$"<br/>**Default**: <ins>random color value</ins> |
***
@ -234,4 +241,4 @@ Variables:
***
- [[tutorial v1.1_171] Calculate a random color](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_171~1..v1.1_171))
- [[tutorial v1.1_172] Auto save value](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_172/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_172~1..v1.1_172))

View file

@ -1,17 +1,17 @@
<p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./">.</a><br/>
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./firefox/">firefox</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./firefox/10-manual.yml">10-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./firefox/20-manual.yml">20-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./firefox/30-auto.yml">30-auto.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./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_170/./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_170/./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_170/./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_170/./foxyproxy/">foxyproxy</a><br/>
│   └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./foxyproxy/00-foxyproxy.yml">00-foxyproxy.yml</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./types/">types</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./types/proxy/">proxy</a><br/>
        └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_170/./types/proxy/00_type.yml">00_type.yml</a><br/>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./">.</a><br/>
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./firefox/">firefox</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./firefox/10-manual.yml">10-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./firefox/20-manual.yml">20-manual.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./firefox/30-auto.yml">30-auto.yml</a><br/>
│   ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./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_171/./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_171/./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_171/./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_171/./foxyproxy/">foxyproxy</a><br/>
│   └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./foxyproxy/00-foxyproxy.yml">00-foxyproxy.yml</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./types/">types</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./types/proxy/">proxy</a><br/>
        └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_171/./types/proxy/00_type.yml">00_type.yml</a><br/>
<br/><br/></p>