docs(tutorial): modes
This commit is contained in:
parent
2c50bc60c8
commit
dad13466be
4 changed files with 73 additions and 3 deletions
|
|
@ -63,7 +63,7 @@ Parameters
|
|||
|
||||
**Default value**: The default mode of a family is the smallest mode of the parent families, child variables, or child families that are contained in that family.
|
||||
|
||||
.. seealso:: tutorial with a real world sample :doc:`mode parameter <../tutorial/mode>` (the tutorial focuses on variable, but the principle is the same for a family)
|
||||
.. seealso:: tutorial with a real world sample :doc:`mode parameter <../tutorial/modes>` (the tutorial focuses on variable, but the principle is the same for a family)
|
||||
|
||||
* - **type**, **_type**
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,45 @@
|
|||
Mode
|
||||
====
|
||||
|
||||
.. index:: mode
|
||||
|
||||
By default, the :term:`mode` is not configured. It is an optional feature.
|
||||
|
||||
Definition
|
||||
---------------
|
||||
|
||||
Let's start by defining what we want to do with the :term:`modes <mode>`.
|
||||
|
||||
.. questions:: What do you mean by "mode"?
|
||||
|
||||
You know, in many applications, in the user interfaces, there are two editing modes:
|
||||
a basic mode and an advanced mode.
|
||||
This way, standard users aren't overwhelmed by an overly complex business view,
|
||||
while domain experts can access more complex views that suit better to their needs.
|
||||
|
||||
We designed this mode concept with that idea in mind.
|
||||
Of course, it can have a broader meaning, and it is possible to define
|
||||
much more varied modes (beyond just "basic" or "expert").
|
||||
|
||||
.. glossary::
|
||||
|
||||
mode
|
||||
|
||||
At the start of the project, the mode was used to set to variables
|
||||
some complexity levels. Some variables were seen as "basic",
|
||||
some other as "normal" (the standard mode) and some variables were seen as "advanced"
|
||||
(the advanced mode).
|
||||
|
||||
It was a way of classifying the variables as follows:
|
||||
we could have a view grouping the usual variables (normal mode)
|
||||
and a view of so-called expert (advanced) variables.
|
||||
|
||||
Regarding variable documentation, we can therefore have
|
||||
a variables documentation designed for the usual user,
|
||||
and a variables documentation designed for advanced users.
|
||||
|
||||
Default behavior
|
||||
------------------
|
||||
|
||||
By default, the mode is not configured. It is an optional feature.
|
||||
We'll present a common example, but you'll need to define your own :term:`modes <mode>` according to your needs.
|
||||
|
||||
Here is our classic use case of :term:`mode` definition. We'll use three :term:`modes <mode>`:
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ Let's dive into this **configuration options validation** use case.
|
|||
document
|
||||
practice1
|
||||
propertyerror
|
||||
modes
|
||||
practice2
|
||||
validators
|
||||
namespace
|
||||
|
|
|
|||
36
docs/tutorial/modes.rst
Normal file
36
docs/tutorial/modes.rst
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
Modes
|
||||
=========
|
||||
|
||||
.. prerequisites:: Prerequisites
|
||||
|
||||
- We assume that Rougail's library is :ref:`installed <installation>` 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 <src/branch/1.1>`,
|
||||
this workshop page corresponds to the tags :tutorial:`v1.1_150 <src/tag/v1.1_150/README.md>` to :tutorial:`v1.1_150 <src/tag/v1.1_150/README.md>`
|
||||
in the repository.
|
||||
|
||||
::
|
||||
|
||||
git clone https://forge.cloud.silique.fr/stove/rougail-tutorials.git
|
||||
git switch --detach v1.1_150
|
||||
|
||||
A variable in avanced mode
|
||||
---------------------------
|
||||
|
||||
on les déclare en CLI `--modes_level basic standard advanced`
|
||||
|
||||
c'est un paramètre à définir sur la famille,
|
||||
`mode: advanced`
|
||||
|
||||
aujourd'hui je m'en sert pour filtrer les variables que je veux dans ma doc
|
||||
Une doc sans les variables avancées qui sera plus courte et une seconde complète.
|
||||
Tu peux expliquer comme ça et on réfléchira au concept plus tard.
|
||||
|
||||
|
||||
à part ça je ne me souviens pas bien de l'usage à l'époque de créole.
|
||||
C'est quand on était dans l'éditeur Créole, on avait un mode basique (boulet) et une mode expert
|
||||
Loading…
Reference in a new issue