doc: example for fill and conventions

This commit is contained in:
2021-12-11 16:33:55 +01:00
parent 8cf8c9b8eb
commit 3dca1349a8
22 changed files with 287 additions and 222 deletions

View File

@ -8,10 +8,10 @@ Une variable est déjà un nom. C'est à dire qu'on pourra utiliser plus tard la
```
<variables>
<variable name="my_variable"/>
<family name="my_family">
<variable name="my_family_variable"/>
</variable>
<variable name="my_variable"/>
<family name="my_family">
<variable name="my_family_variable"/>
</variable>
</variables>
```
@ -123,7 +123,7 @@ Il est possible de fixer les valeurs par défaut d'une variable :
```
<variable name="my_variable">
<value>value</value>
<value>value</value>
</variable>
```
@ -131,8 +131,8 @@ Pour une variable multiple, il est possible de préciser plusieurs valeurs :
```
<variable name="my_variable" multi="True">
<value>value 1</value>
<value>value 2</value>
<value>value 1</value>
<value>value 2</value>
</variable>
```
@ -152,7 +152,9 @@ Attention trois attributs ne sont redéfinisable :
Créons notre variable :
<variable name="my_variable"/>
```
<variable name="my_variable"/>
```
Et redéfinisons là :
@ -186,7 +188,7 @@ Voici une variable a valeur automatiquement modifiée :
```
<variable name="my_variable" auto_save="True">
<value>my_value</value>
<value>my_value</value>
</variable>
```
@ -205,7 +207,7 @@ Voici un variable à valeur en lecture seule automatique :
```
<variable name="server_deployed" type="boolean">
<value>False</value>
<value>False</value>
</variable>
<variable name="my_variable" auto_freeze="True"/>
```

View File

@ -6,9 +6,9 @@ Il est possible d'imposer une liste de valeur pour une variable particulière :
```
<variable name="my_variable" type="choice">
<choice>val1</choice>
<choice>val2</choice>
<choice>val3</choice>
<choice>val1</choice>
<choice>val2</choice>
<choice>val3</choice>
</variable>
```
@ -19,10 +19,10 @@ Si la variable est obligatoire ou si une valeur est précisée (la variable pass
```
<variable name="my_variable" type="choice">
<choice>val1</choice>
<choice>val2</choice>
<choice>val3</choice>
<value>val1</value>
<choice>val1</choice>
<choice>val2</choice>
<choice>val3</choice>
<value>val1</value>
</variable>
```
@ -32,11 +32,11 @@ Par défaut les choix sont de type "string". Il est possible de préciser des no
```
<variable name="my_variable" type="choice">
<choice>val1</choice>
<choice type="string">val2</choice>
<choice type="number">3</choice>
<choice type="boolean">True</choice>
<choice type="nil"/>
<choice>val1</choice>
<choice type="string">val2</choice>
<choice type="number">3</choice>
<choice type="boolean">True</choice>
<choice type="nil"/>
</variable>
```
@ -48,7 +48,7 @@ Pour ajouter un choix à une variable à choix existante, rien de plus simple, j
```
<variable name="my_variable" redefine="True">
<choice>val4</choice>
<choice>val4</choice>
</variable>
```
@ -58,8 +58,8 @@ Si on veut supprimer un choix ou redéfinir complètement la liste, il faut red
```
<variable name="my_variable" redefine="True" remove_choice="True">
<choice>val1</choice>
<choice>val2</choice>
<choice>val1</choice>
<choice>val2</choice>
</variable>
```
@ -71,7 +71,7 @@ Une variable à valeur multiple peut servir de source des choix :
```
<variable name="my_variable" type="choice">
<choice type="variable">other_variable</choice>
<choice type="variable">other_variable</choice>
</variable>
```
@ -82,10 +82,10 @@ Seul un choice de type "variable" est possible par variable.
```
<variable name="my_variable" type="choice">
<choice type="function" name="trange">
<param type="number">0</param>
<param type="number">10</param>
</choice>
<value type="number">9</value>
<choice type="function" name="trange">
<param type="number">0</param>
<param type="number">10</param>
</choice>
<value type="number">9</value>
</variable>
```

View File

@ -33,17 +33,17 @@ Voici un exemple de définition d'une variable meneuse et de deux variables mene
```
<variables>
<family name="family">
<variable name="leader" multi='True'/>
<variable name="follower1"/>
<variable name="follower2" multi='True'/>
</family>
<family name="family">
<variable name="leader" multi='True'/>
<variable name="follower1"/>
<variable name="follower2" multi='True'/>
</family>
</variables>
<constraints>
<group leader="leader">
<follower>follower1</follower>
<follower>follower2</follower>
</group>
<group leader="leader">
<follower>follower1</follower>
<follower>follower2</follower>
</group>
</constraints>
```
@ -53,10 +53,10 @@ Il est possible d'en définit d'autres :
```
<constraints>
<group leader="leader" name="leadership" description="My leadership">
<follower>follower1</follower>
<follower>follower2</follower>
</group>
<group leader="leader" name="leadership" description="My leadership">
<follower>follower1</follower>
<follower>follower2</follower>
</group>
</constraints>
```
@ -66,17 +66,17 @@ Voici un exemple de définition d'une variable meneuse et de deux variables mene
```
<variables>
<family name="family">
<variable name="leader" multi='True'/>
<variable name="follower1"/>
<variable name="follower2" multi='True'/>
</family>
<family name="family">
<variable name="leader" multi='True'/>
<variable name="follower1"/>
<variable name="follower2" multi='True'/>
</family>
</variables>
<constraints>
<group leader="example.family.leader">
<follower>follower1</follower>
<follower>follower2</follower>
</group>
<group leader="example.family.leader">
<follower>follower1</follower>
<follower>follower2</follower>
</group>
</constraints>
```
@ -90,13 +90,13 @@ Pour ajouter, dans un nouveau dictionnaire, une variable suiveuse à notre group
```
<variables>
<family name="family">
<variable name="follower3"/>
</family>
<family name="family">
<variable name="follower3"/>
</family>
</variables>
<constraints>
<group leader="leader">
<follower>follower3</follower>
</group>
<group leader="leader">
<follower>follower3</follower>
</group>
</constraints>
```