From 947ae2a029946e4550bdfdd110d922c3b3e4faef Mon Sep 17 00:00:00 2001 From: gwen Date: Sat, 8 Nov 2025 09:45:56 +0100 Subject: [PATCH] moving the type definition in the variable's page instead of the tutorial --- docs/tutorial/preliminary.rst | 31 +--------------------------- docs/variable.rst | 39 +++++++++++++++++++++++++++++++---- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/docs/tutorial/preliminary.rst b/docs/tutorial/preliminary.rst index cadec68d9..2ad979834 100644 --- a/docs/tutorial/preliminary.rst +++ b/docs/tutorial/preliminary.rst @@ -218,7 +218,6 @@ it's up to the operator to do the job in the `config.yaml` file: :tutorial:`Download this file from the rougail-tutorials git repository ` - With the rougail CLI the operator has to add the `-u file -ff config/config.yaml` options: .. code-block:: text @@ -248,39 +247,11 @@ which gives us this output: Most of the time, the integrator and the operator are one and the same person, here we are talking about roles and not necessarily about people. -Variable's type ------------------ - -.. type-along:: type inference - -If the `type` attribute is not set, Rougail infers a `string` type for the `proxy_mode` configuration option variable type as defined in the structure file. - -.. type-along:: type setting - -If the operator sets an option value for example with the `integer` type, like this: - -.. code-block:: yaml - - --- - example_var: - description: Configure Proxy Access to the Internet - type: integer - -Then Rougail will expect a `int` or a `float` as a value for the `example_var` variable. - .. type-along:: Defining a choice type In our firefox use case, the real type of the `proxy_mode` variable will be now set as a `choice` type: - -.. glossary:: - - choice type - - A choice type variable is a variable where the content is constrained by a list - - When a variable's setting is "choice" (`type: choice`), it means that - there is a list of available values that can be selected. +.. seealso:: The definition of the :term:`choice type variable ` .. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_004/firefox/00-proxy.yml :linenos: diff --git a/docs/variable.rst b/docs/variable.rst index 11e6f0f1f..73bea30df 100644 --- a/docs/variable.rst +++ b/docs/variable.rst @@ -37,6 +37,37 @@ Variable name Have a look at the :ref:`convention on variable naming link `. +Variable's types +----------------- + +.. type-along:: type inference + +If the `type` attribute is not set, Rougail infers a `string` type for the `proxy_mode` configuration option variable type as defined in the structure file. + +.. type-along:: integer type + +If the operator sets an option value for example with the `integer` type, like this: + +.. code-block:: yaml + + --- + example_var: + description: This is an example variable + type: integer + +Then Rougail will expect a `int` as a value for the `example_var` variable. + +.. type-along:: the choice type + +.. glossary:: + + choice type + + A choice type variable is a variable where the content is constrained by a list + + When a variable's setting is "choice" (`type: choice`), it means that + there is a list of available values that can be selected. + Shorthand declaration ---------------------------- @@ -189,12 +220,12 @@ Parameters Concretely, the content of this attribute is recorded in the `information` attribute of the corresponding `Tiramisu` option object. -Variables types ----------------- +Variables type list +-------------------- -A variable **has a type**. +A variable **always has a type**. The system is **strongly** typed. -This type enables the variable to define the values that are accepted by this variable. +Depending on the definition of the variable type, the defined variable will accept values ​​of the associated type. .. list-table:: :widths: 15 25 20 15