diff --git a/docs/family.rst b/docs/family.rst index b4f9044b9..e2601c02d 100644 --- a/docs/family.rst +++ b/docs/family.rst @@ -7,8 +7,9 @@ Synopsis .. glossary:: family - - A family of variables is simply a collection of variables that refer to + subfamily + + A family (or a subnfamiliy) of variables is simply a collection of variables that refer to the same business model category. It's just a variables container. Think of it as a container as well as a namespace. diff --git a/docs/index.rst b/docs/index.rst index f9a77874a..24f01f7d9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,22 +10,21 @@ Rougail .. todo:: définir les termes suivants - family.rst:25: WARNING: label non défini: 'convention on variable names' - /family.rst:114: WARNING: term not in glossary: 'calculation' - /variable.rst:39: WARNING: label non défini: 'convention on variable names' - /variable.rst:83: WARNING: term not in glossary: 'leading' - /variable.rst:100: WARNING: term not in glossary: 'required' - /variable.rst:102: WARNING: term not in glossary: 'leader' - /variable.rst:102: WARNING: term not in glossary: 'follower' - /variable.rst:126: WARNING: term not in glossary: 'multiple' - /variable.rst:126: WARNING: term not in glossary: 'multiple' - /variable.rst:131: WARNING: term not in glossary: 'calculation' - /variable.rst:143: WARNING: term not in glossary: 'calculation' - /variable.rst:148: WARNING: term not in glossary: 'calculation' - /variable.rst:153: WARNING: term not in glossary: 'calculation' - /dictionary.rst:9: WARNING: term not in glossary: 'templates' - /dictionary.rst:19: WARNING: term not in glossary: 'redefine' - /dictionary.rst:24: WARNING: term not in glossary: 'variable_namespace' + 1 check.rst:9: WARNING: term not in glossary: 'validator' + 2 check.rst:56: WARNING: term not in glossary: 'follower' + 3 configuration.rst:43: WARNING: term not in glossary: 'multiple' + 4 family.rst:25: WARNING: label non défini: 'convention on variable names' + 5 structfile.rst:89: WARNING: term not in glossary: 'variable_namespace' + 6 tutorial/tutorial.rst:437: WARNING: term not in glossary: 'leadership' + 7 tutorial/tutorial.rst:546: WARNING: term not in glossary: 'leader' + 8 tutorial/tutorial.rst:547: WARNING: term not in glossary: 'follower' + 9 variable.rst:38: WARNING: label non défini: 'convention on variable names' + 10 variable.rst:137: WARNING: term not in glossary: 'leading' + 11 variable.rst:154: WARNING: term not in glossary: 'required' + 12 variable.rst:156: WARNING: term not in glossary: 'leader' + 13 variable.rst:156: WARNING: term not in glossary: 'follower' + 14 variable.rst:186: WARNING: term not in glossary: 'multiple' + 15 variable.rst:186: WARNING: term not in glossary: 'multiple' .. image:: images/logo.png diff --git a/docs/tutorial/customtype.rst b/docs/tutorial/customtype.rst new file mode 100644 index 000000000..0f0a06ed4 --- /dev/null +++ b/docs/tutorial/customtype.rst @@ -0,0 +1,48 @@ +Custom type +============ + +.. objectives:: Objectives + + We are going to learn how to create custom types. + In short, a custom type is nothing more than a kind of family template. + +.. prerequisites:: Prerequisites + + - We assume that Rougail's library is :ref:`installed ` on your computer. + + - It is possible to retrieve the current state of the various Rougail files manipulated in this tutorial step + by checking out the corresponding tag of the `rougail-tutorials` git repository. + Each tag corresponds to a stage of progress in the tutorial. + 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 ` + in the repository. + + :: + + git clone https://forge.cloud.silique.fr/stove/rougail-tutorials.git + git switch --detach v1.1_080 + +HTTP Proxy with "proxy" type +-------------------------------- + +In this section we will look at the possibilities for adding types. +This feature is essential for having a truly adaptable tool. + +It's possible to add basic types, but that involves modifying +the tiramisu recipe itself. +More simply, it's possible to create custom types, much like defining families. + +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. + +And we also have a new structure file named :file:`00-proxy.yml`. +Let's examine them more closely. + + diff --git a/docs/tutorial/index.rst b/docs/tutorial/index.rst index 30b190f5e..c4a964998 100644 --- a/docs/tutorial/index.rst +++ b/docs/tutorial/index.rst @@ -55,4 +55,5 @@ Let's dive into this **configuration options validation** use case. properties dynfam jinja - + customtype + diff --git a/docs/tutorial/jinja.rst b/docs/tutorial/jinja.rst index 434bdb61e..ace78f9e4 100644 --- a/docs/tutorial/jinja.rst +++ b/docs/tutorial/jinja.rst @@ -31,6 +31,15 @@ Playing with Jinja git clone https://forge.cloud.silique.fr/stove/rougail-tutorials.git git switch --detach v1.1_070 + +.. glossary:: + + calculation + + A calculation is the act of calculating the value of a variable or a property of a variable. + This calculation can be a redirection of the value of an existing variable (or property), + or it can be a custom calculation using the Jinja templating language. + .. type-along:: Why the Jinja templating engine ? We are going to embed some `Jinja templating code `_ in our structure file. @@ -575,6 +584,15 @@ we add a `return_type` parameter in the `hiden` property: when: HTTPS ... + +.. questions:: What about the error message? + + If no text is returned by the Jinja calculation, what about the error message (in case of an error)? + + In case of an error, it is the jinja's description that will appear. + + In our example: `in HTTPS case if "_.use_for_https" is set to "true"` + .. keypoints:: Key points We have seen that the `disabled` or `hidden` properties could be calculated.