default value in the tutorial
This commit is contained in:
parent
543d54144b
commit
55bda5cd8c
2 changed files with 56 additions and 34 deletions
|
@ -89,7 +89,7 @@ You can see that there is just a `version` specification.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
foo@bar:~$ rougail -v 1.1
|
rougail -v 1.1
|
||||||
|
|
||||||
The variables
|
The variables
|
||||||
-----------------
|
-----------------
|
||||||
|
|
|
@ -13,6 +13,10 @@ Preliminaries
|
||||||
|
|
||||||
We assume that Rougail's library is :ref:`already installed <installation>` on your computer (or in a virtual environment).
|
We assume that Rougail's library is :ref:`already installed <installation>` on your computer (or in a virtual environment).
|
||||||
|
|
||||||
|
.. type-along:: an empty dictionary
|
||||||
|
|
||||||
|
An empty structure description file
|
||||||
|
|
||||||
.. exercise:: The folder structure
|
.. exercise:: The folder structure
|
||||||
|
|
||||||
Here is the tree structure we want to have::
|
Here is the tree structure we want to have::
|
||||||
|
@ -21,32 +25,9 @@ Preliminaries
|
||||||
├── firefox
|
├── firefox
|
||||||
│ ├── dictionary.yml
|
│ ├── dictionary.yml
|
||||||
|
|
||||||
- Let's make a :file:`workplace` directory, with a :file:`dict` subfolder.
|
- Let's make a :file:`workplace` directory, with a :file:`firefox` subfolder.
|
||||||
- First, we wil make a :term:`dictionary`, so let's make the :file:`dictionary.yml` file
|
- First, we wil make a :term:`dictionary`, so let's create a :file:`dictionary.yml` file
|
||||||
which is located in the :file:`firefox` subfolder.
|
located in the :file:`firefox` subfolder.
|
||||||
- Then we will run this command
|
|
||||||
|
|
||||||
.. code-block:: shell
|
|
||||||
|
|
||||||
foo@bar:~$ rougail -v 1.1 -m firefox/
|
|
||||||
|
|
||||||
which actually outputs an error:
|
|
||||||
|
|
||||||
.. raw:: html
|
|
||||||
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_010/config/01/output_ro.html
|
|
||||||
|
|
||||||
..
|
|
||||||
🛑 ERRORS
|
|
||||||
┣━━ The following variables are mandatory but have no value:
|
|
||||||
┗━━ - proxy_mode
|
|
||||||
|
|
||||||
Because this variable is :term:`mandatory` and needs to be set.
|
|
||||||
|
|
||||||
FIXME : ce dico doit être mis en haut
|
|
||||||
|
|
||||||
.. type-along:: a default dictionary
|
|
||||||
|
|
||||||
An empty structure description file
|
|
||||||
|
|
||||||
The dictionary
|
The dictionary
|
||||||
----------------
|
----------------
|
||||||
|
@ -55,16 +36,17 @@ This is an empty Rougail dictionnary
|
||||||
|
|
||||||
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_000/firefox/00-proxy.yml
|
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_000/firefox/00-proxy.yml
|
||||||
:language: yaml
|
:language: yaml
|
||||||
:caption: An empty rougail dictionnary file with only the version
|
:caption: An empty rougail dictionnary file with the version number only
|
||||||
:name: RougailDictionaryEmptyFile
|
:name: RougailDictionaryEmptyFile
|
||||||
|
|
||||||
..
|
..
|
||||||
---
|
---
|
||||||
version: 1.1
|
version: 1.1
|
||||||
|
|
||||||
.. type-along:: a dictionary with a variable
|
.. type-along:: a first variable
|
||||||
|
|
||||||
|
Let's put a variable in the Rougail :term:`structure description file <dictionary>`
|
||||||
|
|
||||||
Let's define a Rougail :term:`structure description file <dictionary>` with something defined in it.
|
|
||||||
|
|
||||||
Defining a variable and its default value
|
Defining a variable and its default value
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
|
@ -80,15 +62,55 @@ This is a first Rougail variable in a Rougail dictionnary.
|
||||||
---
|
---
|
||||||
proxy_mode:
|
proxy_mode:
|
||||||
|
|
||||||
This is a Rougail variable in a Rougail dictionnary, we define a variable with a description of it.
|
- Then we will run this command
|
||||||
|
|
||||||
|
.. code-block:: shell
|
||||||
|
|
||||||
|
rougail -v 1.1 -m firefox/
|
||||||
|
|
||||||
|
which actually outputs an error:
|
||||||
|
|
||||||
|
.. raw:: html
|
||||||
|
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_010/config/01/output_ro.html
|
||||||
|
|
||||||
|
..
|
||||||
|
🛑 ERRORS
|
||||||
|
┣━━ The following variables are mandatory but have no value:
|
||||||
|
┗━━ - proxy_mode
|
||||||
|
|
||||||
|
Because this variable is :term:`mandatory` and needs to be set **but** there's no value yet.
|
||||||
|
|
||||||
|
|
||||||
:ref:`Here is a Rougail variable with a description <RougailDictionaryFirstVariableDescription>`
|
Here we juste add a variable's description, which is a good practice.
|
||||||
|
|
||||||
- define a variable with a description and a default value
|
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_011/firefox/00-proxy.yml
|
||||||
|
:language: yaml
|
||||||
|
:caption: A Rougail dictionnary file with a variable and a description
|
||||||
|
:name: RougailDictionaryFirstVariableDescription
|
||||||
|
|
||||||
|
..
|
||||||
|
---
|
||||||
|
proxy_mode:
|
||||||
|
description: Configure Proxy Access to the Internet
|
||||||
|
|
||||||
|
We need a **default value**.
|
||||||
|
|
||||||
|
.. glossary::
|
||||||
|
|
||||||
|
default values
|
||||||
|
|
||||||
|
A default value is a variable value that is predefined, that is, this value is placed
|
||||||
|
right in the structure file.
|
||||||
|
|
||||||
|
So let's define a variable with a description -- **and a default value**
|
||||||
|
|
||||||
|
|
||||||
|
FIXME GWEN
|
||||||
|
|
||||||
:ref:`Here is a Rougail variable with a default value <RougailDictionaryFirstVariableDefault>`
|
:ref:`Here is a Rougail variable with a default value <RougailDictionaryFirstVariableDefault>`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
The integrator role
|
The integrator role
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
@ -157,7 +179,7 @@ Then the rougail CLI will output an error :
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
:caption: A rougail Command Line Utility call with the :file:`config/01/config.yaml` Rougail dictionnary file
|
:caption: A rougail Command Line Utility call with the :file:`config/01/config.yaml` Rougail dictionnary file
|
||||||
|
|
||||||
foo@bar:~$ rougail -v 1.1 -m firefox -u file -ff config/01/config.yaml
|
rougail -v 1.1 -m firefox -u file -ff config/01/config.yaml
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_010/config/01/output_ro.html
|
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_010/config/01/output_ro.html
|
||||||
|
|
Loading…
Reference in a new issue