This commit is contained in:
egarette@silique.fr 2026-03-08 07:49:25 +01:00
parent 21669746a3
commit d437131de9
135 changed files with 209 additions and 112 deletions

View file

@ -36,6 +36,11 @@ if __name__ == "__main__":
has_foxyproxy = False has_foxyproxy = False
has_namespace = False has_namespace = False
rougailconfig['main_namespace'] = None rougailconfig['main_namespace'] = None
if Path('types').is_dir():
has_types = True
rougailconfig['types'] = [str(d) for d in Path('types').iterdir()]
else:
has_types = False
# rougailconfig['tiramisu_cache'] = "cache.py" # rougailconfig['tiramisu_cache'] = "cache.py"
if Path('mode').is_file(): if Path('mode').is_file():
rougailconfig['modes_level'] = ['basic', 'standard', 'advanced'] rougailconfig['modes_level'] = ['basic', 'standard', 'advanced']
@ -113,6 +118,8 @@ if __name__ == "__main__":
CMD += "-s Firefox " CMD += "-s Firefox "
if has_foxyproxy: if has_foxyproxy:
CMD += "-xn FoxyProxy -xd 0 foxyproxy/ " CMD += "-xn FoxyProxy -xd 0 foxyproxy/ "
if has_types:
CMD += "--types " + " ".join(rougailconfig["types"]) + " "
if has_mode: if has_mode:
CMD += "--modes_level basic standard advanced " CMD += "--modes_level basic standard advanced "
if inv_doc: if inv_doc:
@ -127,7 +134,7 @@ if __name__ == "__main__":
inv_doc = inventory.run()[1] inv_doc = inventory.run()[1]
if inv_doc: if inv_doc:
doc += inv_formatter.title("Let's generate the changelog", 3) doc += inv_formatter.title("Let's generate the changelog", 3)
cmd = CMD + "-o doc --doc.contents changelog" cmd = CMD + "-o doc --doc.contents changelog --doc.changelog.previous_json_file previous.yml"
doc += f'```shell\n{cmd}\n```\n' doc += f'```shell\n{cmd}\n```\n'
doc += inv_doc + "\n" doc += inv_doc + "\n"
doc += "***\n" doc += "***\n"

View file

