diff --git a/docs/tutorial/boolean.rst b/docs/tutorial/boolean.rst new file mode 100644 index 000000000..f7de1ef4e --- /dev/null +++ b/docs/tutorial/boolean.rst @@ -0,0 +1,93 @@ +A new variable which has the `boolean` type +=============================================== + +.. objectives:: Objectives + + In this section we will learn: + + - how to make a boolean type variable + +.. prerequisites:: Reminders + + Let's summarize the configuration up to here + +Whe have the `proxy_mode` configuration here: + +.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_030/firefox/00-proxy.yml + :language: yaml + :caption: firefox/00-proxy.yml + +.. + --- + proxy_mode: + description: Configure Proxy Access to the Internet + choices: + - No proxy + - Auto-detect proxy settings for this network + - Use system proxy settings + - Manual proxy configuration + - Automatic proxy configuration URL + default: No proxy + +With the manual subfamily in case of the "Manual proxy configuration" configuration option has been chosen: + +.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_030/firefox/10-manual.yml + :language: yaml + :caption: firefox/10-manual.yml + +.. + --- + manual: + description: Manual proxy configuration + disabled: + variable: proxy_mode + when_not: 'Manual proxy configuration' + + http_proxy: + description: HTTP Proxy + + address: + description: HTTP address + type: domainname + params: + allow_ip: true + + port: + description: HTTP Port + type: port + default: 8080 + +.. type-along:: The HTTPS mode + +Now we will focus on configuring the HTTPS mode in case of "Manual proxy configuration". + +.. image:: images/firefox_manual_https.png + +Do we want to reuse, for the HTTPS mode, the same configuration as for the HTTP mode? + +A new `boolean` type variable +------------------------------- + +We have a new variable, named `use_for_https` here: + +.. confval:: use_for_https + :type: `boolean` + :default: `true` + + This is a setting that enables to reuse the HTTP proxy configuration for HTTPS + +Its description in the structure file gives us this: + +.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_030/firefox/20-manual.yml + :language: yaml + :caption: firefox/20-manual.yml + +.. + --- + manual: + + use_for_https: + description: Also use this proxy for HTTPS + type: boolean + default: true + diff --git a/docs/tutorial/disabled.rst b/docs/tutorial/disabled.rst index d0f998f31..8953f2c11 100644 --- a/docs/tutorial/disabled.rst +++ b/docs/tutorial/disabled.rst @@ -144,7 +144,7 @@ then we need to activate the `manual` family. And we understand that this activation/deactivation of the `manual` family depends on the value of the `proxy_mode` variable. -In rougail, we can set a property's value depending on the value of another variable. That is, it is conditioned by another variable. +In rougail, we can set a property's value **depending on** the value of another variable. That is, it is conditioned by another variable. Here is how we can achieve this: @@ -187,14 +187,13 @@ Here we have the `disabled` property like this: variable: proxy_mode when_not: 'Manual proxy configuration' -It means that the `disabled` property depends ont he `proxy_mode` variable: - -- if `proxy_mode == 'Manual proxy configuration'` disabled is false (that is, - the `manual` family is **enabled**) -- else the `disabled` property is true (that is, the `manual` family is **disabled**) - +It means that the `disabled` property **depends on** the value of another variable. +The `variable` parameter allows you to define the name of the target variable on which the `disabled` property depends. +What does it allow you to do? +- if `proxy_mode` is not `'Manual proxy configuration'` it disables the `manual` family +- if `proxy_mode == 'Manual proxy configuration'` it enables the `manual` family .. keypoints:: Key points progress diff --git a/docs/tutorial/images/firefox_manual_https.png b/docs/tutorial/images/firefox_manual_https.png new file mode 100644 index 000000000..b7ca7aa08 Binary files /dev/null and b/docs/tutorial/images/firefox_manual_https.png differ diff --git a/docs/tutorial/index.rst b/docs/tutorial/index.rst index adbdc5008..77fd3b876 100644 --- a/docs/tutorial/index.rst +++ b/docs/tutorial/index.rst @@ -42,5 +42,6 @@ At first glance we can see that we have a selection of five configuration option preliminary proxymode disabled + boolean tutorial