From e840bc5289d233c2983655a7de8eb77171d826a8 Mon Sep 17 00:00:00 2001 From: gwen Date: Fri, 20 Mar 2026 17:55:15 +0100 Subject: [PATCH] begin custom type --- docs/tutorial/customtype.rst | 79 ++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 3 deletions(-) diff --git a/docs/tutorial/customtype.rst b/docs/tutorial/customtype.rst index 0f0a06ed4..f5f7b3f09 100644 --- a/docs/tutorial/customtype.rst +++ b/docs/tutorial/customtype.rst @@ -16,7 +16,7 @@ Custom type Of course, you can also decide to copy/paste or download the tutorial files contents while following the tutorial steps. If you want to follow this tutorial with the help of the corresponding :tutorial:`rougail-tutorials git repository `, - this workshop page corresponds to the tags :tutorial:`v1.1_070 ` to :tutorial:`v1.1_072 ` + this workshop page corresponds to the tags :tutorial:`v1.1_080 ` to :tutorial:`v1.1_081 ` in the repository. :: @@ -39,10 +39,83 @@ Our structural folder will be expanded a bit: .. raw:: html :url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_080/tree.html -Notice that we have now a :file:`types` folder with a :file:`proxy` subfolder. -This is where we will define our new type. +Notice that we have now a new :file:`types` folder in our tree structure. +This is where we will define our new types. And we also have a new structure file named :file:`00-proxy.yml`. Let's examine them more closely. +.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_080/types/proxy/00_type.yml + :language: yaml + :caption: The :file:`types/proxy/00_type.yml` type structure file that defines our new `proxy` type. + +.. + %YAML 1.2 + --- + version: 1.1 + + proxy: + + address: + description: Proxy address + type: domainname + params: + allow_ip: true + default: + variable: __.http_proxy.address + + port: + description: Proxy port + type: port + default: + variable: __.http_proxy.port + ... + + +TODO: + +:: + + - la notion de type vient de la déclaration ligne de commande --type + rougail -m firefox/ --types types/proxy -u yaml -yf config/01/config.yml + - le fichier firefox/10-manual.yml a des changements + https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_080~1..v1.1_080 + dégraissage dû à la déclaration de type + + - la déclaration de type ne se voit pas + Variables: + ┣━━ 📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/01/config.yml" (⏳ No proxy) + ┗━━ 📂 Manual proxy configuration + ┣━━ 📂 HTTP Proxy + ┃ ┣━━ 📓 Proxy address: http.proxy.net ◀ loaded from the YAML file "config/01/config.yml" + ┃ ┗━━ 📓 Proxy port: 3128 ◀ loaded from the YAML file "config/01/config.yml" (⏳ 8080) + ┣━━ 📓 Also use this proxy for HTTPS: false ◀ loaded from the YAML file "config/01/config.yml" (⏳ true) + ┣━━ 📂 HTTPS Proxy + ┃ ┣━━ 📓 HTTPS address: https.proxy.net ◀ loaded from the YAML file "config/01/config.yml" (⏳ http.proxy.net) + ┃ ┗━━ 📓 HTTPS port: 3128 + ┗━━ 📂 SOCKS Proxy + ┣━━ 📓 SOCKS address: http.proxy.net + ┣━━ 📓 SOCKS port: 3128 + ┗━━ 📓 SOCKS host version used by proxy: v5 + +.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_080/types/proxy/00_type.yml + :language: yaml + :caption: The :file:`types/proxy/00_type.yml` structure file with proxy type declaration + +.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_080/firefox/10-manual.yml + :language: yaml + :caption: The :file:`firefox/10-manual.yml` structure file with less declaration due to the type definition + + +The Rougail CLI with the type declaration command line option: + +.. raw:: html + :url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_080/config/01/cmd_ro.txt + :class: terminal + +The output: + +.. raw:: html + :url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_080/config/01/output_ro.html + :class: output