@ -54,7 +54,7 @@ for i in $(ls -d "examples"/* | sort); do
base_url_doc=$(cat $i/URL) base_url_doc=$(cat $i/URL)
fi fi
if [ -f "$i/TITLE.md" ]; then if [ -f "$i/TITLE.md" ]; then
echo "- [$(head -n 1 $i/TITLE.md)]($base_url_doc)" >> summary.md echo "- $(head -n 1 $i/TITLE.md) ([doc]($base_url_doc))" >> summary.md
fi fi
if [ -f "$i/SUBTITLE.md" ]; then if [ -f "$i/SUBTITLE.md" ]; then
echo " - $(head -n 1 $i/SUBTITLE.md)" >> summary.md echo " - $(head -n 1 $i/SUBTITLE.md)" >> summary.md
@ -66,7 +66,7 @@ for i in $(ls -d "examples"/* | sort); do
commit_id="v${VERSION}_$num" commit_id="v${VERSION}_$num"
title=$(head -n 1 $i/README.md) title=$(head -n 1 $i/README.md)
summary="[tutorial $commit_id] $title" summary="[tutorial $commit_id] $title"
url_doc="$base_url_doc#$(echo $title | tr A-Z a-z | sed 's/ /-/g' | sed 's//-/g')" url_doc="$base_url_doc#$(echo $title | tr A-Z a-z | sed 's/ /-/g' | sed 's//-/g' | sed 's/\"//g')"
diff_url="https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/${commit_id}~1..$commit_id" diff_url="https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/${commit_id}~1..$commit_id"
echo " - [$summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/$commit_id/README.md) ([doc]($url_doc) - [diff]($diff_url))" >> summary.md echo " - [$summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/$commit_id/README.md) ([doc]($url_doc) - [diff]($diff_url))" >> summary.md
cp "summary_total.md" "$DEST" cp "summary_total.md" "$DEST"
@ -83,6 +83,12 @@ for i in $(ls -d "examples"/* | sort); do
cp -v "$j" "$DEST/$j" cp -v "$j" "$DEST/$j"
done done
fi fi
if [ -d ../types ]; then
mkdir -p $DEST/types
for j in $(ls -d ../types/* 2>/dev/null); do
cp -va "$j" "$DEST/types/"
done
fi
cd $DEST cd $DEST
tree -H $TUTO_ROOT/$commit_id/ -P "*.yml" > tree.html tree -H $TUTO_ROOT/$commit_id/ -P "*.yml" > tree.html
cd - > /dev/null cd - > /dev/null
@ -140,6 +146,9 @@ for i in $(ls -d "examples"/* | sort); do
fi fi
cd - > /dev/null cd - > /dev/null
# old_commit_id="$commit_id" # old_commit_id="$commit_id"
# echo "pouet $i"
# [ "$i" = "examples/120" ] && exit 1
if [ -f previous.yml ]; then cp -a previous.yml previous_old.yml; fi
fi fi
done done
cd "$DEST" cd "$DEST"

View file

@ -1 +1 @@
A variable with type's parameters A variable with types parameters

View file

@ -1 +1 @@
https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/calculated.html https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/properties.html

View file

@ -1 +1 @@
A conditional disabled variable with type web_address HTTP Proxy with "proxy" type

View file

@ -1 +1 @@
A web_address variable Custom type

View file

@ -1 +1,2 @@
We cannot configure "auto" if "proxy_mode" is not "Automatic proxy configuration URL". If "use_for_https" is false, HTTPS variables are visible in read only mode and in read write mode.

View file

@ -1,2 +1,9 @@
--- ---
auto: https://auto.proxy.net/wpad.dat proxy_mode: Manual proxy configuration
manual:
http_proxy:
address: http.proxy.net
port: 3128
use_for_https: false
https_proxy:
address: https.proxy.net

View file

@ -1,2 +0,0 @@
---
proxy_mode: Automatic proxy configuration URL

View file

@ -0,0 +1,14 @@
%YAML 1.2
---
version: 1.1
manual:
description: Manual proxy configuration
disabled:
variable: _.proxy_mode
when_not: Manual proxy configuration
http_proxy:
description: HTTP Proxy
type: proxy
...

View file

@ -0,0 +1,17 @@
%YAML 1.2
---
version: 1.1
proxy:
address:
description: Proxy address
type: domainname
params:
allow_ip: true
port:
description: Proxy port
type: port
default: 8080
...

1
examples/081/README.md Normal file
View file

@ -0,0 +1 @@
HTTPS and SOCKS Proxy

View file

@ -0,0 +1,2 @@
If "use_for_https" is false, HTTPS variables are visible in read only mode and in read write mode.

View file

@ -0,0 +1,9 @@
---
proxy_mode: Manual proxy configuration
manual:
http_proxy:
address: http.proxy.net
port: 3128
use_for_https: false
https_proxy:
address: https.proxy.net

View file

@ -0,0 +1,33 @@
%YAML 1.2
---
version: 1.1
manual:
use_for_https: true # Also use this proxy for HTTPS
https_proxy:
description: HTTPS Proxy
type: proxy
hidden:
variable: _.use_for_https
address:
default:
variable: __.http_proxy.address
port:
default:
variable: __.http_proxy.port
socks_proxy:
description: SOCKS Proxy
type: proxy
version:
description: SOCKS host version used by proxy
choices:
- v4
- v5
default: v5
...

View file

@ -1 +1 @@
A conditional disabled variable with type domainname and parameters A conditional disabled variable with type web_address

View file

@ -1 +1 @@
A full documented variable with multiple values and not mandatory A web_address variable

View file

@ -0,0 +1 @@
We cannot configure "auto" if "proxy_mode" is not "Automatic proxy configuration URL".

View file

@ -1 +1,2 @@
--- ---
auto: https://auto.proxy.net/wpad.dat

View file

@ -1,4 +1,2 @@
--- ---
proxy_mode: Automatic proxy configuration URL proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
no_proxy: 192.168.1.0/24

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

View file

@ -1 +0,0 @@
A variable with multiple value

View file

@ -1,6 +0,0 @@
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
no_proxy:
- example.net
- 192.168.1.0/24

View file

@ -1 +0,0 @@
A non mandatory variable

View file

@ -1,6 +0,0 @@
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
no_proxy:
- example.net
- 192.168.1.0/24

View file

@ -1 +0,0 @@
Examples

View file

@ -1,6 +0,0 @@
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
no_proxy:
- example.net
- 192.168.1.0/24

View file

@ -1,3 +0,0 @@
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat

View file

@ -1 +0,0 @@
A conditional disabled boolean variable

View file

@ -1 +0,0 @@
A Jinja conditional disabled boolean variable

View file

@ -1,18 +0,0 @@
%YAML 1.2
---
version: 1.1
proxy_dns_socks5:
description: Use proxy DNS when using SOCKS v5
default: false
disabled:
jinja: |-
{% if _.manual.socks_proxy.version is propertyerror %}
the proxy mode is not manual
{% elif _.manual.socks_proxy.version == 'v4' %}
socks version is v4
{% endif %}
description: |-
if "firefox.proxy_mode" is not "Manual proxy configuration"
or "firefox.manual.socks_proxy.version" is "v4"
...

View file

@ -1 +0,0 @@
A variable in avanced mode

View file

@ -1,19 +0,0 @@
%YAML 1.2
---
version: 1.1
proxy_dns_socks5:
description: Use proxy DNS when using SOCKS v5
mode: advanced
default: false
disabled:
jinja: |-
{% if _.manual.socks_proxy.version is propertyerror %}
the proxy mode is not manual
{% elif _.manual.socks_proxy.version == 'v4' %}
socks version is v4
{% endif %}
description: |-
if "firefox.proxy_mode" is not "Manual proxy configuration"
or "firefox.manual.socks_proxy.version" is "v4"
...

View file

@ -1 +1 @@
A boolean variable A conditional disabled variable with type domainname and parameters

View file

@ -1 +1 @@
Various variables A full documented variable with multiple values and not mandatory

View file

@ -1,3 +1,4 @@
--- ---
proxy_mode: Automatic proxy configuration URL proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat auto: https://auto.proxy.net/wpad.dat
no_proxy: 192.168.1.0/24

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

View file

@ -1 +1 @@
A choice variable A variable with multiple value

View file

@ -1,3 +1,6 @@
--- ---
dns_over_https: proxy_mode: Automatic proxy configuration URL
enable_dns_over_https: true auto: https://auto.proxy.net/wpad.dat
no_proxy:
- example.net
- 192.168.1.0/24

View file

@ -1 +1 @@
A web_address variable A non mandatory variable

View file

@ -1,3 +1,6 @@
--- ---
dns_over_https: proxy_mode: Automatic proxy configuration URL
enable_dns_over_https: true auto: https://auto.proxy.net/wpad.dat
no_proxy:
- example.net
- 192.168.1.0/24

View file

@ -1,5 +1,3 @@
--- ---
dns_over_https: proxy_mode: Automatic proxy configuration URL
enable_dns_over_https: true auto: https://auto.proxy.net/wpad.dat
provider: Custom
custom_dns_url: http://dns.net

View file

@ -1 +1 @@
A variable with custom validation Examples

View file

@ -1,3 +1,6 @@
--- ---
dns_over_https: proxy_mode: Automatic proxy configuration URL
enable_dns_over_https: true auto: https://auto.proxy.net/wpad.dat
no_proxy:
- example.net
- 192.168.1.0/24

View file

@ -1,5 +1,3 @@
--- ---
dns_over_https: proxy_mode: Automatic proxy configuration URL
enable_dns_over_https: true auto: https://auto.proxy.net/wpad.dat
provider: Custom
custom_dns_url: http://dns.net

View file

@ -1 +1 @@
Namespace A conditional disabled boolean variable

View file

@ -1 +1 @@
Namespace Various variables

View file

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View file

@ -1 +1 @@
xxx A boolean variable

View file

@ -1 +1 @@
xxx A Jinja conditional disabled boolean variable

View file

@ -0,0 +1,15 @@
%YAML 1.2
---
version: 1.1
proxy_dns_socks5:
description: Use proxy DNS when using SOCKS v5
default: false
disabled:
jinja: |-
{{ _.manual.socks_proxy.version is propertyerror or _.manual.socks_proxy.version == 'v4' }}
return_type: boolean
description: |-
if "_.proxy_mode" is not "Manual proxy configuration"
or "_.manual.socks_proxy.version" is "v4"
...

View file

@ -1 +1 @@
xxx A variable in avanced mode

View file

@ -0,0 +1,16 @@
%YAML 1.2
---
version: 1.1
proxy_dns_socks5:
description: Use proxy DNS when using SOCKS v5
mode: advanced
default: false
disabled:
jinja: |-
{{ _.manual.socks_proxy.version is propertyerror or _.manual.socks_proxy.version == 'v4' }}
return_type: boolean
description: |-
if "_.proxy_mode" is not "Manual proxy configuration"
or "_.manual.socks_proxy.version" is "v4"
...

BIN
examples/130/firefox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
examples/130/firefox.xcf Normal file

Binary file not shown.

1
examples/131/README.md Normal file
View file

@ -0,0 +1 @@
A choice variable

View file

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

1
examples/132/README.md Normal file
View file

@ -0,0 +1 @@
A web_address variable

View file

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

View file

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

Some files were not shown because too many files have changed in this diff Show more