diff --git a/README.md b/README.md index b8de4285..09bf2b5f 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ include_toc: true - [[tutorial 023] Conditional hidden family and calculated default value](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_023/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_023~1..v1.1_023)) - [[tutorial 024] Conditional hidden family and calculated default value](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_024/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_024~1..v1.1_024)) - [[tutorial 025] Conditional hidden family and calculated default value](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_025/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_025~1..v1.1_025)) +- [[tutorial 026] A dynamic family](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_026/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_026~1..v1.1_026)) # Description @@ -34,15 +35,21 @@ include_toc: true Firefox Proxy setting -Conditional hidden family and calculated default value +A dynamic family -Add a sub family "https_proxy" which will be hidden if "use_for_https" is True. +HTTPS and socks proxy are very similar. It could be interesting to do on dynamic family instead of duplicate family and variable description. -Hidden means that we cannot change value, but we can access to it in read only mode. Inside, we add two variable with calculated default value (with variable type). +First of all, we add a dynamic attribute to the family. Dynamic is here a static list of suffix. It could be a variable or jinja informations too. -So, if user set "use_for_https" to True, the default values of HTTPS configuration will be a copy of HTTP values. The use can change HTTPS values if needed. +The dynamic family is only hidden in the HTTPs case. +Hidden is now a Jinja calculation with a parameter named "suffix". -If user set "use_for_https" to False, the default values of HTTPS configuration will only be a copy of HTTP values. +The suffix is use in: + +- family name +- family description +- variables name +- variables description # Structure @@ -100,7 +107,7 @@ manual: https_proxy: description: HTTPS Proxy hidden: - variable: manual.use_for_https + variable: _.use_for_https address: description: HTTPS address @@ -108,13 +115,13 @@ manual: params: allow_ip: true default: - variable: manual.http_proxy.address + variable: __.http_proxy.address port: description: HTTPS Port type: port default: - variable: manual.http_proxy.port + variable: __.http_proxy.port ``` ## Generated documentation @@ -151,7 +158,7 @@ foo@bar:~$ rougail -v 1.1 -m firefox/ -o doc -do github `standard` _`hidden`_ -**Hidden**: manual.use_for_https. +**Hidden**: when the variable "manual.use_for_https" has the value "True". | Variable                                                                                                 | Description                                                                                              | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|