Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
1f37457b9f | |||
9f5d0e2497 | |||
af652eda76 | |||
3d4b7b945c | |||
3cc85d7ba5 | |||
12622032a8 | |||
d805cbf565 | |||
46eeb49c5f |
1499 changed files with 28139 additions and 6942 deletions
21
CHANGELOG.md
21
CHANGELOG.md
|
@ -1,3 +1,24 @@
|
||||||
|
## 0.2.0a0 (2024-11-20)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- personalize mode that we want disable documentation
|
||||||
|
- add console output
|
||||||
|
- better dynamique family support
|
||||||
|
- add json output
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- correction for properties in italic
|
||||||
|
|
||||||
|
## 0.1.1a0 (2024-11-08)
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- generate documentation with force_optional configuration
|
||||||
|
|
||||||
|
## 0.1.0 (2024-11-06)
|
||||||
|
|
||||||
## 0.1.0rc1 (2024-11-06)
|
## 0.1.0rc1 (2024-11-06)
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
|
Binary file not shown.
|
@ -5,8 +5,8 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"POT-Creation-Date: 2024-11-01 11:42+0100\n"
|
"POT-Creation-Date: 2024-11-20 21:02+0100\n"
|
||||||
"PO-Revision-Date: 2024-11-01 11:42+0100\n"
|
"PO-Revision-Date: 2024-11-20 21:09+0100\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: fr\n"
|
"Language: fr\n"
|
||||||
|
@ -16,136 +16,238 @@ msgstr ""
|
||||||
"Generated-By: pygettext.py 1.5\n"
|
"Generated-By: pygettext.py 1.5\n"
|
||||||
"X-Generator: Poedit 3.5\n"
|
"X-Generator: Poedit 3.5\n"
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:40
|
#: src/rougail/output_doc/annotator.py:284
|
||||||
msgid "the domain name can starts by a dot"
|
msgid "when the variable \"{0}\" hasn't the value \"{1}\""
|
||||||
msgstr "le nom de domaine peut commencé par un point"
|
msgstr "lorsque la variable \"{0}\" n'a pas la valeur \"{1}\""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:41
|
#: src/rougail/output_doc/annotator.py:290
|
||||||
msgid "the domain name can be a hostname"
|
msgid "when the variable \"{0}\" has the value \"{1}\""
|
||||||
msgstr "le nom de domaine peut être un nom d'hôte"
|
msgstr "lorsque la variable \"{0}\" a la valeur \"{1}\""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:42
|
#: src/rougail/output_doc/annotator.py:306
|
||||||
msgid "the domain name can be an IP"
|
msgid "the value of the information \"{0}\" of the variable \"{1}\""
|
||||||
msgstr "le nom de domaine peut être une IP"
|
msgstr "la valeur de l'information \"{0}\" de la variable \"{1}\""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:43
|
#: src/rougail/output_doc/annotator.py:309
|
||||||
msgid "the domain name can be network in CIDR format"
|
msgid "the value of the global information \"{0}\""
|
||||||
msgstr "le nom de domaine peut être un réseau au format CIDR"
|
msgstr "la valeur de l'information globale \"{0}\""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:48
|
#: src/rougail/output_doc/annotator.py:318
|
||||||
msgid "the minimum value is {0}"
|
msgid "when the identifier is \"{0}\""
|
||||||
msgstr "le valeur minimal est {0}"
|
msgstr "lorsque l'identifiant est \"{0}\""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:49
|
#: src/rougail/output_doc/annotator.py:320
|
||||||
msgid "the maximum value is {0}"
|
msgid "when the identifier is not \"{0}\""
|
||||||
msgstr "le valeur maximal est {0}"
|
msgstr "lorsque l'identifiant n'est pas \"{0}\""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:55
|
#: src/rougail/output_doc/config.py:42
|
||||||
msgid "IP must be in CIDR format"
|
msgid "duplicated level rougail-doc for output \"{0}\": {1} and {2}"
|
||||||
msgstr "IP doit être au format CIDR"
|
msgstr "niveau dupliqué pour rougail-doc pour la sortie \"{0}\": {1} et {2}"
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:56
|
#: src/rougail/output_doc/doc.py:83
|
||||||
msgid "private IP are allowed"
|
|
||||||
msgstr "les IP privées sont autorisés"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:57
|
|
||||||
msgid "reserved IP are allowed"
|
|
||||||
msgstr "les IP réservés sont autorisés"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:62
|
|
||||||
msgid "the host name can be an IP"
|
|
||||||
msgstr "le nom d'hôte peut être une IP"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:67
|
|
||||||
msgid "the domain name in web address can be an IP"
|
|
||||||
msgstr "le nom de domaine dans l'adresse web peut être une IP"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:68
|
|
||||||
msgid "the domain name in web address can be only a hostname"
|
|
||||||
msgstr "le nom de domaine dans l'adresse web ne peut être qu'un nom d'hôte"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:75
|
|
||||||
msgid "can be range of port"
|
|
||||||
msgstr "peut être un range de port"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:76
|
|
||||||
msgid "can have the protocol"
|
|
||||||
msgstr "peut avoir un protocole"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:77
|
|
||||||
msgid "port 0 is allowed"
|
|
||||||
msgstr "le port 0 est autorisé"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:78
|
|
||||||
msgid "ports 1 to 1023 are allowed"
|
|
||||||
msgstr "les ports entre 1 et 1023 sont autorisés"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:79
|
|
||||||
msgid "ports 1024 to 49151 are allowed"
|
|
||||||
msgstr "les ports entre 1024 et 49151 sont autorisés"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:80
|
|
||||||
msgid "ports greater than 49152 are allowed"
|
|
||||||
msgstr "les ports supérieurs à 49152 sont autorisés"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:125
|
|
||||||
msgid "mandatory"
|
msgid "mandatory"
|
||||||
msgstr "obligatoire"
|
msgstr "obligatoire"
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:126
|
#: src/rougail/output_doc/doc.py:84
|
||||||
msgid "hidden"
|
msgid "hidden"
|
||||||
msgstr "caché"
|
msgstr "cachée"
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:127
|
#: src/rougail/output_doc/doc.py:85
|
||||||
msgid "disabled"
|
msgid "disabled"
|
||||||
msgstr "désactivé"
|
msgstr "désactivé"
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:128
|
#: src/rougail/output_doc/doc.py:86
|
||||||
msgid "unique"
|
msgid "unique"
|
||||||
msgstr "unique"
|
msgstr "unique"
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:129
|
#: src/rougail/output_doc/doc.py:87
|
||||||
msgid "auto modified"
|
msgid "auto modified"
|
||||||
msgstr "auto modifiée"
|
msgstr "auto modifiée"
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:163
|
#: src/rougail/output_doc/doc.py:264
|
||||||
msgid "Variables for \"{0}\""
|
msgid "This family contains lists of variable blocks."
|
||||||
msgstr "Variables pour \"{0}\""
|
msgstr "Cette famille contient des listes de bloc de variable."
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:180
|
#: src/rougail/output_doc/doc.py:272
|
||||||
msgid "Variables"
|
msgid "This family builds families dynamically."
|
||||||
msgstr "Variables"
|
msgstr "Cette famille construit des familles dynamiquement."
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:187
|
#: src/rougail/output_doc/doc.py:302
|
||||||
msgid "Example with mandatory variables not filled in"
|
msgid "multiple"
|
||||||
msgstr "Exemple avec des variables obligatoire non renseignée"
|
msgstr "multiple"
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:493
|
#: src/rougail/output_doc/doc.py:322
|
||||||
|
msgid "No attribute \"description\" for \"{0}\" in {1}"
|
||||||
|
msgstr "Aucun attribut \"description\" pour \"{0}\" dans {1}"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/doc.py:420
|
||||||
msgid "(default)"
|
msgid "(default)"
|
||||||
msgstr "(defaut)"
|
msgstr "(défaut)"
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:498
|
#: src/rougail/output_doc/doc.py:427
|
||||||
msgid "Choices"
|
msgid "text based with regular expressions \"{0}\""
|
||||||
msgstr "Choix"
|
msgstr "texte avec expression rationnelle \"{0}\""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:501
|
#: src/rougail/output_doc/doc.py:514
|
||||||
msgid "Default"
|
msgid "depends on a calculation"
|
||||||
msgstr "Défaut"
|
msgstr "dépend d'un calcul"
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:559
|
#: src/rougail/output_doc/doc.py:515
|
||||||
|
msgid "\"{0}\" is a calculation for {1} but has no description in {2}"
|
||||||
|
msgstr "\"{0}\" est un calcul pour {1} mais n'a pas de description dans {2}"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/doc.py:539
|
||||||
msgid "the value of the variable \"{0}\""
|
msgid "the value of the variable \"{0}\""
|
||||||
msgstr "la valeur de la variable \"{0}\""
|
msgstr "la valeur de la variable \"{0}\""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:564
|
#: src/rougail/output_doc/doc.py:549
|
||||||
#: src/rougail/output_doc/__init__.py:566
|
msgid "the value of the identifier"
|
||||||
msgid "value of the {0}"
|
msgstr "la valeur de l'identifiant"
|
||||||
msgstr "la valeur de {0}"
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:638
|
#: src/rougail/output_doc/doc.py:553
|
||||||
#: src/rougail/output_doc/__init__.py:651
|
msgid "the value of the {0}"
|
||||||
|
msgstr "la valeur de l'{0}"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/example.py:38
|
||||||
|
msgid "Example with mandatory variables not filled in"
|
||||||
|
msgstr "Exemple avec des variables obligatoire non renseignée"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/example.py:43
|
||||||
|
msgid "Example with all variables modifiable"
|
||||||
|
msgstr "Exemple avec toutes les variables modifiable"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:41
|
||||||
|
msgid "the domain name can starts by a dot"
|
||||||
|
msgstr "le nom de domaine peut commencé par un point"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:42
|
||||||
|
msgid "the domain name can be a hostname"
|
||||||
|
msgstr "le nom de domaine peut être un nom d'hôte"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:43
|
||||||
|
msgid "the domain name can be an IP"
|
||||||
|
msgstr "le nom de domaine peut être une IP"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:44
|
||||||
|
msgid "the domain name can be network in CIDR format"
|
||||||
|
msgstr "le nom de domaine peut être un réseau au format CIDR"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:49
|
||||||
|
msgid "the minimum value is {0}"
|
||||||
|
msgstr "le valeur minimal est {0}"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:50
|
||||||
|
msgid "the maximum value is {0}"
|
||||||
|
msgstr "le valeur maximal est {0}"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:56
|
||||||
|
msgid "IP must be in CIDR format"
|
||||||
|
msgstr "IP doit être au format CIDR"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:57
|
||||||
|
msgid "private IP are allowed"
|
||||||
|
msgstr "les IP privées sont autorisés"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:58
|
||||||
|
msgid "reserved IP are allowed"
|
||||||
|
msgstr "les IP réservés sont autorisés"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:63
|
||||||
|
msgid "the host name can be an IP"
|
||||||
|
msgstr "le nom d'hôte peut être une IP"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:68
|
||||||
|
msgid "the domain name in web address can be an IP"
|
||||||
|
msgstr "le nom de domaine dans l'adresse web peut être une IP"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:69
|
||||||
|
msgid "the domain name in web address can be only a hostname"
|
||||||
|
msgstr "le nom de domaine dans l'adresse web ne peut être qu'un nom d'hôte"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:76
|
||||||
|
msgid "can be range of port"
|
||||||
|
msgstr "peut être un range de port"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:77
|
||||||
|
msgid "can have the protocol"
|
||||||
|
msgstr "peut avoir un protocole"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:78
|
||||||
|
msgid "port 0 is allowed"
|
||||||
|
msgstr "le port 0 est autorisé"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:79
|
||||||
|
msgid "ports 1 to 1023 are allowed"
|
||||||
|
msgstr "les ports entre 1 et 1023 sont autorisés"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:80
|
||||||
|
msgid "ports 1024 to 49151 are allowed"
|
||||||
|
msgstr "les ports entre 1024 et 49151 sont autorisés"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:81
|
||||||
|
msgid "ports greater than 49152 are allowed"
|
||||||
|
msgstr "les ports supérieurs à 49152 sont autorisés"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:86
|
||||||
|
msgid "minimum length for the secret"
|
||||||
|
msgstr "longueur minimum pour un secret"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:87
|
||||||
|
msgid "maximum length for the secret"
|
||||||
|
msgstr "longueur maximal pour un secret"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:215
|
||||||
|
msgid "Variables"
|
||||||
|
msgstr "Variables"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:232
|
||||||
|
msgid "Variables for \"{0}\""
|
||||||
|
msgstr "Variables pour \"{0}\""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:247
|
||||||
|
msgid "Identifiers"
|
||||||
|
msgstr "Identifiants"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:296
|
||||||
|
msgid "Validator"
|
||||||
|
msgstr "Validateur"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:298
|
||||||
|
msgid "Validators"
|
||||||
|
msgstr "Validateurs"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:300
|
||||||
|
msgid "Choices"
|
||||||
|
msgstr "Choix"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:302
|
||||||
|
msgid "Default"
|
||||||
|
msgstr "Défaut"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:306
|
||||||
msgid "Example"
|
msgid "Example"
|
||||||
msgstr "Exemple"
|
msgstr "Exemple"
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:649
|
#: src/rougail/output_doc/utils.py:308
|
||||||
msgid "Examples"
|
msgid "Examples"
|
||||||
msgstr "Exemples"
|
msgstr "Exemples"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:346
|
||||||
|
msgid "Description"
|
||||||
|
msgstr "Description"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:346
|
||||||
|
msgid "Variable"
|
||||||
|
msgstr "Variable"
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:367
|
||||||
|
msgid "{0}: {1}"
|
||||||
|
msgstr "{0} : {1}"
|
||||||
|
|
||||||
|
#, fuzzy
|
||||||
|
#~| msgid ":"
|
||||||
|
#~ msgid ": "
|
||||||
|
#~ msgstr " : "
|
||||||
|
|
||||||
|
#~ msgid "when the variable \"{0}\" has the value \"True\""
|
||||||
|
#~ msgstr "lorsque la variable \"{0}\" a la valeur \"True\""
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2024-11-01 11:42+0100\n"
|
"POT-Creation-Date: 2024-11-20 21:09+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -15,137 +15,231 @@ msgstr ""
|
||||||
"Generated-By: pygettext.py 1.5\n"
|
"Generated-By: pygettext.py 1.5\n"
|
||||||
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:40
|
#: src/rougail/output_doc/annotator.py:284
|
||||||
msgid "the domain name can starts by a dot"
|
msgid "when the variable \"{0}\" hasn't the value \"{1}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:41
|
#: src/rougail/output_doc/annotator.py:290
|
||||||
msgid "the domain name can be a hostname"
|
msgid "when the variable \"{0}\" has the value \"{1}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:42
|
#: src/rougail/output_doc/annotator.py:306
|
||||||
msgid "the domain name can be an IP"
|
msgid "the value of the information \"{0}\" of the variable \"{1}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:43
|
#: src/rougail/output_doc/annotator.py:309
|
||||||
msgid "the domain name can be network in CIDR format"
|
msgid "the value of the global information \"{0}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:48
|
#: src/rougail/output_doc/annotator.py:318
|
||||||
msgid "the minimum value is {0}"
|
msgid "when the identifier is \"{0}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:49
|
#: src/rougail/output_doc/annotator.py:320
|
||||||
msgid "the maximum value is {0}"
|
msgid "when the identifier is not \"{0}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:55
|
#: src/rougail/output_doc/config.py:42
|
||||||
msgid "IP must be in CIDR format"
|
msgid "duplicated level rougail-doc for output \"{0}\": {1} and {2}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:56
|
#: src/rougail/output_doc/doc.py:83
|
||||||
msgid "private IP are allowed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:57
|
|
||||||
msgid "reserved IP are allowed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:62
|
|
||||||
msgid "the host name can be an IP"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:67
|
|
||||||
msgid "the domain name in web address can be an IP"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:68
|
|
||||||
msgid "the domain name in web address can be only a hostname"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:75
|
|
||||||
msgid "can be range of port"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:76
|
|
||||||
msgid "can have the protocol"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:77
|
|
||||||
msgid "port 0 is allowed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:78
|
|
||||||
msgid "ports 1 to 1023 are allowed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:79
|
|
||||||
msgid "ports 1024 to 49151 are allowed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:80
|
|
||||||
msgid "ports greater than 49152 are allowed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:125
|
|
||||||
msgid "mandatory"
|
msgid "mandatory"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:126
|
#: src/rougail/output_doc/doc.py:84
|
||||||
msgid "hidden"
|
msgid "hidden"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:127
|
#: src/rougail/output_doc/doc.py:85
|
||||||
msgid "disabled"
|
msgid "disabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:128
|
#: src/rougail/output_doc/doc.py:86
|
||||||
msgid "unique"
|
msgid "unique"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:129
|
#: src/rougail/output_doc/doc.py:87
|
||||||
msgid "auto modified"
|
msgid "auto modified"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:163
|
#: src/rougail/output_doc/doc.py:264
|
||||||
msgid "Variables for \"{0}\""
|
msgid "This family contains lists of variable blocks."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:180
|
#: src/rougail/output_doc/doc.py:272
|
||||||
msgid "Variables"
|
msgid "This family builds families dynamically."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:187
|
#: src/rougail/output_doc/doc.py:302
|
||||||
msgid "Example with mandatory variables not filled in"
|
msgid "multiple"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:493
|
#: src/rougail/output_doc/doc.py:322
|
||||||
|
msgid "No attribute \"description\" for \"{0}\" in {1}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/doc.py:420
|
||||||
msgid "(default)"
|
msgid "(default)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:498
|
#: src/rougail/output_doc/doc.py:427
|
||||||
msgid "Choices"
|
msgid "text based with regular expressions \"{0}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:501
|
#: src/rougail/output_doc/doc.py:514
|
||||||
msgid "Default"
|
msgid "depends on a calculation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:559
|
#: src/rougail/output_doc/doc.py:515
|
||||||
|
msgid "\"{0}\" is a calculation for {1} but has no description in {2}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/doc.py:539
|
||||||
msgid "the value of the variable \"{0}\""
|
msgid "the value of the variable \"{0}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:564
|
#: src/rougail/output_doc/doc.py:549
|
||||||
#: src/rougail/output_doc/__init__.py:566
|
msgid "the value of the identifier"
|
||||||
msgid "value of the {0}"
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:638
|
#: src/rougail/output_doc/doc.py:553
|
||||||
#: src/rougail/output_doc/__init__.py:651
|
msgid "the value of the {0}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/example.py:38
|
||||||
|
msgid "Example with mandatory variables not filled in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/example.py:43
|
||||||
|
msgid "Example with all variables modifiable"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:41
|
||||||
|
msgid "the domain name can starts by a dot"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:42
|
||||||
|
msgid "the domain name can be a hostname"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:43
|
||||||
|
msgid "the domain name can be an IP"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:44
|
||||||
|
msgid "the domain name can be network in CIDR format"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:49
|
||||||
|
msgid "the minimum value is {0}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:50
|
||||||
|
msgid "the maximum value is {0}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:56
|
||||||
|
msgid "IP must be in CIDR format"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:57
|
||||||
|
msgid "private IP are allowed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:58
|
||||||
|
msgid "reserved IP are allowed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:63
|
||||||
|
msgid "the host name can be an IP"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:68
|
||||||
|
msgid "the domain name in web address can be an IP"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:69
|
||||||
|
msgid "the domain name in web address can be only a hostname"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:76
|
||||||
|
msgid "can be range of port"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:77
|
||||||
|
msgid "can have the protocol"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:78
|
||||||
|
msgid "port 0 is allowed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:79
|
||||||
|
msgid "ports 1 to 1023 are allowed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:80
|
||||||
|
msgid "ports 1024 to 49151 are allowed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:81
|
||||||
|
msgid "ports greater than 49152 are allowed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:86
|
||||||
|
msgid "minimum length for the secret"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:87
|
||||||
|
msgid "maximum length for the secret"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:215
|
||||||
|
msgid "Variables"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:232
|
||||||
|
msgid "Variables for \"{0}\""
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:247
|
||||||
|
msgid "Identifiers"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:296
|
||||||
|
msgid "Validator"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:298
|
||||||
|
msgid "Validators"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:300
|
||||||
|
msgid "Choices"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:302
|
||||||
|
msgid "Default"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:306
|
||||||
msgid "Example"
|
msgid "Example"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/output_doc/__init__.py:649
|
#: src/rougail/output_doc/utils.py:308
|
||||||
msgid "Examples"
|
msgid "Examples"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:346
|
||||||
|
msgid "Description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:346
|
||||||
|
msgid "Variable"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/output_doc/utils.py:367
|
||||||
|
msgid "{0}: {1}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail.output_doc"
|
name = "rougail.output_doc"
|
||||||
version = "0.1.0"
|
version = "0.2.0a0"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
description = "Rougail output doc"
|
description = "Rougail output doc"
|
||||||
|
@ -25,8 +25,9 @@ classifiers = [
|
||||||
|
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rougail ~= 1.1,<2",
|
"rougail ~= 1.2,<2",
|
||||||
"tabulate ~= 0.9.0",
|
"tabulate ~= 0.9.0",
|
||||||
|
"rich ~= 13.9.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
|
@ -37,5 +38,5 @@ name = "cz_conventional_commits"
|
||||||
tag_format = "$version"
|
tag_format = "$version"
|
||||||
version_scheme = "pep440"
|
version_scheme = "pep440"
|
||||||
version_provider = "pep621"
|
version_provider = "pep621"
|
||||||
#update_changelog_on_bump = true
|
update_changelog_on_bump = true
|
||||||
changelog_merge_prerelease = true
|
changelog_merge_prerelease = true
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
"""
|
"""
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2024
|
Copyright (C) 2024
|
||||||
|
@ -16,671 +15,8 @@ details.
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
# FIXME si plusieurs example dont le 1er est none tester les autres : tests/dictionaries/00_8test_none
|
|
||||||
from tiramisu import Calculation
|
|
||||||
from tiramisu.error import display_list
|
|
||||||
import tabulate as tabulate_module
|
|
||||||
from tabulate import tabulate
|
|
||||||
from warnings import warn
|
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from rougail.error import display_xmlfiles
|
from .doc import RougailOutputDoc
|
||||||
from rougail import RougailConfig, Rougail, CONVERT_OPTION
|
|
||||||
from rougail.object_model import PROPERTY_ATTRIBUTE
|
|
||||||
|
|
||||||
from .config import OutPuts
|
|
||||||
from .i18n import _
|
|
||||||
|
|
||||||
ENTER = "\n\n"
|
|
||||||
|
|
||||||
|
|
||||||
DocTypes = {
|
|
||||||
"domainname": {
|
|
||||||
"params": {
|
|
||||||
"allow_startswith_dot": _("the domain name can starts by a dot"),
|
|
||||||
"allow_without_dot": _("the domain name can be a hostname"),
|
|
||||||
"allow_ip": _("the domain name can be an IP"),
|
|
||||||
"allow_cidr_network": _("the domain name can be network in CIDR format"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"number": {
|
|
||||||
"params": {
|
|
||||||
"min_number": _("the minimum value is {0}"),
|
|
||||||
"max_number": _("the maximum value is {0}"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"ip": {
|
|
||||||
"msg": "IP",
|
|
||||||
"params": {
|
|
||||||
"cidr": _("IP must be in CIDR format"),
|
|
||||||
"private_only": _("private IP are allowed"),
|
|
||||||
"allow_reserved": _("reserved IP are allowed"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"hostname": {
|
|
||||||
"params": {
|
|
||||||
"allow_ip": _("the host name can be an IP"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"web_address": {
|
|
||||||
"params": {
|
|
||||||
"allow_ip": _("the domain name in web address can be an IP"),
|
|
||||||
"allow_without_dot": _(
|
|
||||||
"the domain name in web address can be only a hostname"
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"port": {
|
|
||||||
"params": {
|
|
||||||
"allow_range": _("can be range of port"),
|
|
||||||
"allow_protocol": _("can have the protocol"),
|
|
||||||
"allow_zero": _("port 0 is allowed"),
|
|
||||||
"allow_wellknown": _("ports 1 to 1023 are allowed"),
|
|
||||||
"allow_registred": _("ports 1024 to 49151 are allowed"),
|
|
||||||
"allow_private": _("ports greater than 49152 are allowed"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ROUGAIL_VARIABLE_TYPE = (
|
|
||||||
"https://rougail.readthedocs.io/en/latest/variable.html#variables-types"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class RougailOutputDoc:
|
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
*,
|
|
||||||
config: "Config" = None,
|
|
||||||
rougailconfig: RougailConfig = None,
|
|
||||||
**kwarg,
|
|
||||||
):
|
|
||||||
if rougailconfig is None:
|
|
||||||
rougailconfig = RougailConfig
|
|
||||||
if rougailconfig["step.output"] != "doc":
|
|
||||||
rougailconfig["step.output"] = "doc"
|
|
||||||
if rougailconfig["step.output"] != "doc":
|
|
||||||
raise Exception("doc is not set as step.output")
|
|
||||||
self.rougailconfig = rougailconfig
|
|
||||||
outputs = OutPuts().get()
|
|
||||||
output = self.rougailconfig["doc.output_format"]
|
|
||||||
if output not in outputs:
|
|
||||||
raise Exception(
|
|
||||||
f'cannot find output "{output}", available outputs: {list(outputs)}'
|
|
||||||
)
|
|
||||||
if config is None:
|
|
||||||
rougail = Rougail(self.rougailconfig)
|
|
||||||
rougail.converted.plugins.append("output_doc")
|
|
||||||
config = rougail.get_config()
|
|
||||||
self.conf = config
|
|
||||||
self.conf.property.setdefault(frozenset({"advanced"}), "read_write", "append")
|
|
||||||
self.conf.property.read_write()
|
|
||||||
self.conf.property.remove("cache")
|
|
||||||
self.dynamic_paths = {}
|
|
||||||
self.formater = outputs[output]()
|
|
||||||
self.level = self.rougailconfig["doc.title_level"]
|
|
||||||
# self.property_to_string = [('mandatory', 'obligatoire'), ('hidden', 'cachée'), ('disabled', 'désactivée'), ('unique', 'unique'), ('force_store_value', 'modifié automatiquement')]
|
|
||||||
self.property_to_string = [
|
|
||||||
("mandatory", _("mandatory")),
|
|
||||||
("hidden", _("hidden")),
|
|
||||||
("disabled", _("disabled")),
|
|
||||||
("unique", _("unique")),
|
|
||||||
("force_store_value", _("auto modified")),
|
|
||||||
]
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
print(self.gen_doc())
|
|
||||||
|
|
||||||
def gen_doc(self):
|
|
||||||
tabulate_module.PRESERVE_WHITESPACE = True
|
|
||||||
examples_mini = {}
|
|
||||||
examples_all = {}
|
|
||||||
return_string = self.formater.header()
|
|
||||||
if self.rougailconfig["main_namespace"]:
|
|
||||||
for namespace in self.conf.unrestraint.list():
|
|
||||||
name = namespace.name()
|
|
||||||
examples_mini[name] = {}
|
|
||||||
examples_all[name] = {}
|
|
||||||
doc = (
|
|
||||||
self._display_doc(
|
|
||||||
self.display_families(
|
|
||||||
namespace,
|
|
||||||
self.level + 1,
|
|
||||||
examples_mini[name],
|
|
||||||
examples_all[name],
|
|
||||||
),
|
|
||||||
[],
|
|
||||||
)
|
|
||||||
+ "\n"
|
|
||||||
)
|
|
||||||
if not examples_mini[name]:
|
|
||||||
del examples_mini[name]
|
|
||||||
if not examples_all[name]:
|
|
||||||
del examples_all[name]
|
|
||||||
else:
|
|
||||||
return_string += self.formater.title(
|
|
||||||
_('Variables for "{0}"').format(namespace.name()), self.level
|
|
||||||
)
|
|
||||||
return_string += doc
|
|
||||||
else:
|
|
||||||
doc = (
|
|
||||||
self._display_doc(
|
|
||||||
self.display_families(
|
|
||||||
self.conf.unrestraint,
|
|
||||||
self.level + 1,
|
|
||||||
examples_mini,
|
|
||||||
examples_all,
|
|
||||||
),
|
|
||||||
[],
|
|
||||||
)
|
|
||||||
+ "\n"
|
|
||||||
)
|
|
||||||
if examples_all:
|
|
||||||
return_string += self.formater.title(_("Variables"), self.level)
|
|
||||||
return_string += doc
|
|
||||||
if not examples_all:
|
|
||||||
return ""
|
|
||||||
if self.rougailconfig["doc.with_example"]:
|
|
||||||
if examples_mini:
|
|
||||||
return_string += self.formater.title(
|
|
||||||
_("Example with mandatory variables not filled in"), self.level
|
|
||||||
)
|
|
||||||
return_string += self.formater.yaml(examples_mini)
|
|
||||||
if examples_all:
|
|
||||||
return_string += self.formater.title(
|
|
||||||
"Example with all variables modifiable", self.level
|
|
||||||
)
|
|
||||||
return_string += self.formater.yaml(examples_all)
|
|
||||||
return return_string
|
|
||||||
|
|
||||||
def _display_doc(self, variables, add_paths):
|
|
||||||
return_string = ""
|
|
||||||
for variable in variables:
|
|
||||||
typ = variable["type"]
|
|
||||||
path = variable["path"]
|
|
||||||
if path in add_paths:
|
|
||||||
continue
|
|
||||||
if typ == "family":
|
|
||||||
return_string += variable["title"]
|
|
||||||
return_string += self._display_doc(variable["objects"], add_paths)
|
|
||||||
else:
|
|
||||||
for idx, path in enumerate(variable["paths"]):
|
|
||||||
if path in self.dynamic_paths:
|
|
||||||
paths_msg = display_list(
|
|
||||||
[
|
|
||||||
self.formater.bold(path_)
|
|
||||||
for path_ in self.dynamic_paths[path]["paths"]
|
|
||||||
],
|
|
||||||
separator="or",
|
|
||||||
)
|
|
||||||
variable["objects"][idx][0] = variable["objects"][idx][
|
|
||||||
0
|
|
||||||
].replace("{{ ROUGAIL_PATH }}", paths_msg)
|
|
||||||
identifiers = self.dynamic_paths[path]["identifiers"]
|
|
||||||
description = variable["objects"][idx][1][0]
|
|
||||||
if "{{ identifier }}" in description:
|
|
||||||
if description.endswith("."):
|
|
||||||
description = description[:-1]
|
|
||||||
comment_msg = self.to_phrase(
|
|
||||||
display_list(
|
|
||||||
[
|
|
||||||
description.replace(
|
|
||||||
"{{ identifier }}",
|
|
||||||
self.formater.italic(identifier),
|
|
||||||
)
|
|
||||||
for identifier in identifiers
|
|
||||||
],
|
|
||||||
separator="or",
|
|
||||||
add_quote=True,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
variable["objects"][idx][1][0] = comment_msg
|
|
||||||
variable["objects"][idx][1] = self.formater.join(
|
|
||||||
variable["objects"][idx][1]
|
|
||||||
)
|
|
||||||
return_string += (
|
|
||||||
self.formater.table(
|
|
||||||
tabulate(
|
|
||||||
variable["objects"],
|
|
||||||
headers=self.formater.table_header(
|
|
||||||
["Variable", "Description"]
|
|
||||||
),
|
|
||||||
tablefmt=self.formater.name,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
+ "\n\n"
|
|
||||||
)
|
|
||||||
add_paths.append(path)
|
|
||||||
return return_string
|
|
||||||
|
|
||||||
def is_hidden(self, child):
|
|
||||||
properties = child.property.get(uncalculated=True)
|
|
||||||
for hidden_property in ["hidden", "disabled", "advanced"]:
|
|
||||||
if hidden_property in properties:
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def display_families(
|
|
||||||
self,
|
|
||||||
family,
|
|
||||||
level,
|
|
||||||
examples_mini,
|
|
||||||
examples_all,
|
|
||||||
):
|
|
||||||
variables = []
|
|
||||||
for child in family.list():
|
|
||||||
if self.is_hidden(child):
|
|
||||||
continue
|
|
||||||
if not child.isoptiondescription():
|
|
||||||
if child.isfollower() and child.index() != 0:
|
|
||||||
# only add to example
|
|
||||||
self.display_variable(
|
|
||||||
child,
|
|
||||||
examples_mini,
|
|
||||||
examples_all,
|
|
||||||
)
|
|
||||||
continue
|
|
||||||
path = child.path(uncalculated=True)
|
|
||||||
if child.isdynamic():
|
|
||||||
self.dynamic_paths.setdefault(
|
|
||||||
path, {"paths": [], "identifiers": []}
|
|
||||||
)["paths"].append(child.path())
|
|
||||||
self.dynamic_paths[path]["identifiers"].append(
|
|
||||||
child.identifiers()[-1]
|
|
||||||
)
|
|
||||||
if not variables or variables[-1]["type"] != "variables":
|
|
||||||
variables.append(
|
|
||||||
{
|
|
||||||
"type": "variables",
|
|
||||||
"objects": [],
|
|
||||||
"path": path,
|
|
||||||
"paths": [],
|
|
||||||
}
|
|
||||||
)
|
|
||||||
variables[-1]["objects"].append(
|
|
||||||
self.display_variable(
|
|
||||||
child,
|
|
||||||
examples_mini,
|
|
||||||
examples_all,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
variables[-1]["paths"].append(path)
|
|
||||||
else:
|
|
||||||
name = child.name()
|
|
||||||
if child.isleadership():
|
|
||||||
examples_mini[name] = []
|
|
||||||
examples_all[name] = []
|
|
||||||
else:
|
|
||||||
examples_mini[name] = {}
|
|
||||||
examples_all[name] = {}
|
|
||||||
variables.append(
|
|
||||||
{
|
|
||||||
"type": "family",
|
|
||||||
"title": self.display_family(
|
|
||||||
child,
|
|
||||||
level,
|
|
||||||
),
|
|
||||||
"path": child.path(uncalculated=True),
|
|
||||||
"objects": self.display_families(
|
|
||||||
child,
|
|
||||||
level + 1,
|
|
||||||
examples_mini[name],
|
|
||||||
examples_all[name],
|
|
||||||
),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if not examples_mini[name]:
|
|
||||||
del examples_mini[name]
|
|
||||||
if not examples_all[name]:
|
|
||||||
del examples_all[name]
|
|
||||||
return variables
|
|
||||||
|
|
||||||
def display_family(
|
|
||||||
self,
|
|
||||||
family,
|
|
||||||
level,
|
|
||||||
):
|
|
||||||
if family.name() != family.description(uncalculated=True):
|
|
||||||
title = f"{family.description(uncalculated=True)}"
|
|
||||||
else:
|
|
||||||
warning = f'No attribute "description" for family "{family.path()}" in {display_xmlfiles(family.information.get("dictionaries"))}'
|
|
||||||
warn(warning)
|
|
||||||
title = f"{family.path()}"
|
|
||||||
isdynamic = family.isdynamic(only_self=True)
|
|
||||||
if isdynamic:
|
|
||||||
identifiers = family.identifiers(only_self=True)
|
|
||||||
if "{{ identifier }}" in title:
|
|
||||||
title = display_list(
|
|
||||||
[
|
|
||||||
title.replace(
|
|
||||||
"{{ identifier }}", self.formater.italic(identifier)
|
|
||||||
)
|
|
||||||
for identifier in identifiers
|
|
||||||
],
|
|
||||||
separator="or",
|
|
||||||
add_quote=True,
|
|
||||||
)
|
|
||||||
msg = self.formater.title(title, level)
|
|
||||||
subparameter = []
|
|
||||||
self.manage_properties(family, subparameter)
|
|
||||||
if subparameter:
|
|
||||||
msg += self.subparameter_to_string(subparameter) + ENTER
|
|
||||||
comment = []
|
|
||||||
self.subparameter_to_parameter(subparameter, comment)
|
|
||||||
if comment:
|
|
||||||
msg += "\n".join(comment) + ENTER
|
|
||||||
help = self.to_phrase(family.information.get("help", ""))
|
|
||||||
if help:
|
|
||||||
msg += "\n" + help + ENTER
|
|
||||||
if family.isleadership():
|
|
||||||
# help = "Cette famille contient des listes de bloc de variables."
|
|
||||||
help = "This family contains lists of variable blocks."
|
|
||||||
msg += "\n" + help + ENTER
|
|
||||||
if isdynamic:
|
|
||||||
identifiers = family.identifiers(only_self=True, uncalculated=True)
|
|
||||||
if isinstance(identifiers, Calculation):
|
|
||||||
identifiers = self.to_string(family, "dynamic")
|
|
||||||
if isinstance(identifiers, list):
|
|
||||||
for idx, val in enumerate(identifiers):
|
|
||||||
if not isinstance(val, Calculation):
|
|
||||||
continue
|
|
||||||
identifiers[idx] = self.to_string(family, "dynamic", f"_{idx}")
|
|
||||||
identifiers = self.formater.list(identifiers)
|
|
||||||
# help = f"Cette famille construit des familles dynamiquement.\n\n{self.formater.bold('Identifiers')}: {identifiers}"
|
|
||||||
help = f"This family builds families dynamically.\n\n{self.formater.bold('Identifiers')}: {identifiers}"
|
|
||||||
msg += "\n" + help + ENTER
|
|
||||||
return msg
|
|
||||||
|
|
||||||
def manage_properties(
|
|
||||||
self,
|
|
||||||
variable,
|
|
||||||
subparameter,
|
|
||||||
):
|
|
||||||
properties = variable.property.get(uncalculated=True)
|
|
||||||
for mode in self.rougailconfig["modes_level"]:
|
|
||||||
if mode in properties:
|
|
||||||
subparameter.append((self.formater.prop(mode), None, None))
|
|
||||||
break
|
|
||||||
for prop, msg in self.property_to_string:
|
|
||||||
if prop in properties:
|
|
||||||
subparameter.append((self.formater.prop(msg), None, None))
|
|
||||||
elif variable.information.get(f"{prop}_calculation", False):
|
|
||||||
subparameter.append(
|
|
||||||
(self.formater.prop(msg), msg, self.to_string(variable, prop))
|
|
||||||
)
|
|
||||||
|
|
||||||
def subparameter_to_string(
|
|
||||||
self,
|
|
||||||
subparameter,
|
|
||||||
):
|
|
||||||
subparameter_str = ""
|
|
||||||
for param in subparameter:
|
|
||||||
if param[1]:
|
|
||||||
subparameter_str += f"_{param[0]}_ "
|
|
||||||
else:
|
|
||||||
subparameter_str += f"{param[0]} "
|
|
||||||
return subparameter_str[:-1]
|
|
||||||
|
|
||||||
def subparameter_to_parameter(
|
|
||||||
self,
|
|
||||||
subparameter,
|
|
||||||
comment,
|
|
||||||
):
|
|
||||||
for param in subparameter:
|
|
||||||
if not param[1]:
|
|
||||||
continue
|
|
||||||
msg = param[2]
|
|
||||||
comment.append(f"{self.formater.bold(param[1].capitalize())}: {msg}")
|
|
||||||
|
|
||||||
def to_phrase(self, msg):
|
|
||||||
if not msg:
|
|
||||||
return ""
|
|
||||||
msg = str(msg).strip()
|
|
||||||
if not msg.endswith("."):
|
|
||||||
msg += "."
|
|
||||||
return msg[0].upper() + msg[1:]
|
|
||||||
|
|
||||||
def display_variable(
|
|
||||||
self,
|
|
||||||
variable,
|
|
||||||
examples_mini,
|
|
||||||
examples_all,
|
|
||||||
):
|
|
||||||
if variable.isdynamic():
|
|
||||||
parameter = ["{{ ROUGAIL_PATH }}"]
|
|
||||||
else:
|
|
||||||
parameter = [f"{self.formater.bold(variable.path())}"]
|
|
||||||
subparameter = []
|
|
||||||
description = variable.description(uncalculated=True)
|
|
||||||
comment = [self.to_phrase(description)]
|
|
||||||
help_ = self.to_phrase(variable.information.get("help", ""))
|
|
||||||
if help_:
|
|
||||||
comment.append(help_)
|
|
||||||
self.type_to_string(
|
|
||||||
variable,
|
|
||||||
subparameter,
|
|
||||||
comment,
|
|
||||||
)
|
|
||||||
self.manage_properties(
|
|
||||||
variable,
|
|
||||||
subparameter,
|
|
||||||
)
|
|
||||||
if variable.ismulti():
|
|
||||||
multi = not variable.isfollower() or variable.issubmulti()
|
|
||||||
else:
|
|
||||||
multi = False
|
|
||||||
if multi:
|
|
||||||
subparameter.append((self.formater.prop("multiple"), None, None))
|
|
||||||
if subparameter:
|
|
||||||
parameter.append(self.subparameter_to_string(subparameter))
|
|
||||||
if variable.name() == description:
|
|
||||||
warning = f'No attribute "description" for variable "{variable.path()}" in {display_xmlfiles(variable.information.get("dictionaries"))}'
|
|
||||||
warn(warning)
|
|
||||||
default = self.get_default(
|
|
||||||
variable,
|
|
||||||
comment,
|
|
||||||
)
|
|
||||||
default_in_choices = False
|
|
||||||
if variable.information.get("type") == "choice":
|
|
||||||
choices = variable.value.list(uncalculated=True)
|
|
||||||
if isinstance(choices, Calculation):
|
|
||||||
choices = self.to_string(variable, "choice")
|
|
||||||
if isinstance(choices, list):
|
|
||||||
for idx, val in enumerate(choices):
|
|
||||||
if not isinstance(val, Calculation):
|
|
||||||
if default is not None and val == default:
|
|
||||||
choices[idx] = str(val) + " ← " + _("(default)")
|
|
||||||
default_in_choices = True
|
|
||||||
continue
|
|
||||||
choices[idx] = self.to_string(variable, "choice", f"_{idx}")
|
|
||||||
choices = self.formater.list(choices)
|
|
||||||
comment.append(f'{self.formater.bold(_("Choices"))}: {choices}')
|
|
||||||
# choice
|
|
||||||
if default is not None and not default_in_choices:
|
|
||||||
comment.append(f"{self.formater.bold(_('Default'))}: {default}")
|
|
||||||
self.manage_exemples(
|
|
||||||
multi,
|
|
||||||
variable,
|
|
||||||
examples_all,
|
|
||||||
examples_mini,
|
|
||||||
comment,
|
|
||||||
)
|
|
||||||
self.subparameter_to_parameter(subparameter, comment)
|
|
||||||
self.formater.columns(parameter, comment)
|
|
||||||
return [self.formater.join(parameter), comment]
|
|
||||||
|
|
||||||
def get_default(
|
|
||||||
self,
|
|
||||||
variable,
|
|
||||||
comment,
|
|
||||||
):
|
|
||||||
if variable.information.get("fake_default", False):
|
|
||||||
default = None
|
|
||||||
else:
|
|
||||||
default = variable.value.get(uncalculated=True)
|
|
||||||
if default in [None, []]:
|
|
||||||
return
|
|
||||||
if isinstance(default, Calculation):
|
|
||||||
default = self.to_string(variable, "default")
|
|
||||||
if isinstance(default, list):
|
|
||||||
for idx, val in enumerate(default):
|
|
||||||
if not isinstance(val, Calculation):
|
|
||||||
continue
|
|
||||||
default[idx] = self.to_string(variable, "default", f"_{idx}")
|
|
||||||
default = self.formater.list(default)
|
|
||||||
return default
|
|
||||||
|
|
||||||
def to_string(
|
|
||||||
self,
|
|
||||||
variable,
|
|
||||||
prop,
|
|
||||||
identifier="",
|
|
||||||
):
|
|
||||||
calculation_type = variable.information.get(
|
|
||||||
f"{prop}_calculation_type{identifier}", None
|
|
||||||
)
|
|
||||||
if not calculation_type:
|
|
||||||
raise Exception(
|
|
||||||
f"cannot find {prop}_calculation_type{identifier} information, do you have declare doc has a plugins?"
|
|
||||||
)
|
|
||||||
calculation = variable.information.get(f"{prop}_calculation{identifier}")
|
|
||||||
if calculation_type == "jinja":
|
|
||||||
if calculation is not True:
|
|
||||||
values = self.formater.to_string(calculation)
|
|
||||||
else:
|
|
||||||
values = "depends on a calculation"
|
|
||||||
warning = f'"{prop}" is a calculation for {variable.path()} but has no description in {display_xmlfiles(variable.information.get("dictionaries"))}'
|
|
||||||
warn(warning)
|
|
||||||
elif calculation_type == "variable":
|
|
||||||
if prop in PROPERTY_ATTRIBUTE:
|
|
||||||
values = self.formater.to_string(calculation)
|
|
||||||
else:
|
|
||||||
values = _('the value of the variable "{0}"').format(calculation)
|
|
||||||
elif calculation_type == "identifier":
|
|
||||||
if prop in PROPERTY_ATTRIBUTE:
|
|
||||||
values = self.formater.to_string(calculation)
|
|
||||||
else:
|
|
||||||
values = _("value of the {0}").format(calculation_type)
|
|
||||||
else:
|
|
||||||
values = _("value of the {0}").format(calculation_type)
|
|
||||||
if not values.endswith("."):
|
|
||||||
values += "."
|
|
||||||
return values
|
|
||||||
|
|
||||||
def type_to_string(
|
|
||||||
self,
|
|
||||||
variable,
|
|
||||||
subparameter,
|
|
||||||
comment,
|
|
||||||
):
|
|
||||||
variable_type = variable.information.get("type")
|
|
||||||
doc_type = DocTypes.get(variable_type, {"params": {}})
|
|
||||||
subparameter.append(
|
|
||||||
(
|
|
||||||
self.formater.link(
|
|
||||||
doc_type.get("msg", variable_type), ROUGAIL_VARIABLE_TYPE
|
|
||||||
),
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
option = variable.get()
|
|
||||||
validators = []
|
|
||||||
for param, msg in doc_type["params"].items():
|
|
||||||
value = option.impl_get_extra(f"_{param}")
|
|
||||||
if value is None:
|
|
||||||
value = option.impl_get_extra(param)
|
|
||||||
if value is not None and value is not False:
|
|
||||||
validators.append(msg.format(value))
|
|
||||||
valids = [
|
|
||||||
name
|
|
||||||
for name in variable.information.list()
|
|
||||||
if name.startswith("validators_calculation_type_")
|
|
||||||
]
|
|
||||||
if valids:
|
|
||||||
for idx in range(len(valids)):
|
|
||||||
validators.append(
|
|
||||||
self.to_string(
|
|
||||||
variable,
|
|
||||||
"validators",
|
|
||||||
f"_{idx}",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
if validators:
|
|
||||||
if len(validators) == 1:
|
|
||||||
comment.append(f'{self.formater.bold("Validator")}: ' + validators[0])
|
|
||||||
else:
|
|
||||||
comment.append(
|
|
||||||
f'{self.formater.bold("Validators")}:'
|
|
||||||
+ self.formater.list(validators)
|
|
||||||
)
|
|
||||||
|
|
||||||
def manage_exemples(
|
|
||||||
self,
|
|
||||||
multi,
|
|
||||||
variable,
|
|
||||||
examples_all,
|
|
||||||
examples_mini,
|
|
||||||
comment,
|
|
||||||
):
|
|
||||||
example_mini = None
|
|
||||||
example_all = None
|
|
||||||
example = variable.information.get("examples", None)
|
|
||||||
if example is None:
|
|
||||||
example = variable.information.get("test", None)
|
|
||||||
default = variable.value.get()
|
|
||||||
if isinstance(example, tuple):
|
|
||||||
example = list(example)
|
|
||||||
mandatory = "mandatory" in variable.property.get(uncalculated=True)
|
|
||||||
if example:
|
|
||||||
if not multi:
|
|
||||||
example = example[0]
|
|
||||||
title = _("Example")
|
|
||||||
if mandatory:
|
|
||||||
example_mini = example
|
|
||||||
example_all = example
|
|
||||||
else:
|
|
||||||
if mandatory:
|
|
||||||
example_mini = "\n - example"
|
|
||||||
example_all = example
|
|
||||||
len_test = len(example)
|
|
||||||
example = self.formater.list(example)
|
|
||||||
if len_test > 1:
|
|
||||||
title = _("Examples")
|
|
||||||
else:
|
|
||||||
title = _("Example")
|
|
||||||
comment.append(f"{self.formater.bold(title)}: {example}")
|
|
||||||
elif default not in [None, []]:
|
|
||||||
example_all = default
|
|
||||||
else:
|
|
||||||
example = CONVERT_OPTION.get(variable.information.get("type"), {}).get(
|
|
||||||
"example", None
|
|
||||||
)
|
|
||||||
if example is None:
|
|
||||||
example = "xxx"
|
|
||||||
if multi:
|
|
||||||
example = [example]
|
|
||||||
if mandatory:
|
|
||||||
example_mini = example
|
|
||||||
example_all = example
|
|
||||||
if variable.isleader():
|
|
||||||
if example_mini is not None:
|
|
||||||
for mini in example_mini:
|
|
||||||
examples_mini.append({variable.name(): mini})
|
|
||||||
if example_all is not None:
|
|
||||||
for mall in example_all:
|
|
||||||
examples_all.append({variable.name(): mall})
|
|
||||||
elif variable.isfollower():
|
|
||||||
if example_mini is not None:
|
|
||||||
for idx in range(0, len(examples_mini)):
|
|
||||||
examples_mini[idx][variable.name()] = example_mini
|
|
||||||
if example_all is not None:
|
|
||||||
for idx in range(0, len(examples_all)):
|
|
||||||
examples_all[idx][variable.name()] = example_all
|
|
||||||
else:
|
|
||||||
if example_mini is not None:
|
|
||||||
examples_mini[variable.name()] = example_mini
|
|
||||||
examples_all[variable.name()] = example_all
|
|
||||||
|
|
||||||
|
|
||||||
RougailOutput = RougailOutputDoc
|
RougailOutput = RougailOutputDoc
|
||||||
|
|
|
@ -20,11 +20,12 @@ along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
from tiramisu import undefined
|
from tiramisu import undefined
|
||||||
from rougail.annotator.variable import Walk
|
from rougail.annotator.variable import Walk
|
||||||
|
|
||||||
from rougail.i18n import _
|
from rougail.output_doc.i18n import _
|
||||||
from rougail.error import DictConsistencyError
|
|
||||||
from rougail.object_model import (
|
from rougail.object_model import (
|
||||||
Calculation,
|
Calculation,
|
||||||
JinjaCalculation,
|
JinjaCalculation,
|
||||||
|
@ -37,6 +38,7 @@ from rougail.object_model import (
|
||||||
CONVERT_OPTION,
|
CONVERT_OPTION,
|
||||||
PROPERTY_ATTRIBUTE,
|
PROPERTY_ATTRIBUTE,
|
||||||
)
|
)
|
||||||
|
from rougail.output_doc.utils import dump
|
||||||
|
|
||||||
|
|
||||||
class Annotator(Walk):
|
class Annotator(Walk):
|
||||||
|
@ -47,7 +49,7 @@ class Annotator(Walk):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
objectspace,
|
objectspace,
|
||||||
*args,
|
*args, # pylint: disable=unused-argument
|
||||||
) -> None:
|
) -> None:
|
||||||
if not objectspace.paths:
|
if not objectspace.paths:
|
||||||
return
|
return
|
||||||
|
@ -55,42 +57,6 @@ class Annotator(Walk):
|
||||||
self.populate_family()
|
self.populate_family()
|
||||||
self.populate_variable()
|
self.populate_variable()
|
||||||
|
|
||||||
def get_examples_values(self, variable):
|
|
||||||
values = self.objectspace.informations.get(variable.path).get("examples", None)
|
|
||||||
if not values:
|
|
||||||
values = self.objectspace.informations.get(variable.path).get("test", None)
|
|
||||||
if isinstance(values, tuple):
|
|
||||||
values = list(values)
|
|
||||||
return values
|
|
||||||
|
|
||||||
def add_default_value(
|
|
||||||
self,
|
|
||||||
family,
|
|
||||||
value,
|
|
||||||
*,
|
|
||||||
inside_list=False,
|
|
||||||
) -> None:
|
|
||||||
if isinstance(value, Calculation):
|
|
||||||
default_values = "example"
|
|
||||||
if not inside_list:
|
|
||||||
default_values = [default_values]
|
|
||||||
if isinstance(value, (VariableCalculation, VariablePropertyCalculation)):
|
|
||||||
variable, identifier = self.objectspace.paths.get_with_dynamic(
|
|
||||||
value.variable,
|
|
||||||
value.path_prefix,
|
|
||||||
family.path,
|
|
||||||
value.version,
|
|
||||||
value.namespace,
|
|
||||||
value.xmlfiles,
|
|
||||||
)
|
|
||||||
values = self.get_examples_values(variable)
|
|
||||||
if values:
|
|
||||||
if inside_list:
|
|
||||||
default_values = list(values)
|
|
||||||
else:
|
|
||||||
default_values = values
|
|
||||||
value.default_values = default_values
|
|
||||||
|
|
||||||
def populate_family(self) -> None:
|
def populate_family(self) -> None:
|
||||||
"""Set doc, path, ... to family"""
|
"""Set doc, path, ... to family"""
|
||||||
for family in self.get_families():
|
for family in self.get_families():
|
||||||
|
@ -101,10 +67,10 @@ class Annotator(Walk):
|
||||||
if family.type != "dynamic":
|
if family.type != "dynamic":
|
||||||
continue
|
continue
|
||||||
if not isinstance(family.dynamic, list):
|
if not isinstance(family.dynamic, list):
|
||||||
self.add_default_value(family, family.dynamic)
|
self.dynamic_values(family, family.dynamic)
|
||||||
else:
|
else:
|
||||||
for value in family.dynamic:
|
for value in family.dynamic:
|
||||||
self.add_default_value(family, value, inside_list=True)
|
self.dynamic_values(family, value, return_a_list=False)
|
||||||
self.calculation_to_information(
|
self.calculation_to_information(
|
||||||
family.path,
|
family.path,
|
||||||
"dynamic",
|
"dynamic",
|
||||||
|
@ -112,6 +78,43 @@ class Annotator(Walk):
|
||||||
family.version,
|
family.version,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def dynamic_values(
|
||||||
|
self,
|
||||||
|
family,
|
||||||
|
value,
|
||||||
|
*,
|
||||||
|
return_a_list=True,
|
||||||
|
) -> None:
|
||||||
|
"""For dynamic we must have values to document it"""
|
||||||
|
if not isinstance(value, Calculation):
|
||||||
|
return
|
||||||
|
default_values = ["example"]
|
||||||
|
if isinstance(value, (VariableCalculation, VariablePropertyCalculation)):
|
||||||
|
variable = self.objectspace.paths.get_with_dynamic(
|
||||||
|
value.variable,
|
||||||
|
value.path_prefix,
|
||||||
|
family.path,
|
||||||
|
value.version,
|
||||||
|
value.namespace,
|
||||||
|
value.xmlfiles,
|
||||||
|
)[0]
|
||||||
|
if variable:
|
||||||
|
values = self.get_examples_values(variable)
|
||||||
|
if values:
|
||||||
|
default_values = values
|
||||||
|
if not return_a_list:
|
||||||
|
default_values = default_values[0]
|
||||||
|
value.default_values = default_values
|
||||||
|
|
||||||
|
def get_examples_values(self, variable) -> list:
|
||||||
|
"""Check examples or test information to define examples values"""
|
||||||
|
values = self.objectspace.informations.get(variable.path).get("examples", None)
|
||||||
|
if not values:
|
||||||
|
values = self.objectspace.informations.get(variable.path).get("test", None)
|
||||||
|
if isinstance(values, tuple):
|
||||||
|
values = list(values)
|
||||||
|
return values
|
||||||
|
|
||||||
def populate_variable(self) -> None:
|
def populate_variable(self) -> None:
|
||||||
"""convert variables"""
|
"""convert variables"""
|
||||||
for variable in self.get_variables():
|
for variable in self.get_variables():
|
||||||
|
@ -153,7 +156,7 @@ class Annotator(Walk):
|
||||||
variable: dict,
|
variable: dict,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""convert properties"""
|
"""convert properties"""
|
||||||
for prop in ["hidden", "disabled", "mandatory"]:
|
for prop in PROPERTY_ATTRIBUTE:
|
||||||
prop_value = getattr(variable, prop, None)
|
prop_value = getattr(variable, prop, None)
|
||||||
if not prop_value:
|
if not prop_value:
|
||||||
continue
|
continue
|
||||||
|
@ -171,76 +174,161 @@ class Annotator(Walk):
|
||||||
values,
|
values,
|
||||||
version: str,
|
version: str,
|
||||||
):
|
):
|
||||||
|
"""tranform calculation to an information"""
|
||||||
|
if not isinstance(values, list):
|
||||||
|
if not isinstance(values, Calculation):
|
||||||
|
return
|
||||||
self._calculation_to_information(
|
self._calculation_to_information(
|
||||||
path,
|
path,
|
||||||
prop,
|
prop,
|
||||||
values,
|
self._calculation_to_string(path, prop, values, version),
|
||||||
version,
|
|
||||||
)
|
)
|
||||||
if isinstance(values, list):
|
else:
|
||||||
|
datas = []
|
||||||
|
one_is_calculation = False
|
||||||
for idx, val in enumerate(values):
|
for idx, val in enumerate(values):
|
||||||
|
data = self._calculation_to_string(path, prop, val, version)
|
||||||
|
if data is None:
|
||||||
|
continue
|
||||||
|
if "type" in data:
|
||||||
|
one_is_calculation = True
|
||||||
|
datas.append(data)
|
||||||
|
if one_is_calculation:
|
||||||
self._calculation_to_information(
|
self._calculation_to_information(
|
||||||
path,
|
path,
|
||||||
prop,
|
prop,
|
||||||
val,
|
datas,
|
||||||
version,
|
|
||||||
identifier=f"_{idx}",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def _calculation_to_information(
|
def _calculation_to_information(
|
||||||
|
self,
|
||||||
|
path: str,
|
||||||
|
prop: str,
|
||||||
|
datas: Union[dict, list[dict]],
|
||||||
|
) -> None:
|
||||||
|
if datas is None:
|
||||||
|
return
|
||||||
|
self.objectspace.informations.add(
|
||||||
|
path,
|
||||||
|
f"{prop}_calculation",
|
||||||
|
datas,
|
||||||
|
)
|
||||||
|
|
||||||
|
def _calculation_to_string(
|
||||||
self,
|
self,
|
||||||
path: str,
|
path: str,
|
||||||
prop: str,
|
prop: str,
|
||||||
values,
|
values,
|
||||||
version: str,
|
version: str,
|
||||||
*,
|
|
||||||
identifier: str = "",
|
|
||||||
):
|
):
|
||||||
if not isinstance(values, Calculation):
|
if not isinstance(values, Calculation):
|
||||||
return
|
return {"value": values}
|
||||||
values_calculation = True
|
|
||||||
if isinstance(values, JinjaCalculation):
|
if isinstance(values, JinjaCalculation):
|
||||||
if values.description:
|
return {
|
||||||
values_calculation = values.description
|
"type": "jinja",
|
||||||
values_calculation_type = "jinja"
|
"value": self._calculation_to_information_jinja(values),
|
||||||
elif isinstance(values, (VariableCalculation, VariablePropertyCalculation)):
|
}
|
||||||
values_calculation = values.variable
|
if isinstance(values, (VariableCalculation, VariablePropertyCalculation)):
|
||||||
paths = self.objectspace.paths
|
value = self._calculation_to_information_variable(
|
||||||
if version != "1.0" and paths.regexp_relative.search(values_calculation):
|
values, prop, version, path
|
||||||
calculation_path = paths.get_full_path(
|
|
||||||
values_calculation,
|
|
||||||
path,
|
|
||||||
)
|
)
|
||||||
|
if value is None:
|
||||||
|
return
|
||||||
|
return {
|
||||||
|
"type": "variable",
|
||||||
|
"value": value,
|
||||||
|
}
|
||||||
|
if isinstance(values, InformationCalculation):
|
||||||
|
return {
|
||||||
|
"type": "information",
|
||||||
|
"value": self._calculation_to_information_information(
|
||||||
|
values, version, path
|
||||||
|
),
|
||||||
|
}
|
||||||
|
if isinstance(values, (IdentifierCalculation, IdentifierPropertyCalculation)):
|
||||||
|
return {
|
||||||
|
"type": "identifier",
|
||||||
|
"value": self._calculation_to_information_identifier(
|
||||||
|
values, prop, version
|
||||||
|
),
|
||||||
|
}
|
||||||
|
if isinstance(values, IndexCalculation):
|
||||||
|
return {
|
||||||
|
"type": "index",
|
||||||
|
"value": True,
|
||||||
|
}
|
||||||
|
raise Exception('unknown calculation "{values}"')
|
||||||
|
|
||||||
|
def _calculation_to_information_jinja(self, values):
|
||||||
|
if values.description:
|
||||||
|
return values.description
|
||||||
|
return True
|
||||||
|
|
||||||
|
def _calculation_to_information_variable(
|
||||||
|
self, values, prop: str, version: str, path: str
|
||||||
|
) -> str:
|
||||||
|
# is optional
|
||||||
|
if isinstance(values, VariableCalculation) and values.optional:
|
||||||
|
variable = self.objectspace.paths.get_with_dynamic(
|
||||||
|
values.variable,
|
||||||
|
values.path_prefix,
|
||||||
|
path,
|
||||||
|
values.version,
|
||||||
|
values.namespace,
|
||||||
|
values.xmlfiles,
|
||||||
|
)[0]
|
||||||
|
if not variable:
|
||||||
|
return None
|
||||||
|
variable_path = variable.path
|
||||||
|
else:
|
||||||
|
variable_path = self._get_path_from_variable(values, version, path)
|
||||||
if prop in PROPERTY_ATTRIBUTE:
|
if prop in PROPERTY_ATTRIBUTE:
|
||||||
|
# get comparative value
|
||||||
|
if values.when_not is not undefined:
|
||||||
|
value = values.when_not
|
||||||
|
msg = _('when the variable "{0}" hasn\'t the value "{1}"')
|
||||||
|
else:
|
||||||
if values.when is not undefined:
|
if values.when is not undefined:
|
||||||
values_calculation = f'when the variable "{calculation_path}" has the value "{values.when}"'
|
value = values.when
|
||||||
elif values.when_not is not undefined:
|
|
||||||
values_calculation = f'when the variable "{calculation_path}" hasn\'t the value "{values.when_not}"'
|
|
||||||
else:
|
else:
|
||||||
values_calculation = f'when the variable "{calculation_path}" has the value "True"'
|
value = True
|
||||||
|
msg = _('when the variable "{0}" has the value "{1}"')
|
||||||
|
if not isinstance(value, str):
|
||||||
|
value = dump(value)
|
||||||
|
|
||||||
|
# set message
|
||||||
|
values_calculation = msg.format(variable_path, value)
|
||||||
else:
|
else:
|
||||||
values_calculation = calculation_path
|
values_calculation = variable_path
|
||||||
values_calculation_type = "variable"
|
|
||||||
elif isinstance(values, InformationCalculation):
|
return values_calculation
|
||||||
values_calculation_type = "information"
|
|
||||||
elif isinstance(values, (IdentifierCalculation, IdentifierPropertyCalculation)):
|
def _calculation_to_information_information(
|
||||||
|
self, values, version: str, path: str
|
||||||
|
) -> Union[str, bool]:
|
||||||
|
if values.variable:
|
||||||
|
variable_path = self._get_path_from_variable(values, version, path)
|
||||||
|
return _('the value of the information "{0}" of the variable "{1}"').format(
|
||||||
|
values.information, variable_path
|
||||||
|
)
|
||||||
|
return _('the value of the global information "{0}"').format(values.information)
|
||||||
|
|
||||||
|
def _calculation_to_information_identifier(
|
||||||
|
self, values, prop: str, version: str
|
||||||
|
) -> Union[str, bool]:
|
||||||
if version != "1.0" and prop in PROPERTY_ATTRIBUTE:
|
if version != "1.0" and prop in PROPERTY_ATTRIBUTE:
|
||||||
if values.when is not undefined:
|
if values.when is not undefined:
|
||||||
values_calculation = f'when the identifier is "{values.when}"'
|
return _('when the identifier is "{0}"').format(values.when)
|
||||||
elif values.when_not is not undefined:
|
if values.when_not is not undefined:
|
||||||
values_calculation = (
|
return _('when the identifier is not "{0}"').format(values.when_not)
|
||||||
f'when the identifier is not "{values.when_not}"'
|
return True
|
||||||
)
|
|
||||||
values_calculation_type = "identifier"
|
def _get_path_from_variable(self, values, version: str, path: str) -> str:
|
||||||
elif isinstance(values, IndexCalculation):
|
variable_path = values.variable
|
||||||
values_calculation_type = "index"
|
paths = self.objectspace.paths
|
||||||
self.objectspace.informations.add(
|
if version != "1.0" and paths.regexp_relative.search(variable_path):
|
||||||
|
variable_path = paths.get_full_path(
|
||||||
|
variable_path,
|
||||||
path,
|
path,
|
||||||
f"{prop}_calculation_type{identifier}",
|
|
||||||
values_calculation_type,
|
|
||||||
)
|
|
||||||
self.objectspace.informations.add(
|
|
||||||
path,
|
|
||||||
f"{prop}_calculation{identifier}",
|
|
||||||
values_calculation,
|
|
||||||
)
|
)
|
||||||
|
return variable_path
|
||||||
|
|
|
@ -19,26 +19,29 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from rougail.utils import load_modules
|
from rougail.utils import load_modules, _
|
||||||
|
|
||||||
|
|
||||||
OUTPUTS = None
|
OUTPUTS = None
|
||||||
|
|
||||||
|
|
||||||
def get_outputs() -> None:
|
def get_outputs() -> None:
|
||||||
module_name = "rougail.doc.output"
|
"""Load all outputs"""
|
||||||
|
module_name = "rougail.output_doc.output"
|
||||||
outputs = {}
|
outputs = {}
|
||||||
for path in (Path(__file__).parent / "output").iterdir():
|
for path in (Path(__file__).parent / "output").iterdir():
|
||||||
name = path.name
|
name = path.name
|
||||||
if not name.endswith(".py") or name.endswith("__.py"):
|
if not name.endswith(".py") or name.endswith("__.py"):
|
||||||
continue
|
continue
|
||||||
module = load_modules(module_name + "." + name, str(path))
|
module = load_modules(module_name + "." + name[:-3], str(path))
|
||||||
if "Formater" not in dir(module):
|
if "Formater" not in dir(module):
|
||||||
continue
|
continue
|
||||||
level = module.Formater.level
|
level = module.Formater.level
|
||||||
if level in outputs:
|
if level in outputs:
|
||||||
raise Exception(
|
raise ImportError(
|
||||||
f'duplicated level rougail-doc for output "{level}": {module.Formater.name} and {outputs[level].name}'
|
_('duplicated level rougail-doc for output "{0}": {1} and {2}').format(
|
||||||
|
level, module.Formater.name, outputs[level].name
|
||||||
|
)
|
||||||
)
|
)
|
||||||
outputs[module.Formater.level] = module.Formater
|
outputs[module.Formater.level] = module.Formater
|
||||||
return {outputs[level].name: outputs[level] for level in sorted(outputs)}
|
return {outputs[level].name: outputs[level] for level in sorted(outputs)}
|
||||||
|
@ -55,13 +58,15 @@ class OutPuts: # pylint: disable=R0903
|
||||||
OUTPUTS = get_outputs()
|
OUTPUTS = get_outputs()
|
||||||
|
|
||||||
def get(self) -> dict:
|
def get(self) -> dict:
|
||||||
|
"""Get all outputs"""
|
||||||
return OUTPUTS
|
return OUTPUTS
|
||||||
|
|
||||||
|
|
||||||
def get_rougail_config(
|
def get_rougail_config(
|
||||||
*,
|
*,
|
||||||
backward_compatibility=True,
|
backward_compatibility=True, # pylint: disable=unused-argument
|
||||||
) -> dict:
|
) -> dict:
|
||||||
|
"""Get documentation for output_doc modules"""
|
||||||
outputs = list(OutPuts().get())
|
outputs = list(OutPuts().get())
|
||||||
output_format_default = outputs[0]
|
output_format_default = outputs[0]
|
||||||
rougail_options = """
|
rougail_options = """
|
||||||
|
@ -82,6 +87,22 @@ doc:
|
||||||
negative_description: Hide example in documentation
|
negative_description: Hide example in documentation
|
||||||
alternative_name: de
|
alternative_name: de
|
||||||
default: false
|
default: false
|
||||||
|
disabled_modes:
|
||||||
|
description: Disable documentation for variable with those modes
|
||||||
|
multi: true
|
||||||
|
mandatory: false
|
||||||
|
disabled:
|
||||||
|
jinja: |
|
||||||
|
{% if not modes_level %}
|
||||||
|
there is no mode
|
||||||
|
{% endif %}
|
||||||
|
description: disabled when there is no mode available
|
||||||
|
validators:
|
||||||
|
- jinja: |
|
||||||
|
{% if _.disabled_modes not in modes_level %}
|
||||||
|
this mode is not available
|
||||||
|
{% endif %}
|
||||||
|
description: verify if disable modes already exists
|
||||||
output_format:
|
output_format:
|
||||||
description: Generate document in format
|
description: Generate document in format
|
||||||
alternative_name: do
|
alternative_name: do
|
||||||
|
|
570
src/rougail/output_doc/doc.py
Normal file
570
src/rougail/output_doc/doc.py
Normal file
|
@ -0,0 +1,570 @@
|
||||||
|
"""
|
||||||
|
Silique (https://www.silique.fr)
|
||||||
|
Copyright (C) 2024
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||||
|
details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from warnings import warn
|
||||||
|
from typing import Optional
|
||||||
|
from itertools import chain
|
||||||
|
|
||||||
|
from tiramisu import Calculation, undefined, groups
|
||||||
|
from tiramisu.error import ConfigError
|
||||||
|
from rougail.error import display_xmlfiles
|
||||||
|
from rougail.object_model import PROPERTY_ATTRIBUTE
|
||||||
|
|
||||||
|
from .config import OutPuts
|
||||||
|
from .i18n import _
|
||||||
|
from .utils import to_phrase, DocTypes
|
||||||
|
from .example import Examples
|
||||||
|
|
||||||
|
|
||||||
|
class RougailOutputDoc(Examples):
|
||||||
|
"""Rougail Output Doc:
|
||||||
|
Generate documentation from rougail description files
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
*,
|
||||||
|
config: "Config" = None,
|
||||||
|
rougailconfig: "RougailConfig" = None,
|
||||||
|
**kwarg,
|
||||||
|
):
|
||||||
|
# Import here to avoid circular import
|
||||||
|
from rougail import Rougail, CONVERT_OPTION
|
||||||
|
|
||||||
|
self.convert_option = CONVERT_OPTION
|
||||||
|
if rougailconfig is None:
|
||||||
|
from rougail import RougailConfig
|
||||||
|
|
||||||
|
rougailconfig = RougailConfig
|
||||||
|
if rougailconfig["step.output"] != "doc":
|
||||||
|
rougailconfig["step.output"] = "doc"
|
||||||
|
if rougailconfig["step.output"] != "doc":
|
||||||
|
raise Exception("doc is not set as step.output")
|
||||||
|
outputs = OutPuts().get()
|
||||||
|
output = rougailconfig["doc.output_format"]
|
||||||
|
if output not in outputs:
|
||||||
|
raise Exception(
|
||||||
|
f'cannot find output "{output}", available outputs: {list(outputs)}'
|
||||||
|
)
|
||||||
|
if config is None:
|
||||||
|
rougail = Rougail(rougailconfig)
|
||||||
|
rougail.converted.plugins.append("output_doc")
|
||||||
|
config = rougail.run()
|
||||||
|
self.conf = config
|
||||||
|
self.modes_level = rougailconfig["modes_level"]
|
||||||
|
if self.modes_level:
|
||||||
|
self.disabled_modes = rougailconfig["doc.disabled_modes"]
|
||||||
|
if self.disabled_modes:
|
||||||
|
self.conf.property.setdefault(frozenset(self.disabled_modes), "read_write", "append")
|
||||||
|
else:
|
||||||
|
self.disabled_modes = []
|
||||||
|
self.conf.property.read_write()
|
||||||
|
# self.conf.property.remove("cache")
|
||||||
|
self.formater = outputs[output]()
|
||||||
|
self.level = rougailconfig["doc.title_level"]
|
||||||
|
self.dynamic_paths = {}
|
||||||
|
self.with_example = rougailconfig["doc.with_example"]
|
||||||
|
self.informations = None
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
self.support_namespace = True
|
||||||
|
except AttributeError:
|
||||||
|
self.support_namespace = False
|
||||||
|
self.property_to_string = [
|
||||||
|
("mandatory", _("mandatory")),
|
||||||
|
("hidden", _("hidden")),
|
||||||
|
("disabled", _("disabled")),
|
||||||
|
("unique", _("unique")),
|
||||||
|
("force_store_value", _("auto modified")),
|
||||||
|
]
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
"""Print documentation in stdout"""
|
||||||
|
print(self.gen_doc())
|
||||||
|
|
||||||
|
def gen_doc(self):
|
||||||
|
"""Return documentation"""
|
||||||
|
self._tiramisu_to_internal_object()
|
||||||
|
return_string = self.formater.run(self.informations, self.level)
|
||||||
|
if self.with_example:
|
||||||
|
return_string += self.gen_doc_examples()
|
||||||
|
return return_string
|
||||||
|
|
||||||
|
def _tiramisu_to_internal_object(self):
|
||||||
|
config = self.conf.unrestraint
|
||||||
|
self._populate_dynamics(config)
|
||||||
|
informations = self._parse_families(config)
|
||||||
|
if informations is None:
|
||||||
|
informations = {}
|
||||||
|
self.informations = informations
|
||||||
|
|
||||||
|
def _populate_dynamics(self, family) -> None:
|
||||||
|
for child in family.list():
|
||||||
|
path = child.path(uncalculated=True)
|
||||||
|
if not child.isoptiondescription():
|
||||||
|
func = self._populate_dynamic_variable
|
||||||
|
else:
|
||||||
|
func = self._populate_dynamic_family
|
||||||
|
func(child, path)
|
||||||
|
|
||||||
|
def _populate_dynamic_variable(self, variable, path) -> None:
|
||||||
|
if not variable.isdynamic():
|
||||||
|
return
|
||||||
|
if path not in self.dynamic_paths:
|
||||||
|
self.dynamic_paths[path] = {"paths": [], "names": []}
|
||||||
|
self.dynamic_paths[path]["paths"].append(
|
||||||
|
self._dyn_path_to_italic(variable, path)
|
||||||
|
)
|
||||||
|
self.dynamic_paths[path]["names"].append(variable.name())
|
||||||
|
|
||||||
|
def _populate_dynamic_family(self, family, path) -> None:
|
||||||
|
if family.isdynamic():
|
||||||
|
if path not in self.dynamic_paths:
|
||||||
|
self.dynamic_paths[path] = {"paths": [], "names": []}
|
||||||
|
self.dynamic_paths[path]["paths"].append(
|
||||||
|
self._dyn_path_to_italic(family, path)
|
||||||
|
)
|
||||||
|
self.dynamic_paths[path]["names"].append(family.name())
|
||||||
|
self._populate_dynamics(family)
|
||||||
|
|
||||||
|
def _parse_families(self, family) -> dict:
|
||||||
|
informations = {}
|
||||||
|
leader = None
|
||||||
|
for child in family.list():
|
||||||
|
if self._is_inaccessible_user_data(child):
|
||||||
|
continue
|
||||||
|
name = child.name(uncalculated=True)
|
||||||
|
path = child.path(uncalculated=True)
|
||||||
|
if not child.isoptiondescription():
|
||||||
|
leader = self._parse_variable(child, leader, name, path, informations)
|
||||||
|
else:
|
||||||
|
self._parse_family(child, informations, name, path)
|
||||||
|
return informations
|
||||||
|
|
||||||
|
def _is_inaccessible_user_data(self, child):
|
||||||
|
"""If family is not accessible in read_write mode (to load user_data),
|
||||||
|
do not comment this family
|
||||||
|
"""
|
||||||
|
properties = child.property.get(uncalculated=True)
|
||||||
|
for hidden_property in chain(["hidden", "disabled"], self.disabled_modes):
|
||||||
|
if hidden_property in properties:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def _parse_family(self, family, informations: dict, name: str, path: str) -> None:
|
||||||
|
sub_informations = self._parse_families(family)
|
||||||
|
if not sub_informations:
|
||||||
|
return
|
||||||
|
informations[name] = {
|
||||||
|
"type": self._get_family_type(family),
|
||||||
|
"informations": self._populate_family(
|
||||||
|
family,
|
||||||
|
path,
|
||||||
|
),
|
||||||
|
"children": sub_informations,
|
||||||
|
}
|
||||||
|
|
||||||
|
def _parse_variable(
|
||||||
|
self, variable, leader: dict, name: str, path: str, informations: dict
|
||||||
|
) -> Optional[dict]:
|
||||||
|
if variable.isdynamic():
|
||||||
|
# information is already set
|
||||||
|
potential_leader = self._parse_variable_dynamic(
|
||||||
|
variable, leader, name, path, informations
|
||||||
|
)
|
||||||
|
elif variable.isfollower() and variable.index():
|
||||||
|
potential_leader = self._parse_variable_follower_with_index(
|
||||||
|
variable, name, informations
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
potential_leader = self._parse_variable_normal(
|
||||||
|
variable, leader, name, path, informations
|
||||||
|
)
|
||||||
|
if potential_leader:
|
||||||
|
leader = potential_leader
|
||||||
|
return leader
|
||||||
|
|
||||||
|
def _parse_variable_normal(
|
||||||
|
self, variable, leader, name: str, path: str, informations: dict
|
||||||
|
) -> Optional[dict]:
|
||||||
|
if variable.isdynamic():
|
||||||
|
sub_informations = self.dynamic_paths[path]
|
||||||
|
else:
|
||||||
|
sub_informations = {}
|
||||||
|
self._populate_variable(
|
||||||
|
variable,
|
||||||
|
sub_informations,
|
||||||
|
)
|
||||||
|
if self.with_example:
|
||||||
|
self._add_examples(variable, sub_informations, leader)
|
||||||
|
informations[name] = sub_informations
|
||||||
|
if variable.isleader():
|
||||||
|
return sub_informations
|
||||||
|
return None
|
||||||
|
|
||||||
|
def _parse_variable_follower_with_index(
|
||||||
|
self, variable, name: str, informations: dict
|
||||||
|
) -> None:
|
||||||
|
if not self.with_example:
|
||||||
|
return None
|
||||||
|
informations[name]["example"][-1][variable.index()] = self._get_example(
|
||||||
|
variable, informations[name], None
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
|
||||||
|
def _parse_variable_dynamic(
|
||||||
|
self, variable, leader, name, path, informations
|
||||||
|
) -> None:
|
||||||
|
dynamic_variable = self.dynamic_paths[path]
|
||||||
|
if "type" in dynamic_variable:
|
||||||
|
if self.with_example:
|
||||||
|
dynamic_variable["example"].append(
|
||||||
|
self._get_example(variable, dynamic_variable, leader)
|
||||||
|
)
|
||||||
|
description = to_phrase(variable.description(uncalculated=True))
|
||||||
|
if "{{ identifier }}" in description:
|
||||||
|
description = self._convert_description(description, variable)
|
||||||
|
dynamic_variable["descriptions"].append(to_phrase(description))
|
||||||
|
if variable.isleader():
|
||||||
|
return dynamic_variable
|
||||||
|
return None
|
||||||
|
return self._parse_variable_normal(variable, leader, name, path, informations)
|
||||||
|
|
||||||
|
def _get_family_type(self, family) -> str:
|
||||||
|
if self.support_namespace and family.group_type() is groups.namespace:
|
||||||
|
return "namespace"
|
||||||
|
if family.isleadership():
|
||||||
|
return "leadership"
|
||||||
|
if family.isdynamic(only_self=True):
|
||||||
|
return "dynamic"
|
||||||
|
return "family"
|
||||||
|
|
||||||
|
def _dyn_path_to_italic(self, child, path: str) -> str:
|
||||||
|
for identifier in child.identifiers():
|
||||||
|
path = path.replace("{{ identifier }}", self.formater.italic(identifier), 1)
|
||||||
|
return path
|
||||||
|
|
||||||
|
def _populate_family(
|
||||||
|
self,
|
||||||
|
family,
|
||||||
|
path: str,
|
||||||
|
) -> dict:
|
||||||
|
if family.isdynamic():
|
||||||
|
informations = self.dynamic_paths[path]
|
||||||
|
else:
|
||||||
|
informations = {}
|
||||||
|
self._populate(family, informations)
|
||||||
|
if family.isleadership():
|
||||||
|
informations.setdefault("help", []).append(
|
||||||
|
_("This family contains lists of variable blocks.")
|
||||||
|
)
|
||||||
|
if family.isdynamic(only_self=True):
|
||||||
|
identifiers = self._to_string(family, "dynamic", do_not_raise=True)
|
||||||
|
if identifiers is None:
|
||||||
|
identifiers = family.identifiers(only_self=True)
|
||||||
|
informations["identifiers"] = identifiers
|
||||||
|
informations.setdefault("help", []).append(
|
||||||
|
_("This family builds families dynamically.")
|
||||||
|
)
|
||||||
|
return informations
|
||||||
|
|
||||||
|
def _populate_variable(
|
||||||
|
self,
|
||||||
|
variable,
|
||||||
|
informations: dict,
|
||||||
|
):
|
||||||
|
informations["type"] = "variable"
|
||||||
|
default = self._get_default(
|
||||||
|
variable,
|
||||||
|
)
|
||||||
|
if default is not None:
|
||||||
|
informations["default"] = default
|
||||||
|
self._parse_type(
|
||||||
|
variable,
|
||||||
|
informations,
|
||||||
|
)
|
||||||
|
self._populate(variable, informations)
|
||||||
|
if "description" in informations:
|
||||||
|
informations["descriptions"] = [to_phrase(informations.pop("description"))]
|
||||||
|
if variable.ismulti():
|
||||||
|
multi = not variable.isfollower() or variable.issubmulti()
|
||||||
|
else:
|
||||||
|
multi = False
|
||||||
|
if multi:
|
||||||
|
informations["properties"].append(
|
||||||
|
{
|
||||||
|
"type": "multiple",
|
||||||
|
"name": _("multiple"),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
informations["multiple"] = True
|
||||||
|
examples = variable.information.get("examples", None)
|
||||||
|
if examples is None:
|
||||||
|
examples = variable.information.get("test", None)
|
||||||
|
if examples is not None:
|
||||||
|
informations["examples"] = list(examples)
|
||||||
|
|
||||||
|
def _populate(
|
||||||
|
self,
|
||||||
|
obj,
|
||||||
|
informations: dict,
|
||||||
|
):
|
||||||
|
if not obj.isdynamic():
|
||||||
|
informations["paths"] = [obj.path(uncalculated=True)]
|
||||||
|
informations["names"] = [obj.name()]
|
||||||
|
description = obj.description(uncalculated=True)
|
||||||
|
if obj.name(uncalculated=True) == description and (
|
||||||
|
not obj.isoptiondescription() or obj.group_type() is not groups.namespace
|
||||||
|
):
|
||||||
|
warning = _('No attribute "description" for "{0}" in {1}').format(
|
||||||
|
informations["paths"][0],
|
||||||
|
display_xmlfiles(obj.information.get("dictionaries")),
|
||||||
|
)
|
||||||
|
warn(warning)
|
||||||
|
else:
|
||||||
|
informations["description"] = self._convert_description(description, obj)
|
||||||
|
help_ = obj.information.get("help", None)
|
||||||
|
if help_:
|
||||||
|
informations["help"] = [to_phrase(help_)]
|
||||||
|
self._parse_properties(
|
||||||
|
obj,
|
||||||
|
informations,
|
||||||
|
)
|
||||||
|
|
||||||
|
def _convert_description(self, description, obj):
|
||||||
|
if "{{ identifier }}" in description:
|
||||||
|
return description.replace(
|
||||||
|
"{{ identifier }}", self.formater.italic(obj.identifiers()[-1])
|
||||||
|
)
|
||||||
|
return description
|
||||||
|
|
||||||
|
def _add_examples(self, variable, informations: dict, leader) -> None:
|
||||||
|
example = self._get_example(variable, informations, leader)
|
||||||
|
informations["example"] = [example]
|
||||||
|
informations["mandatory_without_value"] = "mandatory" in variable.property.get(
|
||||||
|
uncalculated=True
|
||||||
|
) and variable.value.get(uncalculated=True) in [None, []]
|
||||||
|
|
||||||
|
def _get_example(self, variable, informations: dict, leader):
|
||||||
|
example = informations.get("examples")
|
||||||
|
if example is not None:
|
||||||
|
if isinstance(example, tuple):
|
||||||
|
example = list(example)
|
||||||
|
if not informations.get("multiple"):
|
||||||
|
example = example[0]
|
||||||
|
else:
|
||||||
|
if variable.information.get("fake_default", False):
|
||||||
|
default = None
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
default = variable.value.get()
|
||||||
|
except ConfigError:
|
||||||
|
default = None
|
||||||
|
if default not in [None, []]:
|
||||||
|
example = default
|
||||||
|
else:
|
||||||
|
example = self.convert_option.get(
|
||||||
|
variable.information.get("type"), {}
|
||||||
|
).get("example", None)
|
||||||
|
if example is None:
|
||||||
|
example = "xxx"
|
||||||
|
if informations.get("multiple"):
|
||||||
|
example = [example]
|
||||||
|
if leader is not None and variable.isfollower():
|
||||||
|
example = [example] + [undefined] * (len(leader["example"][-1]) - 1)
|
||||||
|
return example
|
||||||
|
|
||||||
|
def _parse_type(
|
||||||
|
self,
|
||||||
|
variable,
|
||||||
|
informations,
|
||||||
|
):
|
||||||
|
variable_type = variable.information.get("type")
|
||||||
|
doc_type = DocTypes.get(variable_type, {"params": {}})
|
||||||
|
informations["properties"] = [
|
||||||
|
{
|
||||||
|
"type": "type",
|
||||||
|
"name": doc_type.get("msg", variable_type),
|
||||||
|
}
|
||||||
|
]
|
||||||
|
# extra parameters for types
|
||||||
|
option = variable.get()
|
||||||
|
for param, msg in doc_type["params"].items():
|
||||||
|
value = option.impl_get_extra(f"_{param}")
|
||||||
|
if value is None:
|
||||||
|
value = option.impl_get_extra(param)
|
||||||
|
if value is not None and value is not False:
|
||||||
|
informations.setdefault("validators", []).append(msg.format(value))
|
||||||
|
# get validation information from annotator
|
||||||
|
for name in variable.information.list():
|
||||||
|
if not name.startswith("validators_calculation"):
|
||||||
|
continue
|
||||||
|
informations.setdefault("validators", []).extend(
|
||||||
|
self._to_string(
|
||||||
|
variable,
|
||||||
|
"validators",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
break
|
||||||
|
if variable.information.get("type") == "choice":
|
||||||
|
choices = self._to_string(variable, "choice", do_not_raise=True)
|
||||||
|
if choices is None:
|
||||||
|
choices = variable.value.list()
|
||||||
|
for idx, val in enumerate(choices):
|
||||||
|
if not isinstance(val, Calculation):
|
||||||
|
default = informations.get("default")
|
||||||
|
if default is not None and val == default:
|
||||||
|
choices[idx] = str(val) + " ← " + _("(default)")
|
||||||
|
informations["display_default"] = False
|
||||||
|
continue
|
||||||
|
choices[idx] = self._to_string(variable, "choice", f"_{idx}")
|
||||||
|
informations["choices"] = choices
|
||||||
|
if variable.information.get("type") == "regexp":
|
||||||
|
informations.setdefault("validators", []).append(
|
||||||
|
_('text based with regular expressions "{0}"').format(
|
||||||
|
variable.pattern()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
def _parse_properties(
|
||||||
|
self,
|
||||||
|
variable,
|
||||||
|
informations,
|
||||||
|
):
|
||||||
|
properties = variable.property.get(uncalculated=True)
|
||||||
|
for mode in self.modes_level:
|
||||||
|
if mode not in properties:
|
||||||
|
continue
|
||||||
|
informations.setdefault("properties", []).append(
|
||||||
|
{
|
||||||
|
"type": "mode",
|
||||||
|
"name": mode,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
break
|
||||||
|
for prop, msg in self.property_to_string:
|
||||||
|
if prop in properties:
|
||||||
|
prop_obj = {
|
||||||
|
"type": "property",
|
||||||
|
"name": msg,
|
||||||
|
}
|
||||||
|
elif variable.information.get(f"{prop}_calculation", False):
|
||||||
|
prop_obj = {
|
||||||
|
"type": "property",
|
||||||
|
"name": msg,
|
||||||
|
"annotation": self._to_string(variable, prop),
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
informations.setdefault("properties", []).append(prop_obj)
|
||||||
|
|
||||||
|
def _get_default(
|
||||||
|
self,
|
||||||
|
variable,
|
||||||
|
):
|
||||||
|
default = self._to_string(variable, "default", do_not_raise=True)
|
||||||
|
if default is not None:
|
||||||
|
return default
|
||||||
|
if not variable.information.get("fake_default", False):
|
||||||
|
default = variable.value.get(uncalculated=True)
|
||||||
|
if default == []:
|
||||||
|
default = None
|
||||||
|
return default
|
||||||
|
|
||||||
|
def _to_string(
|
||||||
|
self,
|
||||||
|
variable,
|
||||||
|
prop,
|
||||||
|
identifier="",
|
||||||
|
do_not_raise=False,
|
||||||
|
):
|
||||||
|
if identifier:
|
||||||
|
raise Exception("pfff")
|
||||||
|
calculation = variable.information.get(f"{prop}_calculation", None)
|
||||||
|
if not calculation:
|
||||||
|
if do_not_raise:
|
||||||
|
return None
|
||||||
|
raise Exception(
|
||||||
|
f'cannot find "{prop}_calculation" information, '
|
||||||
|
"do you have declare doc has a plugins?"
|
||||||
|
)
|
||||||
|
# if do_not_raise and calculation.get('optional', False):
|
||||||
|
# return None
|
||||||
|
if isinstance(calculation, list):
|
||||||
|
values = []
|
||||||
|
for cal in calculation:
|
||||||
|
value = self._calculation_to_string(variable, cal, prop)
|
||||||
|
if value is not None:
|
||||||
|
values.append(value)
|
||||||
|
return values
|
||||||
|
return self._calculation_to_string(variable, calculation, prop)
|
||||||
|
|
||||||
|
def _calculation_to_string(self, variable, calculation, prop):
|
||||||
|
if "type" not in calculation:
|
||||||
|
return calculation["value"]
|
||||||
|
if calculation["type"] == "jinja":
|
||||||
|
if calculation["value"] is not True:
|
||||||
|
values = calculation["value"]
|
||||||
|
else:
|
||||||
|
values = _("depends on a calculation")
|
||||||
|
warning = _(
|
||||||
|
'"{0}" is a calculation for {1} but has no description in {2}'
|
||||||
|
).format(
|
||||||
|
prop,
|
||||||
|
variable.path(),
|
||||||
|
display_xmlfiles(variable.information.get("dictionaries")),
|
||||||
|
)
|
||||||
|
warn(warning)
|
||||||
|
elif calculation["type"] == "variable":
|
||||||
|
if prop in PROPERTY_ATTRIBUTE:
|
||||||
|
values = calculation["value"]
|
||||||
|
else:
|
||||||
|
if calculation.get("optional", False):
|
||||||
|
# FIXME pas forcement dans self.dynamic_paths encore ...
|
||||||
|
path = calculation["value"]
|
||||||
|
if "{{ identifier }}" in path:
|
||||||
|
# FIXME pas forcement dans self.dynamic_paths encore ...
|
||||||
|
if path not in self.dynamic_paths:
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
self.conf.option(path).get()
|
||||||
|
except AttributeError:
|
||||||
|
return None
|
||||||
|
msg = _('the value of the variable "{0}"')
|
||||||
|
if "{{ identifier }}" in calculation["value"]:
|
||||||
|
# FIXME pas forcement dans self.dynamic_paths encore ...
|
||||||
|
values = [
|
||||||
|
msg.format(path)
|
||||||
|
for path in self.dynamic_paths[calculation["value"]]["paths"]
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
values = msg.format(calculation["value"])
|
||||||
|
elif calculation["type"] == "identifier":
|
||||||
|
if prop in PROPERTY_ATTRIBUTE:
|
||||||
|
values = calculation["value"]
|
||||||
|
else:
|
||||||
|
values = _("the value of the identifier")
|
||||||
|
elif calculation["type"] == "information":
|
||||||
|
values = calculation["value"]
|
||||||
|
else:
|
||||||
|
values = _("the value of the {0}").format(calculation["type"])
|
||||||
|
if isinstance(values, str) and not values.endswith("."):
|
||||||
|
values += "."
|
||||||
|
return values
|
138
src/rougail/output_doc/example.py
Normal file
138
src/rougail/output_doc/example.py
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
"""
|
||||||
|
Silique (https://www.silique.fr)
|
||||||
|
Copyright (C) 2024
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||||
|
details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
from .utils import _
|
||||||
|
|
||||||
|
|
||||||
|
class Examples: # pylint: disable=no-member,too-few-public-methods
|
||||||
|
"""Build examples"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.examples = None
|
||||||
|
self.examples_mandatories = None
|
||||||
|
|
||||||
|
def gen_doc_examples(self):
|
||||||
|
"""Return examples"""
|
||||||
|
if not self.informations:
|
||||||
|
self._tiramisu_to_internal_object()
|
||||||
|
self._build_examples()
|
||||||
|
return_string = ""
|
||||||
|
if self.examples_mandatories:
|
||||||
|
return_string += self.formater.title(
|
||||||
|
_("Example with mandatory variables not filled in"), self.level
|
||||||
|
)
|
||||||
|
return_string += self.formater.yaml(self.examples_mandatories)
|
||||||
|
if self.examples:
|
||||||
|
return_string += self.formater.title(
|
||||||
|
_("Example with all variables modifiable"), self.level
|
||||||
|
)
|
||||||
|
return_string += self.formater.yaml(self.examples)
|
||||||
|
return return_string
|
||||||
|
|
||||||
|
def _build_examples(self):
|
||||||
|
self.examples, self.examples_mandatories = self._parse_examples(
|
||||||
|
self.informations
|
||||||
|
)
|
||||||
|
|
||||||
|
def _parse_examples(self, dico, dyn_parent: Optional[str] = None) -> tuple:
|
||||||
|
examples = {}
|
||||||
|
examples_mandatories = {}
|
||||||
|
for value in dico.values():
|
||||||
|
if value["type"] == "variable":
|
||||||
|
self._parse_examples_variable(
|
||||||
|
value, dyn_parent, examples, examples_mandatories
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self._parse_examples_family(
|
||||||
|
value, dyn_parent, examples, examples_mandatories
|
||||||
|
)
|
||||||
|
return examples, examples_mandatories
|
||||||
|
|
||||||
|
def _parse_examples_variable(
|
||||||
|
self,
|
||||||
|
variable,
|
||||||
|
dyn_parent: Optional[str],
|
||||||
|
examples: dict,
|
||||||
|
examples_mandatories: dict,
|
||||||
|
) -> None:
|
||||||
|
for idx, path in enumerate(variable["paths"]):
|
||||||
|
if dyn_parent is not None and not path.startswith(dyn_parent):
|
||||||
|
continue
|
||||||
|
name = variable["names"][idx]
|
||||||
|
value = variable["example"][idx]
|
||||||
|
examples[name] = value
|
||||||
|
if variable["mandatory_without_value"]:
|
||||||
|
examples_mandatories[name] = value
|
||||||
|
break
|
||||||
|
|
||||||
|
def _parse_examples_family(
|
||||||
|
self,
|
||||||
|
family,
|
||||||
|
dyn_parent: Optional[str],
|
||||||
|
examples: dict,
|
||||||
|
examples_mandatories: dict,
|
||||||
|
) -> None:
|
||||||
|
for idx, path in enumerate(family["informations"]["paths"]):
|
||||||
|
if dyn_parent is not None and not path.startswith(dyn_parent):
|
||||||
|
continue
|
||||||
|
name = family["informations"]["names"][idx]
|
||||||
|
if family["type"] == "leadership":
|
||||||
|
func = self._parse_examples_leadership
|
||||||
|
else:
|
||||||
|
func = self._parse_examples
|
||||||
|
ret_e, ret_m = func(
|
||||||
|
family["children"],
|
||||||
|
path + "." if family["type"] == "dynamic" else dyn_parent,
|
||||||
|
)
|
||||||
|
if ret_m:
|
||||||
|
examples_mandatories[name] = ret_m
|
||||||
|
if ret_e:
|
||||||
|
examples[name] = ret_e
|
||||||
|
|
||||||
|
def _parse_examples_leadership(
|
||||||
|
self, leadership, dyn_parent: Optional[str] = None
|
||||||
|
) -> tuple:
|
||||||
|
examples = []
|
||||||
|
examples_mandatories = []
|
||||||
|
leader = next(iter(leadership.values()))
|
||||||
|
for path_idx, path in enumerate(leader["paths"]):
|
||||||
|
if dyn_parent is not None and not path.startswith(dyn_parent):
|
||||||
|
continue
|
||||||
|
for leader_idx in range(len(leader["example"][path_idx])):
|
||||||
|
examples.append(
|
||||||
|
{
|
||||||
|
follower["names"][path_idx]: follower["example"][path_idx][
|
||||||
|
leader_idx
|
||||||
|
]
|
||||||
|
for follower in leadership.values()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
if leader["mandatory_without_value"]:
|
||||||
|
examples_mandatories.append(
|
||||||
|
{
|
||||||
|
follower["names"][path_idx]: follower["example"][path_idx][
|
||||||
|
leader_idx
|
||||||
|
]
|
||||||
|
for follower in leadership.values()
|
||||||
|
if follower["mandatory_without_value"]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
break
|
||||||
|
return examples, examples_mandatories
|
|
@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
from gettext import translation
|
from gettext import translation
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
t = translation("rougail_output_doc", str(Path(__file__).parent / "locale"), fallback=True)
|
t = translation(
|
||||||
|
"rougail_output_doc", str(Path(__file__).parent / "locale"), fallback=True
|
||||||
|
)
|
||||||
|
|
||||||
_ = t.gettext
|
_ = t.gettext
|
||||||
|
|
Binary file not shown.
|
@ -16,21 +16,19 @@ You should have received a copy of the GNU Lesser General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from io import BytesIO
|
|
||||||
from typing import List
|
from typing import List
|
||||||
from itertools import chain
|
from ..utils import CommonFormater, dump
|
||||||
from ruamel.yaml import YAML
|
|
||||||
|
|
||||||
|
|
||||||
class Formater:
|
class Formater(CommonFormater):
|
||||||
|
"""The asciidoc formater"""
|
||||||
|
|
||||||
name = "asciidoc"
|
name = "asciidoc"
|
||||||
|
_table_name = "asciidoc"
|
||||||
level = 40
|
level = 40
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self._yaml = YAML()
|
|
||||||
self._yaml.indent(mapping=2, sequence=4, offset=2)
|
|
||||||
|
|
||||||
def header(self):
|
def header(self):
|
||||||
|
"""Header of the documentation"""
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def title(
|
def title(
|
||||||
|
@ -38,64 +36,20 @@ class Formater:
|
||||||
title: str,
|
title: str,
|
||||||
level: int,
|
level: int,
|
||||||
) -> str:
|
) -> str:
|
||||||
|
"""Display family name as a title"""
|
||||||
char = "="
|
char = "="
|
||||||
return f"{char * (level + 1)} {title}\n\n"
|
return f"{char * (level + 1)} {title}\n\n"
|
||||||
|
|
||||||
def yaml(self, dump: dict) -> str:
|
|
||||||
return f"[,yaml]\n----\n{self.dump(dump)}\n----\n"
|
|
||||||
|
|
||||||
def table(self, table: str) -> str:
|
|
||||||
# add 'a' option in cols to display list
|
|
||||||
stable = table.split("\n", 1)
|
|
||||||
return stable[0].replace("<", "a") + "\n" + stable[1]
|
|
||||||
|
|
||||||
def link(
|
|
||||||
self,
|
|
||||||
comment: str,
|
|
||||||
link: str,
|
|
||||||
) -> str:
|
|
||||||
return f"`{link}[{comment}]`"
|
|
||||||
|
|
||||||
def prop(
|
|
||||||
self,
|
|
||||||
prop: str,
|
|
||||||
) -> str:
|
|
||||||
return f"`{prop}`"
|
|
||||||
|
|
||||||
def list(
|
|
||||||
self,
|
|
||||||
choices: list,
|
|
||||||
) -> str:
|
|
||||||
prefix = "\n\n* "
|
|
||||||
char = "\n* "
|
|
||||||
return prefix + char.join([self.dump(choice) for choice in choices])
|
|
||||||
|
|
||||||
def is_list(
|
|
||||||
self,
|
|
||||||
txt: str,
|
|
||||||
) -> str:
|
|
||||||
return txt.startswith("* ")
|
|
||||||
|
|
||||||
def columns(
|
|
||||||
self,
|
|
||||||
col1: List[str],
|
|
||||||
col2: List[str],
|
|
||||||
) -> None:
|
|
||||||
self.max_line = 0
|
|
||||||
for params in chain(col1, col2):
|
|
||||||
for param in params.split("\n"):
|
|
||||||
self.max_line = max(self.max_line, len(param))
|
|
||||||
self.max_line += 1
|
|
||||||
|
|
||||||
def join(
|
def join(
|
||||||
self,
|
self,
|
||||||
lst: List[str],
|
lst: List[str],
|
||||||
) -> str:
|
) -> str:
|
||||||
|
"""Display line in table from a list"""
|
||||||
string = ""
|
string = ""
|
||||||
previous = ""
|
previous = ""
|
||||||
for line in lst:
|
for line in lst:
|
||||||
if string:
|
if string:
|
||||||
if self.is_list(previous.split("\n")[-1]):
|
if self.is_list(previous.split("\n", 1)[-1]):
|
||||||
string += "\n\n"
|
string += "\n\n"
|
||||||
else:
|
else:
|
||||||
string += " +\n"
|
string += " +\n"
|
||||||
|
@ -104,36 +58,69 @@ class Formater:
|
||||||
previous = line
|
previous = line
|
||||||
return "\n" + string
|
return "\n" + string
|
||||||
|
|
||||||
def to_string(
|
|
||||||
self,
|
|
||||||
text: str,
|
|
||||||
) -> str:
|
|
||||||
return text
|
|
||||||
|
|
||||||
def table_header(
|
|
||||||
self,
|
|
||||||
lst,
|
|
||||||
):
|
|
||||||
return lst[0] + " " * (self.max_line - len(lst[0])), lst[1] + " " * (
|
|
||||||
self.max_line - len(lst[1])
|
|
||||||
)
|
|
||||||
|
|
||||||
def bold(
|
def bold(
|
||||||
self,
|
self,
|
||||||
msg: str,
|
msg: str,
|
||||||
) -> str:
|
) -> str:
|
||||||
|
"""Set a text to bold"""
|
||||||
return f"**{msg}**"
|
return f"**{msg}**"
|
||||||
|
|
||||||
def italic(
|
def italic(
|
||||||
self,
|
self,
|
||||||
msg: str,
|
msg: str,
|
||||||
) -> str:
|
) -> str:
|
||||||
return f"_{msg}_"
|
"""Set a text to italic"""
|
||||||
|
return f"__{msg}__"
|
||||||
|
|
||||||
def dump(self, dico):
|
def stripped(
|
||||||
with BytesIO() as ymlfh:
|
self,
|
||||||
self._yaml.dump(dico, ymlfh)
|
text: str,
|
||||||
ret = ymlfh.getvalue().decode("utf-8").strip()
|
) -> str:
|
||||||
if ret.endswith("..."):
|
"""Return stripped text (as help)"""
|
||||||
ret = ret[:-3].strip()
|
return text.strip()
|
||||||
return ret
|
|
||||||
|
def list(
|
||||||
|
self,
|
||||||
|
choices: list,
|
||||||
|
) -> str:
|
||||||
|
"""Display a liste of element"""
|
||||||
|
prefix = "\n\n* "
|
||||||
|
char = "\n* "
|
||||||
|
return prefix + char.join([dump(choice) for choice in choices])
|
||||||
|
|
||||||
|
def prop(
|
||||||
|
self,
|
||||||
|
prop: str,
|
||||||
|
italic: bool,
|
||||||
|
) -> str:
|
||||||
|
"""Display property"""
|
||||||
|
if italic:
|
||||||
|
prop = self.italic(prop)
|
||||||
|
return f"`{prop}`"
|
||||||
|
|
||||||
|
def yaml(self, _dump: dict) -> str:
|
||||||
|
"""Dump yaml part of documentation"""
|
||||||
|
return f"[,yaml]\n----\n---\n{dump(_dump)}\n----\n"
|
||||||
|
|
||||||
|
def table(self, datas) -> str:
|
||||||
|
"""Transform list to a table in string format
|
||||||
|
we change the first line because we want that col has the same width
|
||||||
|
"""
|
||||||
|
table = super().table(datas)
|
||||||
|
stable = table.split("\n", 1)
|
||||||
|
return '[cols="1a,1a"]\n' + stable[1]
|
||||||
|
|
||||||
|
def link(
|
||||||
|
self,
|
||||||
|
comment: str,
|
||||||
|
link: str,
|
||||||
|
) -> str:
|
||||||
|
"""Add a link"""
|
||||||
|
return f"`{link}[{comment}]`"
|
||||||
|
|
||||||
|
def is_list(
|
||||||
|
self,
|
||||||
|
txt: str,
|
||||||
|
) -> str:
|
||||||
|
"""verify if a text is a list"""
|
||||||
|
return txt.strip().startswith("* ")
|
||||||
|
|
60
src/rougail/output_doc/output/console.py
Normal file
60
src/rougail/output_doc/output/console.py
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
"""
|
||||||
|
Silique (https://www.silique.fr)
|
||||||
|
Copyright (C) 2024
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||||
|
details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from .github import Formater as GFormater
|
||||||
|
|
||||||
|
|
||||||
|
# from rich.text import Text
|
||||||
|
# from rich.table import Table, Column
|
||||||
|
# from rich.console import Console
|
||||||
|
#
|
||||||
|
# from typing import List
|
||||||
|
# from ..utils import CommonFormater, dump
|
||||||
|
#
|
||||||
|
## console.print(table)
|
||||||
|
#
|
||||||
|
class Formater(GFormater):
|
||||||
|
"""The console formater"""
|
||||||
|
|
||||||
|
name = "console"
|
||||||
|
level = 10
|
||||||
|
enter_table = "\n"
|
||||||
|
|
||||||
|
def header(self):
|
||||||
|
"""Header of the documentation"""
|
||||||
|
return ""
|
||||||
|
|
||||||
|
def run(self, dico: dict, level: int) -> str:
|
||||||
|
msg = super().run(dico, level)
|
||||||
|
from rich.console import Console
|
||||||
|
from rich.markdown import Markdown
|
||||||
|
|
||||||
|
console = Console()
|
||||||
|
|
||||||
|
markdown = Markdown(msg)
|
||||||
|
with console.capture() as capture:
|
||||||
|
console.print(markdown)
|
||||||
|
return capture.get()
|
||||||
|
|
||||||
|
def link(
|
||||||
|
self,
|
||||||
|
comment: str,
|
||||||
|
link: str,
|
||||||
|
) -> str:
|
||||||
|
"""Add a link"""
|
||||||
|
return self.prop(comment, False)
|
|
@ -16,22 +16,25 @@ You should have received a copy of the GNU Lesser General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from io import BytesIO
|
|
||||||
from typing import List
|
from typing import List
|
||||||
from itertools import chain
|
|
||||||
from ruamel.yaml import YAML
|
from ..utils import dump, CommonFormater
|
||||||
|
|
||||||
|
|
||||||
class Formater:
|
class Formater(CommonFormater):
|
||||||
|
"""The markdown (for github) formater"""
|
||||||
|
|
||||||
name = "github"
|
name = "github"
|
||||||
|
_table_name = "github"
|
||||||
level = 50
|
level = 50
|
||||||
|
enter_table = "<br/>"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
self._yaml = YAML()
|
self.max_line = 0
|
||||||
self._yaml.indent(mapping=2, sequence=4, offset=2)
|
super().__init__()
|
||||||
self.header_setted = False
|
|
||||||
|
|
||||||
def header(self):
|
def header(self) -> str:
|
||||||
|
"""Header of the documentation"""
|
||||||
if self.header_setted:
|
if self.header_setted:
|
||||||
return ""
|
return ""
|
||||||
self.header_setted = True
|
self.header_setted = True
|
||||||
|
@ -42,86 +45,85 @@ class Formater:
|
||||||
title: str,
|
title: str,
|
||||||
level: int,
|
level: int,
|
||||||
) -> str:
|
) -> str:
|
||||||
|
"""Display family name as a title"""
|
||||||
char = "#"
|
char = "#"
|
||||||
return f"{char * level} {title}\n\n"
|
return f"{char * level} {title}\n\n"
|
||||||
|
|
||||||
def yaml(self, dump):
|
|
||||||
return f"```yaml\n---\n{self.dump(dump)}\n```\n"
|
|
||||||
|
|
||||||
def table(self, table):
|
|
||||||
return table
|
|
||||||
|
|
||||||
def link(
|
|
||||||
self,
|
|
||||||
comment: str,
|
|
||||||
link: str,
|
|
||||||
) -> str:
|
|
||||||
return f"[`{comment}`]({link})"
|
|
||||||
|
|
||||||
def prop(
|
|
||||||
self,
|
|
||||||
prop: str,
|
|
||||||
) -> str:
|
|
||||||
return f"`{prop}`"
|
|
||||||
|
|
||||||
def list(
|
|
||||||
self,
|
|
||||||
choices,
|
|
||||||
):
|
|
||||||
prefix = "<br/>- "
|
|
||||||
char = "<br/>- "
|
|
||||||
return prefix + char.join([self.dump(choice) for choice in choices])
|
|
||||||
|
|
||||||
def is_list(
|
|
||||||
self,
|
|
||||||
txt: str,
|
|
||||||
) -> str:
|
|
||||||
return txt.startswith("* ")
|
|
||||||
|
|
||||||
def columns(
|
|
||||||
self,
|
|
||||||
col1: List[str],
|
|
||||||
col2: List[str],
|
|
||||||
) -> None:
|
|
||||||
self.max_line = 0
|
|
||||||
for params in chain(col1, col2):
|
|
||||||
for param in params.split("\n"):
|
|
||||||
self.max_line = max(self.max_line, len(param))
|
|
||||||
self.max_line += 1
|
|
||||||
|
|
||||||
def join(
|
def join(
|
||||||
self,
|
self,
|
||||||
lst: List[str],
|
lst: List[str],
|
||||||
) -> str:
|
) -> str:
|
||||||
return "<br/>".join(lst)
|
"""Display line in table from a list"""
|
||||||
|
return self.enter_table.join(lst)
|
||||||
def to_string(
|
|
||||||
self,
|
|
||||||
text: str,
|
|
||||||
) -> str:
|
|
||||||
return text.strip().replace("\n", "<br/>")
|
|
||||||
|
|
||||||
def table_header(self, lst):
|
|
||||||
return lst[0] + " " * (self.max_line - len(lst[0])), lst[1] + " " * (
|
|
||||||
self.max_line - len(lst[1])
|
|
||||||
)
|
|
||||||
|
|
||||||
def bold(
|
def bold(
|
||||||
self,
|
self,
|
||||||
msg: str,
|
msg: str,
|
||||||
) -> str:
|
) -> str:
|
||||||
|
"""Set a text to bold"""
|
||||||
return f"**{msg}**"
|
return f"**{msg}**"
|
||||||
|
|
||||||
def italic(
|
def italic(
|
||||||
self,
|
self,
|
||||||
msg: str,
|
msg: str,
|
||||||
) -> str:
|
) -> str:
|
||||||
|
"""Set a text to italic"""
|
||||||
return f"*{msg}*"
|
return f"*{msg}*"
|
||||||
|
|
||||||
def dump(self, dico):
|
def stripped(
|
||||||
with BytesIO() as ymlfh:
|
self,
|
||||||
self._yaml.dump(dico, ymlfh)
|
text: str,
|
||||||
ret = ymlfh.getvalue().decode("utf-8").strip()
|
) -> str:
|
||||||
if ret.endswith("..."):
|
"""Return stripped text (as help)"""
|
||||||
ret = ret[:-3].strip()
|
return text.strip().replace("\n", self.enter_table)
|
||||||
|
|
||||||
|
def list(
|
||||||
|
self,
|
||||||
|
choices,
|
||||||
|
):
|
||||||
|
"""Display a liste of element"""
|
||||||
|
char = f"{self.enter_table}- "
|
||||||
|
ret = ""
|
||||||
|
for choice in choices:
|
||||||
|
if not isinstance(choice, str):
|
||||||
|
choice = dump(choice)
|
||||||
|
ret += char + choice
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
def prop(
|
||||||
|
self,
|
||||||
|
prop: str,
|
||||||
|
italic: bool,
|
||||||
|
) -> str:
|
||||||
|
"""Display property"""
|
||||||
|
prop = f"`{prop}`"
|
||||||
|
if italic:
|
||||||
|
prop = self.italic(prop)
|
||||||
|
return prop
|
||||||
|
|
||||||
|
def table_header(self, lst):
|
||||||
|
"""Manage the header of a table"""
|
||||||
|
return lst[0] + " " * (self.max_line - len(lst[0])), lst[1] + " " * (
|
||||||
|
self.max_line - len(lst[1])
|
||||||
|
)
|
||||||
|
|
||||||
|
def yaml(self, _dump):
|
||||||
|
"""Dump yaml part of documentation"""
|
||||||
|
return f"```yaml\n---\n{dump(_dump)}\n```\n"
|
||||||
|
|
||||||
|
def link(
|
||||||
|
self,
|
||||||
|
comment: str,
|
||||||
|
link: str,
|
||||||
|
) -> str:
|
||||||
|
"""Add a link"""
|
||||||
|
return f"[`{comment}`]({link})"
|
||||||
|
|
||||||
|
def columns(
|
||||||
|
self,
|
||||||
|
col: List[str],
|
||||||
|
) -> None:
|
||||||
|
"""count columns length"""
|
||||||
|
for line in col:
|
||||||
|
for l in line.split(self.enter_table):
|
||||||
|
self.max_line = max(self.max_line, len(l) + 1)
|
||||||
|
|
35
src/rougail/output_doc/output/ojson.py
Normal file
35
src/rougail/output_doc/output/ojson.py
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
"""
|
||||||
|
Silique (https://www.silique.fr)
|
||||||
|
Copyright (C) 2024
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||||
|
details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from json import dumps
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
|
|
||||||
|
class Formater:
|
||||||
|
"""Just return internal structure to json"""
|
||||||
|
|
||||||
|
name = "json"
|
||||||
|
level = 90
|
||||||
|
|
||||||
|
def run(self, dico: dict, *args) -> str: # pylint: disable=unused-argument
|
||||||
|
"""Transform to string"""
|
||||||
|
return dumps(dico, ensure_ascii=False)
|
||||||
|
|
||||||
|
def italic(self, msg: Any) -> str:
|
||||||
|
"""Just return a string"""
|
||||||
|
return str(msg)
|
367
src/rougail/output_doc/utils.py
Normal file
367
src/rougail/output_doc/utils.py
Normal file
|
@ -0,0 +1,367 @@
|
||||||
|
"""
|
||||||
|
Silique (https://www.silique.fr)
|
||||||
|
Copyright (C) 2024
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||||
|
details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
from io import BytesIO
|
||||||
|
from ruamel.yaml import YAML
|
||||||
|
import tabulate as tabulate_module
|
||||||
|
from tiramisu.error import display_list
|
||||||
|
from tabulate import tabulate
|
||||||
|
|
||||||
|
from .i18n import _
|
||||||
|
|
||||||
|
|
||||||
|
ROUGAIL_VARIABLE_TYPE = (
|
||||||
|
"https://rougail.readthedocs.io/en/latest/variable.html#variables-types"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
ENTER = "\n\n"
|
||||||
|
|
||||||
|
|
||||||
|
DocTypes = {
|
||||||
|
"domainname": {
|
||||||
|
"params": {
|
||||||
|
"allow_startswith_dot": _("the domain name can starts by a dot"),
|
||||||
|
"allow_without_dot": _("the domain name can be a hostname"),
|
||||||
|
"allow_ip": _("the domain name can be an IP"),
|
||||||
|
"allow_cidr_network": _("the domain name can be network in CIDR format"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"number": {
|
||||||
|
"params": {
|
||||||
|
"min_number": _("the minimum value is {0}"),
|
||||||
|
"max_number": _("the maximum value is {0}"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"ip": {
|
||||||
|
"msg": "IP",
|
||||||
|
"params": {
|
||||||
|
"cidr": _("IP must be in CIDR format"),
|
||||||
|
"private_only": _("private IP are allowed"),
|
||||||
|
"allow_reserved": _("reserved IP are allowed"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"hostname": {
|
||||||
|
"params": {
|
||||||
|
"allow_ip": _("the host name can be an IP"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"web_address": {
|
||||||
|
"params": {
|
||||||
|
"allow_ip": _("the domain name in web address can be an IP"),
|
||||||
|
"allow_without_dot": _(
|
||||||
|
"the domain name in web address can be only a hostname"
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"port": {
|
||||||
|
"params": {
|
||||||
|
"allow_range": _("can be range of port"),
|
||||||
|
"allow_protocol": _("can have the protocol"),
|
||||||
|
"allow_zero": _("port 0 is allowed"),
|
||||||
|
"allow_wellknown": _("ports 1 to 1023 are allowed"),
|
||||||
|
"allow_registred": _("ports 1024 to 49151 are allowed"),
|
||||||
|
"allow_private": _("ports greater than 49152 are allowed"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"secret": {
|
||||||
|
"params": {
|
||||||
|
"min_len": _("minimum length for the secret"),
|
||||||
|
"max_len": _("maximum length for the secret"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_yaml = YAML()
|
||||||
|
_yaml.indent(mapping=2, sequence=4, offset=2)
|
||||||
|
|
||||||
|
|
||||||
|
def dump(dico):
|
||||||
|
"""Dump variable, means transform bool, ... to yaml string"""
|
||||||
|
with BytesIO() as ymlfh:
|
||||||
|
_yaml.dump(dico, ymlfh)
|
||||||
|
ret = ymlfh.getvalue().decode("utf-8").strip()
|
||||||
|
if ret.endswith("..."):
|
||||||
|
ret = ret[:-3].strip()
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
def to_phrase(msg):
|
||||||
|
"""Add maj for the first character and ends with dot"""
|
||||||
|
if not msg:
|
||||||
|
# replace None to empty string
|
||||||
|
return ""
|
||||||
|
msg = str(msg).strip()
|
||||||
|
# a phrase must ends with a dot
|
||||||
|
if not msg.endswith("."):
|
||||||
|
msg += "."
|
||||||
|
# and start with a maj
|
||||||
|
return msg[0].upper() + msg[1:]
|
||||||
|
|
||||||
|
|
||||||
|
class CommonFormater:
|
||||||
|
"""Class with common function for formater"""
|
||||||
|
|
||||||
|
enter_table = "\n"
|
||||||
|
# tabulate module name
|
||||||
|
name = None
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
tabulate_module.PRESERVE_WHITESPACE = True
|
||||||
|
self.header_setted = False
|
||||||
|
|
||||||
|
# Class you needs implement to your Formater
|
||||||
|
def header(self):
|
||||||
|
"""Header of the documentation"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def title(
|
||||||
|
self,
|
||||||
|
title: str,
|
||||||
|
level: int,
|
||||||
|
) -> str:
|
||||||
|
"""Display family name as a title"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def join(
|
||||||
|
self,
|
||||||
|
lst: List[str],
|
||||||
|
) -> str:
|
||||||
|
"""Display line in table from a list"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def bold(
|
||||||
|
self,
|
||||||
|
msg: str,
|
||||||
|
) -> str:
|
||||||
|
"""Set a text to bold"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def stripped(
|
||||||
|
self,
|
||||||
|
text: str,
|
||||||
|
) -> str:
|
||||||
|
"""Return stripped text (as help)"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def list(
|
||||||
|
self,
|
||||||
|
choices: list,
|
||||||
|
) -> str:
|
||||||
|
"""Display a liste of element"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def prop(
|
||||||
|
self,
|
||||||
|
prop: str,
|
||||||
|
italic: bool,
|
||||||
|
) -> str:
|
||||||
|
"""Display property"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def link(
|
||||||
|
self,
|
||||||
|
comment: str,
|
||||||
|
link: str,
|
||||||
|
) -> str:
|
||||||
|
"""Add a link"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
##################
|
||||||
|
|
||||||
|
def table_header(
|
||||||
|
self,
|
||||||
|
lst: list,
|
||||||
|
) -> tuple:
|
||||||
|
"""Manage the header of a table"""
|
||||||
|
return lst
|
||||||
|
|
||||||
|
def run(self, dico: dict, level: int) -> str:
|
||||||
|
"""Transform to string"""
|
||||||
|
msg = self.header()
|
||||||
|
if dico:
|
||||||
|
msg += self.dict_to_string(dico, level + 1, root=True)
|
||||||
|
return msg
|
||||||
|
|
||||||
|
def dict_to_string(self, dico: dict, level: int, root: bool = False) -> str:
|
||||||
|
"""Parse the dict to transform to dict"""
|
||||||
|
msg = ""
|
||||||
|
table_datas = []
|
||||||
|
title_added = not root
|
||||||
|
for value in dico.values():
|
||||||
|
if value["type"] == "namespace":
|
||||||
|
msg += self.namespace_to_string(value["informations"], level)
|
||||||
|
msg += self.dict_to_string(value["children"], level)
|
||||||
|
else:
|
||||||
|
if not title_added:
|
||||||
|
msg += self.title(_("Variables"), level - 1)
|
||||||
|
if value["type"] == "variable":
|
||||||
|
self.variable_to_string(value, table_datas)
|
||||||
|
else:
|
||||||
|
if table_datas:
|
||||||
|
msg += self.table(table_datas)
|
||||||
|
msg += self.family_to_string(value["informations"], level)
|
||||||
|
msg += self.dict_to_string(value["children"], level + 1)
|
||||||
|
title_added = True
|
||||||
|
if table_datas:
|
||||||
|
msg += self.table(table_datas)
|
||||||
|
return msg
|
||||||
|
|
||||||
|
# FAMILY
|
||||||
|
def namespace_to_string(self, dico: dict, level: int) -> str:
|
||||||
|
"""manage namespace family"""
|
||||||
|
return self.title(
|
||||||
|
_('Variables for "{0}"').format(self.family_description(dico)), level - 1
|
||||||
|
)
|
||||||
|
|
||||||
|
def family_to_string(self, dico: dict, level: int) -> str:
|
||||||
|
"""manage other family type"""
|
||||||
|
msg = self.title(self.family_description(dico), level)
|
||||||
|
calculated_properties = []
|
||||||
|
msg += self.property_to_string(dico, calculated_properties) + ENTER
|
||||||
|
if calculated_properties:
|
||||||
|
msg += self.join(calculated_properties) + ENTER
|
||||||
|
helps = dico.get("help")
|
||||||
|
if helps:
|
||||||
|
for help_ in helps:
|
||||||
|
msg += help_.strip() + ENTER
|
||||||
|
if "identifiers" in dico:
|
||||||
|
msg += self.section(_("Identifiers"), dico["identifiers"]) + ENTER
|
||||||
|
return msg
|
||||||
|
|
||||||
|
def family_description(self, dico: dict) -> str():
|
||||||
|
"""Get family name"""
|
||||||
|
if "description" in dico:
|
||||||
|
return dico["description"]
|
||||||
|
return display_list(
|
||||||
|
dico["paths"],
|
||||||
|
separator="or",
|
||||||
|
)
|
||||||
|
|
||||||
|
# VARIABLE
|
||||||
|
def variable_to_string(self, dico: dict, table_datas: dict) -> None:
|
||||||
|
"""Manage variable"""
|
||||||
|
calculated_properties = []
|
||||||
|
table_datas.append(
|
||||||
|
[
|
||||||
|
self.join(self.variable_first_column(dico, calculated_properties)),
|
||||||
|
self.join(self.variable_second_column(dico, calculated_properties)),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
def variable_first_column(self, dico: dict, calculated_properties: list) -> list:
|
||||||
|
"""Collect string for the first column"""
|
||||||
|
first_col = [
|
||||||
|
self.join([self.bold(path_) for path_ in dico["paths"]]),
|
||||||
|
self.property_to_string(dico, calculated_properties),
|
||||||
|
]
|
||||||
|
self.columns(first_col)
|
||||||
|
return first_col
|
||||||
|
|
||||||
|
def variable_second_column(self, dico: dict, calculated_properties: list) -> list:
|
||||||
|
"""Collect string for the second column"""
|
||||||
|
if "descriptions" in dico:
|
||||||
|
description = self.join(list(dict.fromkeys(dico["descriptions"])))
|
||||||
|
else:
|
||||||
|
description = to_phrase(
|
||||||
|
display_list(
|
||||||
|
list(dict.fromkeys(dico["names"])),
|
||||||
|
separator="or",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
second_col = [self.stripped(description)]
|
||||||
|
for help_ in dico.get("help", []):
|
||||||
|
second_col.append(self.stripped(help_))
|
||||||
|
if "validators" in dico:
|
||||||
|
validators = dico["validators"]
|
||||||
|
if len(validators) == 1:
|
||||||
|
second_col.append(self.section(_("Validator"), validators[0]))
|
||||||
|
else:
|
||||||
|
second_col.append(self.section(_("Validators"), self.list(validators)))
|
||||||
|
if "choices" in dico:
|
||||||
|
second_col.append(self.section(_("Choices"), dico["choices"]))
|
||||||
|
if "default" in dico and dico.get("display_default", True):
|
||||||
|
second_col.append(self.section(_("Default"), dico["default"]))
|
||||||
|
if "examples" in dico:
|
||||||
|
examples = dico["examples"]
|
||||||
|
if len(examples) == 1:
|
||||||
|
second_col.append(self.section(_("Example"), examples[0]))
|
||||||
|
else:
|
||||||
|
second_col.append(self.section(_("Examples"), examples))
|
||||||
|
second_col.extend(calculated_properties)
|
||||||
|
self.columns(second_col)
|
||||||
|
return second_col
|
||||||
|
|
||||||
|
# OTHERs
|
||||||
|
def property_to_string(self, dico: dict, calculated_properties: list) -> str:
|
||||||
|
"""Transform properties to string"""
|
||||||
|
properties = []
|
||||||
|
for prop in dico.get("properties", []):
|
||||||
|
if prop["type"] == "type":
|
||||||
|
properties.append(self.link(prop["name"], ROUGAIL_VARIABLE_TYPE))
|
||||||
|
else:
|
||||||
|
if "annotation" in prop:
|
||||||
|
italic = True
|
||||||
|
calculated_properties.append(
|
||||||
|
self.section(prop["name"].capitalize(), prop["annotation"])
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
italic = False
|
||||||
|
prop_str = self.prop(prop["name"], italic=italic)
|
||||||
|
properties.append(prop_str)
|
||||||
|
if not properties:
|
||||||
|
return ""
|
||||||
|
return " ".join(properties)
|
||||||
|
|
||||||
|
def columns(
|
||||||
|
self,
|
||||||
|
col: List[str], # pylint: disable=unused-argument
|
||||||
|
) -> None:
|
||||||
|
"""Manage column"""
|
||||||
|
return
|
||||||
|
|
||||||
|
def table(self, datas: list) -> str:
|
||||||
|
"""Transform list to a table in string format"""
|
||||||
|
msg = (
|
||||||
|
tabulate(
|
||||||
|
datas,
|
||||||
|
headers=self.table_header([_("Variable"), _("Description")]),
|
||||||
|
tablefmt=self._table_name,
|
||||||
|
)
|
||||||
|
+ "\n\n"
|
||||||
|
)
|
||||||
|
datas.clear()
|
||||||
|
return msg
|
||||||
|
|
||||||
|
def section(
|
||||||
|
self,
|
||||||
|
name: str,
|
||||||
|
msg: str,
|
||||||
|
) -> str:
|
||||||
|
"""Return something like Name: msg"""
|
||||||
|
if isinstance(msg, list):
|
||||||
|
if len(msg) == 1:
|
||||||
|
msg = msg[0]
|
||||||
|
else:
|
||||||
|
msg = self.list(msg)
|
||||||
|
if not isinstance(msg, str):
|
||||||
|
msg = dump(msg)
|
||||||
|
return _("{0}: {1}").format(self.bold(name), msg)
|
1
tests/docs/base/00_0empty.json
Normal file
1
tests/docs/base/00_0empty.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{}
|
0
tests/docs/base/00_0empty.sh
Normal file
0
tests/docs/base/00_0empty.sh
Normal file
|
@ -2,18 +2,19 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
_version: '1.1'
|
_version: '1.1'
|
||||||
version: # a variable
|
version: # a variable
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="107a,107a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.version** +
|
**rougail.version** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` |
|
||||||
A variable.
|
A variable.
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_0version_underscore.json
Normal file
1
tests/docs/base/00_0version_underscore.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"version": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.version"], "names": ["version"], "descriptions": ["A variable."]}}}}
|
|
@ -9,10 +9,9 @@ include_toc: true
|
||||||
_version: '1.1'
|
_version: '1.1'
|
||||||
version: # a variable
|
version: # a variable
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.version**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | A variable. |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.version**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A variable. |
|
||||||
|
|
||||||
|
|
18
tests/docs/base/00_0version_underscore.sh
Normal file
18
tests/docs/base/00_0version_underscore.sh
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
_version: '1.1'
|
||||||
|
version: # a variable
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.version[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m A variable.
|
||||||
|
|
|
@ -2,18 +2,19 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.0'
|
version: '1.0'
|
||||||
empty:
|
empty:
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="107a,107a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.empty** +
|
**rougail.empty** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` |
|
||||||
Empty.
|
Empty.
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_1empty_variable.json
Normal file
1
tests/docs/base/00_1empty_variable.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"empty": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.empty"], "names": ["empty"]}}}}
|
|
@ -9,10 +9,9 @@ include_toc: true
|
||||||
version: '1.0'
|
version: '1.0'
|
||||||
empty:
|
empty:
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.empty**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | Empty. |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.empty**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | Empty. |
|
||||||
|
|
||||||
|
|
18
tests/docs/base/00_1empty_variable.sh
Normal file
18
tests/docs/base/00_1empty_variable.sh
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.0'
|
||||||
|
empty:
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.empty[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m Empty.
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: 1.1
|
version: 1.1
|
||||||
var1: no # a first variable
|
var1: no # a first variable
|
||||||
var2:
|
var2:
|
||||||
|
@ -12,21 +13,22 @@ var2:
|
||||||
{{ _.var1 }}
|
{{ _.var1 }}
|
||||||
description: the value of var1
|
description: the value of var1
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="130a,130a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var1** +
|
**rougail.var1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
|
||||||
A first variable. +
|
A first variable. +
|
||||||
**Défaut**: no
|
**Default**: no
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var2** +
|
**rougail.var2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `obligatoire` `unique` `multiple` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `unique` `multiple` |
|
||||||
A second variable. +
|
A second variable. +
|
||||||
**Défaut**: the value of var1.
|
**Default**: the value of var1.
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_2default_calculated.json
Normal file
1
tests/docs/base/00_2default_calculated.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"var1": {"type": "variable", "default": "no", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["A first variable."]}, "var2": {"type": "variable", "default": "the value of var1.", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["A second variable."], "multiple": true}}}}
|
|
@ -16,11 +16,10 @@ var2:
|
||||||
{{ _.var1 }}
|
{{ _.var1 }}
|
||||||
description: the value of var1
|
description: the value of var1
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | A first variable.<br/>**Défaut**: no |
|
|
||||||
| **rougail.var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` `unique` `multiple` | A second variable.<br/>**Défaut**: the value of var1. |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A first variable.<br/>**Default**: no |
|
||||||
|
| **rougail.var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | A second variable.<br/>**Default**: the value of var1. |
|
||||||
|
|
||||||
|
|
32
tests/docs/base/00_2default_calculated.sh
Normal file
32
tests/docs/base/00_2default_calculated.sh
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
var1: no # a first variable
|
||||||
|
var2:
|
||||||
|
description: a second variable
|
||||||
|
multi: true
|
||||||
|
default:
|
||||||
|
jinja: |
|
||||||
|
{{ _.var1 }}
|
||||||
|
description: the value of var1
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var1[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m A first variable.
|
||||||
|
[1mDefault[0m: no
|
||||||
|
[1mrougail.var2[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m [1;36;40munique[0m [1;36;40mmultiple[0m A second variable.
|
||||||
|
[1mDefault[0m: the value of var1.
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: 1.1
|
version: 1.1
|
||||||
var1: # a first variable
|
var1: # a first variable
|
||||||
- no
|
- no
|
||||||
|
@ -17,25 +18,26 @@ var2:
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
description: the value of _.var1
|
description: the value of _.var1
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="130a,130a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var1** +
|
**rougail.var1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `obligatoire` `unique` `multiple` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `unique` `multiple` |
|
||||||
A first variable. +
|
A first variable. +
|
||||||
**Défaut**:
|
**Default**:
|
||||||
|
|
||||||
* no
|
* no
|
||||||
* yes
|
* yes
|
||||||
* maybe
|
* maybe
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var2** +
|
**rougail.var2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `obligatoire` `unique` `multiple` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `unique` `multiple` |
|
||||||
A second variable. +
|
A second variable. +
|
||||||
**Défaut**: the value of _.var1.
|
**Default**: the value of _.var1.
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_2default_calculated_multi.json
Normal file
1
tests/docs/base/00_2default_calculated_multi.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"var1": {"type": "variable", "default": ["no", "yes", "maybe"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["A first variable."], "multiple": true}, "var2": {"type": "variable", "default": "the value of _.var1.", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["A second variable."], "multiple": true}}}}
|
|
@ -21,11 +21,10 @@ var2:
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
description: the value of _.var1
|
description: the value of _.var1
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` `unique` `multiple` | A first variable.<br/>**Défaut**: <br/>- no<br/>- yes<br/>- maybe |
|
|
||||||
| **rougail.var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` `unique` `multiple` | A second variable.<br/>**Défaut**: the value of _.var1. |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | A first variable.<br/>**Default**: <br/>- no<br/>- yes<br/>- maybe |
|
||||||
|
| **rougail.var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | A second variable.<br/>**Default**: the value of _.var1. |
|
||||||
|
|
||||||
|
|
39
tests/docs/base/00_2default_calculated_multi.sh
Normal file
39
tests/docs/base/00_2default_calculated_multi.sh
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
var1: # a first variable
|
||||||
|
- no
|
||||||
|
- yes
|
||||||
|
- maybe
|
||||||
|
var2:
|
||||||
|
description: a second variable
|
||||||
|
multi: true
|
||||||
|
default:
|
||||||
|
jinja: |
|
||||||
|
{% for val in _.var1 %}
|
||||||
|
{{ val }}
|
||||||
|
{% endfor %}
|
||||||
|
description: the value of _.var1
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var1[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m [1;36;40munique[0m [1;36;40mmultiple[0m A first variable.
|
||||||
|
[1mDefault[0m:
|
||||||
|
|
||||||
|
|
||||||
|
[1;33m • [0mno
|
||||||
|
[1;33m • [0myes
|
||||||
|
[1;33m • [0mmaybe
|
||||||
|
[1;33m [0m| | [1mrougail.var2[0m [1;36;40mstring[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m [1;36;40munique[0m [1;36;40mmultiple[0m
|
||||||
|
[1;33m [0m| A second variable. [1mDefault[0m: the value of _.var1.
|
||||||
|
[1;33m [0m|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: 1.1
|
version: 1.1
|
||||||
|
|
||||||
var1:
|
var1:
|
||||||
|
@ -17,22 +18,23 @@ var2:
|
||||||
type: variable
|
type: variable
|
||||||
variable: _.var1
|
variable: _.var1
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="134a,134a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var1** +
|
**rougail.var1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[domainname]` `basic` `obligatoire` `unique` `multiple` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[domainname]` `basic` `mandatory` `unique` `multiple` |
|
||||||
A first variable. +
|
A first variable. +
|
||||||
**Validator**: le nom de domaine peut être une IP
|
**Validator**: the domain name can be an IP
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var2** +
|
**rougail.var2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[domainname]` `standard` `obligatoire` `unique` `multiple` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[domainname]` `standard` `mandatory` `unique` `multiple` |
|
||||||
A second variable. +
|
A second variable. +
|
||||||
**Validator**: le nom de domaine peut être une IP +
|
**Validator**: the domain name can be an IP +
|
||||||
**Défaut**: la valeur de la variable "rougail.var1".
|
**Default**: the value of the variable "rougail.var1".
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"var1": {"type": "variable", "properties": [{"type": "type", "name": "domainname"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "validators": ["the domain name can be an IP"], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["A first variable."], "multiple": true}, "var2": {"type": "variable", "default": "the value of the variable \"rougail.var1\".", "properties": [{"type": "type", "name": "domainname"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "validators": ["the domain name can be an IP"], "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["A second variable."], "multiple": true}}}}
|
|
@ -21,11 +21,10 @@ var2:
|
||||||
type: variable
|
type: variable
|
||||||
variable: _.var1
|
variable: _.var1
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var1**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` `unique` `multiple` | A first variable.<br/>**Validator**: le nom de domaine peut être une IP |
|
|
||||||
| **rougail.var2**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` `unique` `multiple` | A second variable.<br/>**Validator**: le nom de domaine peut être une IP<br/>**Défaut**: la valeur de la variable "rougail.var1". |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | A first variable.<br/>**Validator**: the domain name can be an IP |
|
||||||
|
| **rougail.var2**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | A second variable.<br/>**Validator**: the domain name can be an IP<br/>**Default**: the value of the variable "rougail.var1". |
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
var1:
|
||||||
|
description: a first variable
|
||||||
|
multi: true
|
||||||
|
type: domainname
|
||||||
|
params:
|
||||||
|
allow_ip: true
|
||||||
|
|
||||||
|
var2:
|
||||||
|
description: a second variable
|
||||||
|
default:
|
||||||
|
type: variable
|
||||||
|
variable: _.var1
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var1[0m
|
||||||
|
[1;36;40mdomainname[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m [1;36;40munique[0m [1;36;40mmultiple[0m A first variable.
|
||||||
|
[1mValidator[0m: the domain name can be an IP
|
||||||
|
[1mrougail.var2[0m
|
||||||
|
[1;36;40mdomainname[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m [1;36;40munique[0m [1;36;40mmultiple[0m A second variable.
|
||||||
|
[1mValidator[0m: the domain name can be an IP
|
||||||
|
[1mDefault[0m: the value of the variable "rougail.var1".
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.0'
|
version: '1.0'
|
||||||
var1:
|
var1:
|
||||||
description: a variable
|
description: a variable
|
||||||
|
@ -10,23 +11,25 @@ var1:
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.0'
|
version: '1.0'
|
||||||
var2:
|
var2:
|
||||||
description: a variable
|
description: a variable
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="107a,107a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var1** +
|
**rougail.var1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` |
|
||||||
A variable.
|
A variable.
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var2** +
|
**rougail.var2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` |
|
||||||
A variable.
|
A variable.
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_4load_subfolder.json
Normal file
1
tests/docs/base/00_4load_subfolder.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"var1": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["A variable."]}, "var2": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["A variable."]}}}}
|
|
@ -18,11 +18,10 @@ version: '1.0'
|
||||||
var2:
|
var2:
|
||||||
description: a variable
|
description: a variable
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | A variable. |
|
|
||||||
| **rougail.var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | A variable. |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A variable. |
|
||||||
|
| **rougail.var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A variable. |
|
||||||
|
|
||||||
|
|
30
tests/docs/base/00_4load_subfolder.sh
Normal file
30
tests/docs/base/00_4load_subfolder.sh
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# dictionaries/rougail/99-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.0'
|
||||||
|
var1:
|
||||||
|
description: a variable
|
||||||
|
```
|
||||||
|
# dictionaries/rougail2/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.0'
|
||||||
|
var2:
|
||||||
|
description: a variable
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var1[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m A variable.
|
||||||
|
[1mrougail.var2[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m A variable.
|
||||||
|
|
|
@ -2,21 +2,22 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.0'
|
version: '1.0'
|
||||||
without_type:
|
without_type:
|
||||||
description: a variable
|
description: a variable
|
||||||
default: non
|
default: non
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="110a,110a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.without_type** +
|
**rougail.without_type** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
|
||||||
A variable. +
|
A variable. +
|
||||||
**Défaut**: non
|
**Default**: non
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_5load_notype.json
Normal file
1
tests/docs/base/00_5load_notype.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"without_type": {"type": "variable", "default": "non", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.without_type"], "names": ["without_type"], "descriptions": ["A variable."]}}}}
|
|
@ -11,10 +11,9 @@ without_type:
|
||||||
description: a variable
|
description: a variable
|
||||||
default: non
|
default: non
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.without_type**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | A variable.<br/>**Défaut**: non |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.without_type**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable.<br/>**Default**: non |
|
||||||
|
|
||||||
|
|
22
tests/docs/base/00_5load_notype.sh
Normal file
22
tests/docs/base/00_5load_notype.sh
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.0'
|
||||||
|
without_type:
|
||||||
|
description: a variable
|
||||||
|
default: non
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.without_type[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m A variable.
|
||||||
|
[1mDefault[0m: non
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
var1: true # the first variable
|
var1: true # the first variable
|
||||||
var2:
|
var2:
|
||||||
|
@ -20,41 +21,46 @@ var6:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="111a,111a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var1** +
|
**rougail.var1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `mandatory` |
|
||||||
The first variable. +
|
The first variable. +
|
||||||
**Défaut**: True
|
**Default**: true
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var2** +
|
**rougail.var2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `mandatory` |
|
||||||
The second variable. +
|
The second variable. +
|
||||||
**Défaut**: True
|
**Default**: true
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var3** +
|
**rougail.var3** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `mandatory` |
|
||||||
The third variable. +
|
The third variable. +
|
||||||
**Défaut**: True
|
**Default**: true
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var4** +
|
**rougail.var4** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `mandatory` |
|
||||||
The forth variable. +
|
The forth variable. +
|
||||||
**Défaut**: False
|
**Default**: false
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var5** +
|
**rougail.var5** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `mandatory` |
|
||||||
The fifth variable. +
|
The fifth variable. +
|
||||||
**Défaut**: False
|
**Default**: false
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var6** +
|
**rougail.var6** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `mandatory` |
|
||||||
The sixth variable. +
|
The sixth variable. +
|
||||||
**Défaut**: False
|
**Default**: false
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6boolean.json
Normal file
1
tests/docs/base/00_6boolean.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"var1": {"type": "variable", "default": true, "properties": [{"type": "type", "name": "boolean"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["The first variable."]}, "var2": {"type": "variable", "default": true, "properties": [{"type": "type", "name": "boolean"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["The second variable."]}, "var3": {"type": "variable", "default": true, "properties": [{"type": "type", "name": "boolean"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var3"], "names": ["var3"], "descriptions": ["The third variable."]}, "var4": {"type": "variable", "default": false, "properties": [{"type": "type", "name": "boolean"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var4"], "names": ["var4"], "descriptions": ["The forth variable."]}, "var5": {"type": "variable", "default": false, "properties": [{"type": "type", "name": "boolean"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var5"], "names": ["var5"], "descriptions": ["The fifth variable."]}, "var6": {"type": "variable", "default": false, "properties": [{"type": "type", "name": "boolean"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var6"], "names": ["var6"], "descriptions": ["The sixth variable."]}}}}
|
|
@ -24,15 +24,14 @@ var6:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var1**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The first variable.<br/>**Défaut**: True |
|
|
||||||
| **rougail.var2**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The second variable.<br/>**Défaut**: True |
|
|
||||||
| **rougail.var3**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The third variable.<br/>**Défaut**: True |
|
|
||||||
| **rougail.var4**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The forth variable.<br/>**Défaut**: False |
|
|
||||||
| **rougail.var5**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The fifth variable.<br/>**Défaut**: False |
|
|
||||||
| **rougail.var6**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The sixth variable.<br/>**Défaut**: False |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The first variable.<br/>**Default**: true |
|
||||||
|
| **rougail.var2**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The second variable.<br/>**Default**: true |
|
||||||
|
| **rougail.var3**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The third variable.<br/>**Default**: true |
|
||||||
|
| **rougail.var4**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The forth variable.<br/>**Default**: false |
|
||||||
|
| **rougail.var5**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The fifth variable.<br/>**Default**: false |
|
||||||
|
| **rougail.var6**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The sixth variable.<br/>**Default**: false |
|
||||||
|
|
||||||
|
|
60
tests/docs/base/00_6boolean.sh
Normal file
60
tests/docs/base/00_6boolean.sh
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
var1: true # the first variable
|
||||||
|
var2:
|
||||||
|
description: the second variable
|
||||||
|
default: true
|
||||||
|
var3:
|
||||||
|
description: the third variable
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
var4: false # the forth variable
|
||||||
|
var5:
|
||||||
|
description: the fifth variable
|
||||||
|
default: false
|
||||||
|
var6:
|
||||||
|
description: the sixth variable
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var1[0m
|
||||||
|
[1;36;40mboolean[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The first variable.
|
||||||
|
[1mDefault[0m: true
|
||||||
|
[1mrougail.var2[0m
|
||||||
|
[1;36;40mboolean[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The second variable.
|
||||||
|
[1mDefault[0m: true
|
||||||
|
[1mrougail.var3[0m
|
||||||
|
[1;36;40mboolean[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The third variable.
|
||||||
|
[1mDefault[0m: true
|
||||||
|
[1mrougail.var4[0m
|
||||||
|
[1;36;40mboolean[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The forth variable.
|
||||||
|
[1mDefault[0m: false
|
||||||
|
[1mrougail.var5[0m
|
||||||
|
[1;36;40mboolean[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The fifth variable.
|
||||||
|
[1mDefault[0m: false
|
||||||
|
[1mrougail.var6[0m
|
||||||
|
[1;36;40mboolean[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The sixth variable.
|
||||||
|
[1mDefault[0m: false
|
||||||
|
|
|
@ -2,22 +2,23 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
variable:
|
variable:
|
||||||
description: a variable
|
description: a variable
|
||||||
type: boolean
|
type: boolean
|
||||||
mandatory: false
|
mandatory: false
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="97a,97a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.variable** +
|
**rougail.variable** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` |
|
||||||
A variable. +
|
A variable. +
|
||||||
**Défaut**: True
|
**Default**: true
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6boolean_no_mandatory.json
Normal file
1
tests/docs/base/00_6boolean_no_mandatory.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"variable": {"type": "variable", "default": true, "properties": [{"type": "type", "name": "boolean"}, {"type": "mode", "name": "standard"}], "paths": ["rougail.variable"], "names": ["variable"], "descriptions": ["A variable."]}}}}
|
|
@ -12,10 +12,9 @@ variable:
|
||||||
type: boolean
|
type: boolean
|
||||||
mandatory: false
|
mandatory: false
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
| Variable | Description |
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| **rougail.variable**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` | A variable.<br/>**Défaut**: True |
|
| **rougail.variable**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` | A variable.<br/>**Default**: true |
|
||||||
|
|
||||||
|
|
||||||
|
|
23
tests/docs/base/00_6boolean_no_mandatory.sh
Normal file
23
tests/docs/base/00_6boolean_no_mandatory.sh
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
variable:
|
||||||
|
description: a variable
|
||||||
|
type: boolean
|
||||||
|
mandatory: false
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.variable[0m
|
||||||
|
[1;36;40mboolean[0m [1;36;40mstandard[0m A variable.
|
||||||
|
[1mDefault[0m: true
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
var1:
|
var1:
|
||||||
description: the first variable
|
description: the first variable
|
||||||
|
@ -44,66 +45,71 @@ var6:
|
||||||
- 3
|
- 3
|
||||||
default: 1
|
default: 1
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="110a,110a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var1** +
|
**rougail.var1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `basic` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `basic` `mandatory` |
|
||||||
The first variable. +
|
The first variable. +
|
||||||
**Choix**:
|
**Choices**:
|
||||||
|
|
||||||
* a
|
* a
|
||||||
* b
|
* b
|
||||||
* c
|
* c
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var2** +
|
**rougail.var2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `basic` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `basic` `mandatory` |
|
||||||
The second variable. +
|
The second variable. +
|
||||||
**Choix**:
|
**Choices**:
|
||||||
|
|
||||||
* a
|
* a
|
||||||
* b
|
* b
|
||||||
* c
|
* c
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var3** +
|
**rougail.var3** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` |
|
||||||
The third variable. +
|
The third variable. +
|
||||||
**Choix**:
|
**Choices**:
|
||||||
|
|
||||||
* a
|
* a
|
||||||
* b
|
* b
|
||||||
* c
|
* c
|
||||||
* null
|
* null
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var4** +
|
**rougail.var4** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` |
|
||||||
The forth variable. +
|
The forth variable. +
|
||||||
**Choix**:
|
**Choices**:
|
||||||
|
|
||||||
* null
|
* null
|
||||||
* b
|
* b
|
||||||
* c
|
* c
|
||||||
|
|
|
|
||||||
**rougail.var5** +
|
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` `obligatoire` |
|
|
||||||
The fifth variable. +
|
|
||||||
**Choix**:
|
|
||||||
|
|
||||||
* a ← (defaut)
|
**rougail.var5** +
|
||||||
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` `mandatory` |
|
||||||
|
The fifth variable. +
|
||||||
|
**Choices**:
|
||||||
|
|
||||||
|
* a ← (default)
|
||||||
* b
|
* b
|
||||||
* c
|
* c
|
||||||
|
|
|
|
||||||
**rougail.var6** +
|
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` `obligatoire` |
|
|
||||||
The sixth variable. +
|
|
||||||
**Choix**:
|
|
||||||
|
|
||||||
* 1 ← (defaut)
|
**rougail.var6** +
|
||||||
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` `mandatory` |
|
||||||
|
The sixth variable. +
|
||||||
|
**Choices**:
|
||||||
|
|
||||||
|
* 1 ← (default)
|
||||||
* 2
|
* 2
|
||||||
* 3
|
* 3
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6choice.json
Normal file
1
tests/docs/base/00_6choice.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"var1": {"type": "variable", "properties": [{"type": "type", "name": "choice"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "choices": ["a", "b", "c"], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["The first variable."]}, "var2": {"type": "variable", "properties": [{"type": "type", "name": "choice"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "choices": ["a", "b", "c"], "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["The second variable."]}, "var3": {"type": "variable", "properties": [{"type": "type", "name": "choice"}, {"type": "mode", "name": "standard"}], "choices": ["a", "b", "c", null], "paths": ["rougail.var3"], "names": ["var3"], "descriptions": ["The third variable."]}, "var4": {"type": "variable", "properties": [{"type": "type", "name": "choice"}, {"type": "mode", "name": "standard"}], "choices": [null, "b", "c"], "paths": ["rougail.var4"], "names": ["var4"], "descriptions": ["The forth variable."]}, "var5": {"type": "variable", "default": "a", "properties": [{"type": "type", "name": "choice"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "display_default": false, "choices": ["a ← (default)", "b", "c"], "paths": ["rougail.var5"], "names": ["var5"], "descriptions": ["The fifth variable."]}, "var6": {"type": "variable", "default": 1, "properties": [{"type": "type", "name": "choice"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "display_default": false, "choices": ["1 ← (default)", 2, 3], "paths": ["rougail.var6"], "names": ["var6"], "descriptions": ["The sixth variable."]}}}}
|
|
@ -48,15 +48,14 @@ var6:
|
||||||
- 3
|
- 3
|
||||||
default: 1
|
default: 1
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var1**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | The first variable.<br/>**Choix**: <br/>- a<br/>- b<br/>- c |
|
|
||||||
| **rougail.var2**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | The second variable.<br/>**Choix**: <br/>- a<br/>- b<br/>- c |
|
|
||||||
| **rougail.var3**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` | The third variable.<br/>**Choix**: <br/>- a<br/>- b<br/>- c<br/>- null |
|
|
||||||
| **rougail.var4**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` | The forth variable.<br/>**Choix**: <br/>- null<br/>- b<br/>- c |
|
|
||||||
| **rougail.var5**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The fifth variable.<br/>**Choix**: <br/>- a ← (defaut)<br/>- b<br/>- c |
|
|
||||||
| **rougail.var6**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The sixth variable.<br/>**Choix**: <br/>- 1 ← (defaut)<br/>- 2<br/>- 3 |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The first variable.<br/>**Choices**: <br/>- a<br/>- b<br/>- c |
|
||||||
|
| **rougail.var2**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The second variable.<br/>**Choices**: <br/>- a<br/>- b<br/>- c |
|
||||||
|
| **rougail.var3**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` | The third variable.<br/>**Choices**: <br/>- a<br/>- b<br/>- c<br/>- null |
|
||||||
|
| **rougail.var4**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` | The forth variable.<br/>**Choices**: <br/>- null<br/>- b<br/>- c |
|
||||||
|
| **rougail.var5**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The fifth variable.<br/>**Choices**: <br/>- a ← (default)<br/>- b<br/>- c |
|
||||||
|
| **rougail.var6**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The sixth variable.<br/>**Choices**: <br/>- 1 ← (default)<br/>- 2<br/>- 3 |
|
||||||
|
|
||||||
|
|
84
tests/docs/base/00_6choice.sh
Normal file
84
tests/docs/base/00_6choice.sh
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
var1:
|
||||||
|
description: the first variable
|
||||||
|
choices:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
- c
|
||||||
|
var2:
|
||||||
|
description: the second variable
|
||||||
|
choices:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
- c
|
||||||
|
var3:
|
||||||
|
description: the third variable
|
||||||
|
choices:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
- c
|
||||||
|
mandatory: false
|
||||||
|
var4:
|
||||||
|
description: the forth variable
|
||||||
|
choices:
|
||||||
|
-
|
||||||
|
- b
|
||||||
|
- c
|
||||||
|
mandatory: false
|
||||||
|
var5:
|
||||||
|
description: the fifth variable
|
||||||
|
choices:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
- c
|
||||||
|
default: a
|
||||||
|
var6:
|
||||||
|
description: the sixth variable
|
||||||
|
choices:
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- 3
|
||||||
|
default: 1
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var1[0m
|
||||||
|
[1;36;40mchoice[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m The first variable.
|
||||||
|
[1mChoices[0m:
|
||||||
|
|
||||||
|
|
||||||
|
[1;33m • [0ma
|
||||||
|
[1;33m • [0mb
|
||||||
|
[1;33m • [0mc | | [1mrougail.var2[0m [1;36;40mchoice[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m
|
||||||
|
[1;33m [0m| The second variable. [1mChoices[0m:
|
||||||
|
[1;33m • [0ma
|
||||||
|
[1;33m • [0mb
|
||||||
|
[1;33m • [0mc | | [1mrougail.var3[0m [1;36;40mchoice[0m [1;36;40mstandard[0m
|
||||||
|
[1;33m [0m| The third variable. [1mChoices[0m:
|
||||||
|
[1;33m • [0ma
|
||||||
|
[1;33m • [0mb
|
||||||
|
[1;33m • [0mc
|
||||||
|
[1;33m • [0mnull | | [1mrougail.var4[0m [1;36;40mchoice[0m [1;36;40mstandard[0m
|
||||||
|
[1;33m [0m| The forth variable. [1mChoices[0m:
|
||||||
|
[1;33m • [0mnull
|
||||||
|
[1;33m • [0mb
|
||||||
|
[1;33m • [0mc | | [1mrougail.var5[0m [1;36;40mchoice[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m
|
||||||
|
[1;33m [0m| The fifth variable. [1mChoices[0m:
|
||||||
|
[1;33m • [0ma ← (default)
|
||||||
|
[1;33m • [0mb
|
||||||
|
[1;33m • [0mc | | [1mrougail.var6[0m [1;36;40mchoice[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m
|
||||||
|
[1;33m [0m| The sixth variable. [1mChoices[0m:
|
||||||
|
[1;33m • [0m1 ← (default)
|
||||||
|
[1;33m • [0m2
|
||||||
|
[1;33m • [0m3 |
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: 1.1
|
version: 1.1
|
||||||
var:
|
var:
|
||||||
description: a variable
|
description: a variable
|
||||||
|
@ -14,17 +15,17 @@ var:
|
||||||
return_type: number
|
return_type: number
|
||||||
description: choices is 0 to 9
|
description: choices is 0 to 9
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="110a,110a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var** +
|
**rougail.var** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` `mandatory` |
|
||||||
A variable. +
|
A variable. +
|
||||||
**Choix**: choices is 0 to 9. +
|
**Choices**: choices is 0 to 9. +
|
||||||
**Défaut**: 9
|
**Default**: 9
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6choice_calculation.json
Normal file
1
tests/docs/base/00_6choice_calculation.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"var": {"type": "variable", "default": 9, "properties": [{"type": "type", "name": "choice"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "choices": "choices is 0 to 9.", "paths": ["rougail.var"], "names": ["var"], "descriptions": ["A variable."]}}}}
|
|
@ -18,10 +18,9 @@ var:
|
||||||
return_type: number
|
return_type: number
|
||||||
description: choices is 0 to 9
|
description: choices is 0 to 9
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | A variable.<br/>**Choix**: choices is 0 to 9.<br/>**Défaut**: 9 |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable.<br/>**Choices**: choices is 0 to 9.<br/>**Default**: 9 |
|
||||||
|
|
||||||
|
|
31
tests/docs/base/00_6choice_calculation.sh
Normal file
31
tests/docs/base/00_6choice_calculation.sh
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
var:
|
||||||
|
description: a variable
|
||||||
|
default: 9
|
||||||
|
choices:
|
||||||
|
jinja: |
|
||||||
|
{% for n in trange(0, 10) %}
|
||||||
|
{{ n }}
|
||||||
|
{% endfor %}
|
||||||
|
return_type: number
|
||||||
|
description: choices is 0 to 9
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var[0m
|
||||||
|
[1;36;40mchoice[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m A variable.
|
||||||
|
[1mChoices[0m: choices is 0 to 9.
|
||||||
|
[1mDefault[0m: 9
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
var1: # a second variable
|
var1: # a second variable
|
||||||
- a
|
- a
|
||||||
|
@ -13,26 +14,27 @@ var2:
|
||||||
choices:
|
choices:
|
||||||
variable: _.var1
|
variable: _.var1
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="110a,110a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var1** +
|
**rougail.var1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `obligatoire` `unique` `multiple` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `unique` `multiple` |
|
||||||
A second variable. +
|
A second variable. +
|
||||||
**Défaut**:
|
**Default**:
|
||||||
|
|
||||||
* a
|
* a
|
||||||
* b
|
* b
|
||||||
* c
|
* c
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var2** +
|
**rougail.var2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` `mandatory` |
|
||||||
A first variable. +
|
A first variable. +
|
||||||
**Choix**: la valeur de la variable "rougail.var1". +
|
**Choices**: the value of the variable "rougail.var1". +
|
||||||
**Défaut**: a
|
**Default**: a
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6choice_variable.json
Normal file
1
tests/docs/base/00_6choice_variable.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"var1": {"type": "variable", "default": ["a", "b", "c"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["A second variable."], "multiple": true}, "var2": {"type": "variable", "default": "a", "properties": [{"type": "type", "name": "choice"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "choices": "the value of the variable \"rougail.var1\".", "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["A first variable."]}}}}
|
|
@ -17,11 +17,10 @@ var2:
|
||||||
choices:
|
choices:
|
||||||
variable: _.var1
|
variable: _.var1
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` `unique` `multiple` | A second variable.<br/>**Défaut**: <br/>- a<br/>- b<br/>- c |
|
|
||||||
| **rougail.var2**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | A first variable.<br/>**Choix**: la valeur de la variable "rougail.var1".<br/>**Défaut**: a |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | A second variable.<br/>**Default**: <br/>- a<br/>- b<br/>- c |
|
||||||
|
| **rougail.var2**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A first variable.<br/>**Choices**: the value of the variable "rougail.var1".<br/>**Default**: a |
|
||||||
|
|
||||||
|
|
35
tests/docs/base/00_6choice_variable.sh
Normal file
35
tests/docs/base/00_6choice_variable.sh
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
var1: # a second variable
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
- c
|
||||||
|
var2:
|
||||||
|
description: a first variable
|
||||||
|
default: a
|
||||||
|
choices:
|
||||||
|
variable: _.var1
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var1[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m [1;36;40munique[0m [1;36;40mmultiple[0m A second variable.
|
||||||
|
[1mDefault[0m:
|
||||||
|
|
||||||
|
|
||||||
|
[1;33m • [0ma
|
||||||
|
[1;33m • [0mb
|
||||||
|
[1;33m • [0mc
|
||||||
|
[1;33m [0m| | [1mrougail.var2[0m [1;36;40mchoice[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m
|
||||||
|
[1;33m [0m| A first variable. [1mChoices[0m: the value of the variable "rougail.var1". [1mDefault[0m: a
|
||||||
|
[1;33m [0m|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
custom1:
|
custom1:
|
||||||
description: the first variable
|
description: the first variable
|
||||||
|
@ -11,20 +12,21 @@ custom2:
|
||||||
type: custom
|
type: custom
|
||||||
default: value
|
default: value
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="110a,110a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.custom1** +
|
**rougail.custom1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[custom]` `basic` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[custom]` `basic` `mandatory` |
|
||||||
The first variable.
|
The first variable.
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.custom2** +
|
**rougail.custom2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[custom]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[custom]` `standard` `mandatory` |
|
||||||
The seconf variable. +
|
The seconf variable. +
|
||||||
**Défaut**: value
|
**Default**: value
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6custom.json
Normal file
1
tests/docs/base/00_6custom.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"custom1": {"type": "variable", "properties": [{"type": "type", "name": "custom"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.custom1"], "names": ["custom1"], "descriptions": ["The first variable."]}, "custom2": {"type": "variable", "default": "value", "properties": [{"type": "type", "name": "custom"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.custom2"], "names": ["custom2"], "descriptions": ["The seconf variable."]}}}}
|
|
@ -15,11 +15,10 @@ custom2:
|
||||||
type: custom
|
type: custom
|
||||||
default: value
|
default: value
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.custom1**<br/>[`custom`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | The first variable. |
|
|
||||||
| **rougail.custom2**<br/>[`custom`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The seconf variable.<br/>**Défaut**: value |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.custom1**<br/>[`custom`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The first variable. |
|
||||||
|
| **rougail.custom2**<br/>[`custom`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The seconf variable.<br/>**Default**: value |
|
||||||
|
|
||||||
|
|
29
tests/docs/base/00_6custom.sh
Normal file
29
tests/docs/base/00_6custom.sh
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
custom1:
|
||||||
|
description: the first variable
|
||||||
|
type: custom
|
||||||
|
custom2:
|
||||||
|
description: the seconf variable
|
||||||
|
type: custom
|
||||||
|
default: value
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.custom1[0m
|
||||||
|
[1;36;40mcustom[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m The first variable.
|
||||||
|
[1mrougail.custom2[0m
|
||||||
|
[1;36;40mcustom[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The seconf variable.
|
||||||
|
[1mDefault[0m: value
|
||||||
|
|
|
@ -2,22 +2,23 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
variable:
|
variable:
|
||||||
description: a domain name variable
|
description: a domain name variable
|
||||||
type: domainname
|
type: domainname
|
||||||
default: my.domain.name
|
default: my.domain.name
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="114a,114a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.variable** +
|
**rougail.variable** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[domainname]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[domainname]` `standard` `mandatory` |
|
||||||
A domain name variable. +
|
A domain name variable. +
|
||||||
**Défaut**: my.domain.name
|
**Default**: my.domain.name
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6domainname.json
Normal file
1
tests/docs/base/00_6domainname.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"variable": {"type": "variable", "default": "my.domain.name", "properties": [{"type": "type", "name": "domainname"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.variable"], "names": ["variable"], "descriptions": ["A domain name variable."]}}}}
|
|
@ -12,10 +12,9 @@ variable:
|
||||||
type: domainname
|
type: domainname
|
||||||
default: my.domain.name
|
default: my.domain.name
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.variable**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | A domain name variable.<br/>**Défaut**: my.domain.name |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.variable**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A domain name variable.<br/>**Default**: my.domain.name |
|
||||||
|
|
||||||
|
|
23
tests/docs/base/00_6domainname.sh
Normal file
23
tests/docs/base/00_6domainname.sh
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
variable:
|
||||||
|
description: a domain name variable
|
||||||
|
type: domainname
|
||||||
|
default: my.domain.name
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.variable[0m
|
||||||
|
[1;36;40mdomainname[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m A domain name variable.
|
||||||
|
[1mDefault[0m: my.domain.name
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
variable:
|
variable:
|
||||||
description: a domain name variable
|
description: a domain name variable
|
||||||
|
@ -10,17 +11,17 @@ variable:
|
||||||
params:
|
params:
|
||||||
allow_ip: true
|
allow_ip: true
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="114a,114a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.variable** +
|
**rougail.variable** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[domainname]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[domainname]` `standard` `mandatory` |
|
||||||
A domain name variable. +
|
A domain name variable. +
|
||||||
**Validator**: le nom de domaine peut être une IP +
|
**Validator**: the domain name can be an IP +
|
||||||
**Défaut**: my.domain.name
|
**Default**: my.domain.name
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6domainname_params.json
Normal file
1
tests/docs/base/00_6domainname_params.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"variable": {"type": "variable", "default": "my.domain.name", "properties": [{"type": "type", "name": "domainname"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "validators": ["the domain name can be an IP"], "paths": ["rougail.variable"], "names": ["variable"], "descriptions": ["A domain name variable."]}}}}
|
|
@ -14,10 +14,9 @@ variable:
|
||||||
params:
|
params:
|
||||||
allow_ip: true
|
allow_ip: true
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.variable**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | A domain name variable.<br/>**Validator**: le nom de domaine peut être une IP<br/>**Défaut**: my.domain.name |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.variable**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A domain name variable.<br/>**Validator**: the domain name can be an IP<br/>**Default**: my.domain.name |
|
||||||
|
|
||||||
|
|
27
tests/docs/base/00_6domainname_params.sh
Normal file
27
tests/docs/base/00_6domainname_params.sh
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
variable:
|
||||||
|
description: a domain name variable
|
||||||
|
type: domainname
|
||||||
|
default: my.domain.name
|
||||||
|
params:
|
||||||
|
allow_ip: true
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.variable[0m
|
||||||
|
[1;36;40mdomainname[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m A domain name variable.
|
||||||
|
[1mValidator[0m: the domain name can be an IP
|
||||||
|
[1mDefault[0m: my.domain.name
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
var1: 0.0 # the first variable
|
var1: 0.0 # the first variable
|
||||||
var2:
|
var2:
|
||||||
|
@ -20,41 +21,46 @@ var6:
|
||||||
type: float
|
type: float
|
||||||
default: 10.1
|
default: 10.1
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="109a,109a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var1** +
|
**rougail.var1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `mandatory` |
|
||||||
The first variable. +
|
The first variable. +
|
||||||
**Défaut**: 0.0
|
**Default**: 0.0
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var2** +
|
**rougail.var2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `mandatory` |
|
||||||
The second variable. +
|
The second variable. +
|
||||||
**Défaut**: 0.0
|
**Default**: 0.0
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var3** +
|
**rougail.var3** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `mandatory` |
|
||||||
The third variable. +
|
The third variable. +
|
||||||
**Défaut**: 0.0
|
**Default**: 0.0
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var4** +
|
**rougail.var4** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `mandatory` |
|
||||||
The forth variable. +
|
The forth variable. +
|
||||||
**Défaut**: 10.1
|
**Default**: 10.1
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var5** +
|
**rougail.var5** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `mandatory` |
|
||||||
The fifth variable. +
|
The fifth variable. +
|
||||||
**Défaut**: 10.1
|
**Default**: 10.1
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var6** +
|
**rougail.var6** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[float]` `standard` `mandatory` |
|
||||||
The sixth variable. +
|
The sixth variable. +
|
||||||
**Défaut**: 10.1
|
**Default**: 10.1
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6float.json
Normal file
1
tests/docs/base/00_6float.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"var1": {"type": "variable", "default": 0.0, "properties": [{"type": "type", "name": "float"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["The first variable."]}, "var2": {"type": "variable", "default": 0.0, "properties": [{"type": "type", "name": "float"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["The second variable."]}, "var3": {"type": "variable", "default": 0.0, "properties": [{"type": "type", "name": "float"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var3"], "names": ["var3"], "descriptions": ["The third variable."]}, "var4": {"type": "variable", "default": 10.1, "properties": [{"type": "type", "name": "float"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var4"], "names": ["var4"], "descriptions": ["The forth variable."]}, "var5": {"type": "variable", "default": 10.1, "properties": [{"type": "type", "name": "float"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var5"], "names": ["var5"], "descriptions": ["The fifth variable."]}, "var6": {"type": "variable", "default": 10.1, "properties": [{"type": "type", "name": "float"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var6"], "names": ["var6"], "descriptions": ["The sixth variable."]}}}}
|
|
@ -24,15 +24,14 @@ var6:
|
||||||
type: float
|
type: float
|
||||||
default: 10.1
|
default: 10.1
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var1**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The first variable.<br/>**Défaut**: 0.0 |
|
|
||||||
| **rougail.var2**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The second variable.<br/>**Défaut**: 0.0 |
|
|
||||||
| **rougail.var3**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The third variable.<br/>**Défaut**: 0.0 |
|
|
||||||
| **rougail.var4**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The forth variable.<br/>**Défaut**: 10.1 |
|
|
||||||
| **rougail.var5**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The fifth variable.<br/>**Défaut**: 10.1 |
|
|
||||||
| **rougail.var6**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The sixth variable.<br/>**Défaut**: 10.1 |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The first variable.<br/>**Default**: 0.0 |
|
||||||
|
| **rougail.var2**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The second variable.<br/>**Default**: 0.0 |
|
||||||
|
| **rougail.var3**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The third variable.<br/>**Default**: 0.0 |
|
||||||
|
| **rougail.var4**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The forth variable.<br/>**Default**: 10.1 |
|
||||||
|
| **rougail.var5**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The fifth variable.<br/>**Default**: 10.1 |
|
||||||
|
| **rougail.var6**<br/>[`float`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The sixth variable.<br/>**Default**: 10.1 |
|
||||||
|
|
||||||
|
|
60
tests/docs/base/00_6float.sh
Normal file
60
tests/docs/base/00_6float.sh
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
var1: 0.0 # the first variable
|
||||||
|
var2:
|
||||||
|
description: the second variable
|
||||||
|
default: 0.0
|
||||||
|
var3:
|
||||||
|
description: the third variable
|
||||||
|
type: float
|
||||||
|
default: 0.0
|
||||||
|
var4: 10.1 # the forth variable
|
||||||
|
var5:
|
||||||
|
description: the fifth variable
|
||||||
|
default: 10.1
|
||||||
|
var6:
|
||||||
|
description: the sixth variable
|
||||||
|
type: float
|
||||||
|
default: 10.1
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var1[0m
|
||||||
|
[1;36;40mfloat[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The first variable.
|
||||||
|
[1mDefault[0m: 0.0
|
||||||
|
[1mrougail.var2[0m
|
||||||
|
[1;36;40mfloat[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The second variable.
|
||||||
|
[1mDefault[0m: 0.0
|
||||||
|
[1mrougail.var3[0m
|
||||||
|
[1;36;40mfloat[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The third variable.
|
||||||
|
[1mDefault[0m: 0.0
|
||||||
|
[1mrougail.var4[0m
|
||||||
|
[1;36;40mfloat[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The forth variable.
|
||||||
|
[1mDefault[0m: 10.1
|
||||||
|
[1mrougail.var5[0m
|
||||||
|
[1;36;40mfloat[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The fifth variable.
|
||||||
|
[1mDefault[0m: 10.1
|
||||||
|
[1mrougail.var6[0m
|
||||||
|
[1;36;40mfloat[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The sixth variable.
|
||||||
|
[1mDefault[0m: 10.1
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
var1: 0 # the first variable
|
var1: 0 # the first variable
|
||||||
var2:
|
var2:
|
||||||
|
@ -20,41 +21,46 @@ var6:
|
||||||
type: number
|
type: number
|
||||||
default: 10
|
default: 10
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="110a,110a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var1** +
|
**rougail.var1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `mandatory` |
|
||||||
The first variable. +
|
The first variable. +
|
||||||
**Défaut**: 0
|
**Default**: 0
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var2** +
|
**rougail.var2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `mandatory` |
|
||||||
The second variable. +
|
The second variable. +
|
||||||
**Défaut**: 0
|
**Default**: 0
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var3** +
|
**rougail.var3** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `mandatory` |
|
||||||
The third variable. +
|
The third variable. +
|
||||||
**Défaut**: 0
|
**Default**: 0
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var4** +
|
**rougail.var4** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `mandatory` |
|
||||||
This forth variable. +
|
This forth variable. +
|
||||||
**Défaut**: 10
|
**Default**: 10
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var5** +
|
**rougail.var5** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `mandatory` |
|
||||||
The fifth variable. +
|
The fifth variable. +
|
||||||
**Défaut**: 10
|
**Default**: 10
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var6** +
|
**rougail.var6** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `mandatory` |
|
||||||
The sixth variable. +
|
The sixth variable. +
|
||||||
**Défaut**: 10
|
**Default**: 10
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6number.json
Normal file
1
tests/docs/base/00_6number.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"var1": {"type": "variable", "default": 0, "properties": [{"type": "type", "name": "number"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["The first variable."]}, "var2": {"type": "variable", "default": 0, "properties": [{"type": "type", "name": "number"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["The second variable."]}, "var3": {"type": "variable", "default": 0, "properties": [{"type": "type", "name": "number"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var3"], "names": ["var3"], "descriptions": ["The third variable."]}, "var4": {"type": "variable", "default": 10, "properties": [{"type": "type", "name": "number"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var4"], "names": ["var4"], "descriptions": ["This forth variable."]}, "var5": {"type": "variable", "default": 10, "properties": [{"type": "type", "name": "number"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var5"], "names": ["var5"], "descriptions": ["The fifth variable."]}, "var6": {"type": "variable", "default": 10, "properties": [{"type": "type", "name": "number"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var6"], "names": ["var6"], "descriptions": ["The sixth variable."]}}}}
|
|
@ -24,15 +24,14 @@ var6:
|
||||||
type: number
|
type: number
|
||||||
default: 10
|
default: 10
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var1**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The first variable.<br/>**Défaut**: 0 |
|
|
||||||
| **rougail.var2**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The second variable.<br/>**Défaut**: 0 |
|
|
||||||
| **rougail.var3**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The third variable.<br/>**Défaut**: 0 |
|
|
||||||
| **rougail.var4**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | This forth variable.<br/>**Défaut**: 10 |
|
|
||||||
| **rougail.var5**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The fifth variable.<br/>**Défaut**: 10 |
|
|
||||||
| **rougail.var6**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The sixth variable.<br/>**Défaut**: 10 |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The first variable.<br/>**Default**: 0 |
|
||||||
|
| **rougail.var2**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The second variable.<br/>**Default**: 0 |
|
||||||
|
| **rougail.var3**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The third variable.<br/>**Default**: 0 |
|
||||||
|
| **rougail.var4**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | This forth variable.<br/>**Default**: 10 |
|
||||||
|
| **rougail.var5**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The fifth variable.<br/>**Default**: 10 |
|
||||||
|
| **rougail.var6**<br/>[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The sixth variable.<br/>**Default**: 10 |
|
||||||
|
|
||||||
|
|
60
tests/docs/base/00_6number.sh
Normal file
60
tests/docs/base/00_6number.sh
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
var1: 0 # the first variable
|
||||||
|
var2:
|
||||||
|
description: the second variable
|
||||||
|
default: 0
|
||||||
|
var3:
|
||||||
|
description: the third variable
|
||||||
|
type: number
|
||||||
|
default: 0
|
||||||
|
var4: 10 # this forth variable
|
||||||
|
var5:
|
||||||
|
description: the fifth variable
|
||||||
|
default: 10
|
||||||
|
var6:
|
||||||
|
description: the sixth variable
|
||||||
|
type: number
|
||||||
|
default: 10
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var1[0m
|
||||||
|
[1;36;40mnumber[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The first variable.
|
||||||
|
[1mDefault[0m: 0
|
||||||
|
[1mrougail.var2[0m
|
||||||
|
[1;36;40mnumber[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The second variable.
|
||||||
|
[1mDefault[0m: 0
|
||||||
|
[1mrougail.var3[0m
|
||||||
|
[1;36;40mnumber[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The third variable.
|
||||||
|
[1mDefault[0m: 0
|
||||||
|
[1mrougail.var4[0m
|
||||||
|
[1;36;40mnumber[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m This forth variable.
|
||||||
|
[1mDefault[0m: 10
|
||||||
|
[1mrougail.var5[0m
|
||||||
|
[1;36;40mnumber[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The fifth variable.
|
||||||
|
[1mDefault[0m: 10
|
||||||
|
[1mrougail.var6[0m
|
||||||
|
[1;36;40mnumber[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The sixth variable.
|
||||||
|
[1mDefault[0m: 10
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
variable1:
|
variable1:
|
||||||
description: a port variable
|
description: a port variable
|
||||||
|
@ -15,25 +16,27 @@ variable3:
|
||||||
type: port
|
type: port
|
||||||
default: 8080
|
default: 8080
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="108a,108a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.variable1** +
|
**rougail.variable1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[port]` `basic` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[port]` `basic` `mandatory` |
|
||||||
A port variable.
|
A port variable.
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.variable2** +
|
**rougail.variable2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[port]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[port]` `standard` `mandatory` |
|
||||||
A port variable with default value. +
|
A port variable with default value. +
|
||||||
**Défaut**: 8080
|
**Default**: 8080
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.variable3** +
|
**rougail.variable3** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[port]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[port]` `standard` `mandatory` |
|
||||||
A port variable with integer default value. +
|
A port variable with integer default value. +
|
||||||
**Défaut**: 8080
|
**Default**: 8080
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6port.json
Normal file
1
tests/docs/base/00_6port.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"variable1": {"type": "variable", "properties": [{"type": "type", "name": "port"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.variable1"], "names": ["variable1"], "descriptions": ["A port variable."]}, "variable2": {"type": "variable", "default": "8080", "properties": [{"type": "type", "name": "port"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.variable2"], "names": ["variable2"], "descriptions": ["A port variable with default value."]}, "variable3": {"type": "variable", "default": "8080", "properties": [{"type": "type", "name": "port"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.variable3"], "names": ["variable3"], "descriptions": ["A port variable with integer default value."]}}}}
|
|
@ -19,12 +19,11 @@ variable3:
|
||||||
type: port
|
type: port
|
||||||
default: 8080
|
default: 8080
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.variable1**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | A port variable. |
|
|
||||||
| **rougail.variable2**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | A port variable with default value.<br/>**Défaut**: 8080 |
|
|
||||||
| **rougail.variable3**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | A port variable with integer default value.<br/>**Défaut**: 8080 |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.variable1**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A port variable. |
|
||||||
|
| **rougail.variable2**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A port variable with default value.<br/>**Default**: 8080 |
|
||||||
|
| **rougail.variable3**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A port variable with integer default value.<br/>**Default**: 8080 |
|
||||||
|
|
||||||
|
|
38
tests/docs/base/00_6port.sh
Normal file
38
tests/docs/base/00_6port.sh
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
variable1:
|
||||||
|
description: a port variable
|
||||||
|
type: port
|
||||||
|
variable2:
|
||||||
|
description: a port variable with default value
|
||||||
|
type: port
|
||||||
|
default: '8080'
|
||||||
|
variable3:
|
||||||
|
description: a port variable with integer default value
|
||||||
|
type: port
|
||||||
|
default: 8080
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.variable1[0m
|
||||||
|
[1;36;40mport[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m A port variable.
|
||||||
|
[1mrougail.variable2[0m
|
||||||
|
[1;36;40mport[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m A port variable with default value.
|
||||||
|
[1mDefault[0m: 8080
|
||||||
|
[1mrougail.variable3[0m
|
||||||
|
[1;36;40mport[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m A port variable with integer default value.
|
||||||
|
[1mDefault[0m: 8080
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
var:
|
var:
|
||||||
description: a first variable
|
description: a first variable
|
||||||
|
@ -11,17 +12,21 @@ var:
|
||||||
- '#b1b1b1'
|
- '#b1b1b1'
|
||||||
- '#b2b2b2'
|
- '#b2b2b2'
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="110a,110a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var** +
|
**rougail.var** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[regexp]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[regexp]` `standard` `mandatory` |
|
||||||
A first variable. +
|
A first variable. +
|
||||||
**Défaut**: #a1a1a1 +
|
**Validator**: text based with regular expressions "^#(?:[0-9a-f]{3}){1,2}$" +
|
||||||
**Exemple**: #b1b1b1
|
**Default**: #a1a1a1 +
|
||||||
|
**Examples**:
|
||||||
|
|
||||||
|
* '#b1b1b1'
|
||||||
|
* '#b2b2b2'
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6regexp.json
Normal file
1
tests/docs/base/00_6regexp.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"var": {"type": "variable", "default": "#a1a1a1", "properties": [{"type": "type", "name": "regexp"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "validators": ["text based with regular expressions \"^#(?:[0-9a-f]{3}){1,2}$\""], "paths": ["rougail.var"], "names": ["var"], "descriptions": ["A first variable."], "examples": ["#b1b1b1", "#b2b2b2"]}}}}
|
|
@ -15,10 +15,9 @@ var:
|
||||||
- '#b1b1b1'
|
- '#b1b1b1'
|
||||||
- '#b2b2b2'
|
- '#b2b2b2'
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var**<br/>[`regexp`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | A first variable.<br/>**Défaut**: #a1a1a1<br/>**Exemple**: #b1b1b1 |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var**<br/>[`regexp`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A first variable.<br/>**Validator**: text based with regular expressions "^#(?:[0-9a-f]{3}){1,2}$"<br/>**Default**: #a1a1a1<br/>**Examples**: <br/>- #b1b1b1<br/>- #b2b2b2 |
|
||||||
|
|
||||||
|
|
34
tests/docs/base/00_6regexp.sh
Normal file
34
tests/docs/base/00_6regexp.sh
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
var:
|
||||||
|
description: a first variable
|
||||||
|
regexp: ^#(?:[0-9a-f]{3}){1,2}$
|
||||||
|
default: '#a1a1a1'
|
||||||
|
test:
|
||||||
|
- '#b1b1b1'
|
||||||
|
- '#b2b2b2'
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var[0m
|
||||||
|
[1;36;40mregexp[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m A first variable.
|
||||||
|
[1mValidator[0m: text based with regular expressions "^#(?:[0-9a-f]{3}){1,2}$"
|
||||||
|
[1mDefault[0m: #a1a1a1
|
||||||
|
[1mExamples[0m:
|
||||||
|
|
||||||
|
|
||||||
|
[1;33m • [0m#b1b1b1
|
||||||
|
[1;33m • [0m#b2b2b2
|
||||||
|
[1;33m [0m|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
var1: # the first variable
|
var1: # the first variable
|
||||||
var2:
|
var2:
|
||||||
|
@ -19,38 +20,43 @@ var6:
|
||||||
type: string
|
type: string
|
||||||
default: value
|
default: value
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="110a,110a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var1** +
|
**rougail.var1** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` |
|
||||||
The first variable.
|
The first variable.
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var2** +
|
**rougail.var2** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` |
|
||||||
The second variable.
|
The second variable.
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var3** +
|
**rougail.var3** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` |
|
||||||
The third variable.
|
The third variable.
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var4** +
|
**rougail.var4** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
|
||||||
The forth variable. +
|
The forth variable. +
|
||||||
**Défaut**: value
|
**Default**: value
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var5** +
|
**rougail.var5** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
|
||||||
The fifth variable. +
|
The fifth variable. +
|
||||||
**Défaut**: value
|
**Default**: value
|
||||||
|
|
|
|
||||||
|
|
||||||
**rougail.var6** +
|
**rougail.var6** +
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `obligatoire` |
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
|
||||||
The sixth variable. +
|
The sixth variable. +
|
||||||
**Défaut**: value
|
**Default**: value
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
1
tests/docs/base/00_6string.json
Normal file
1
tests/docs/base/00_6string.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"var1": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["The first variable."]}, "var2": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["The second variable."]}, "var3": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var3"], "names": ["var3"], "descriptions": ["The third variable."]}, "var4": {"type": "variable", "default": "value", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var4"], "names": ["var4"], "descriptions": ["The forth variable."]}, "var5": {"type": "variable", "default": "value", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var5"], "names": ["var5"], "descriptions": ["The fifth variable."]}, "var6": {"type": "variable", "default": "value", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var6"], "names": ["var6"], "descriptions": ["The sixth variable."]}}}}
|
|
@ -23,15 +23,14 @@ var6:
|
||||||
type: string
|
type: string
|
||||||
default: value
|
default: value
|
||||||
```
|
```
|
||||||
# Variables pour "rougail"
|
# Variables for "Rougail"
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | The first variable. |
|
|
||||||
| **rougail.var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | The second variable. |
|
|
||||||
| **rougail.var3**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `obligatoire` | The third variable. |
|
|
||||||
| **rougail.var4**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The forth variable.<br/>**Défaut**: value |
|
|
||||||
| **rougail.var5**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The fifth variable.<br/>**Défaut**: value |
|
|
||||||
| **rougail.var6**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `obligatoire` | The sixth variable.<br/>**Défaut**: value |
|
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The first variable. |
|
||||||
|
| **rougail.var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The second variable. |
|
||||||
|
| **rougail.var3**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The third variable. |
|
||||||
|
| **rougail.var4**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The forth variable.<br/>**Default**: value |
|
||||||
|
| **rougail.var5**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The fifth variable.<br/>**Default**: value |
|
||||||
|
| **rougail.var6**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The sixth variable.<br/>**Default**: value |
|
||||||
|
|
||||||
|
|
53
tests/docs/base/00_6string.sh
Normal file
53
tests/docs/base/00_6string.sh
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
# dictionaries/rougail/00-base.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
var1: # the first variable
|
||||||
|
var2:
|
||||||
|
description: the second variable
|
||||||
|
default:
|
||||||
|
var3:
|
||||||
|
description: the third variable
|
||||||
|
type: string
|
||||||
|
var4: value # the forth variable
|
||||||
|
var5:
|
||||||
|
description: the fifth variable
|
||||||
|
default: value
|
||||||
|
var6:
|
||||||
|
description: the sixth variable
|
||||||
|
type: string
|
||||||
|
default: value
|
||||||
|
```
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃ [1mVariables for "Rougail"[0m ┃
|
||||||
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1m [0m[1mVariable [0m[1m [0m [1m [0m[1mDescription [0m[1m [0m
|
||||||
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
[1mrougail.var1[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m The first variable.
|
||||||
|
[1mrougail.var2[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m The second variable.
|
||||||
|
[1mrougail.var3[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mbasic[0m [1;36;40mmandatory[0m The third variable.
|
||||||
|
[1mrougail.var4[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The forth variable.
|
||||||
|
[1mDefault[0m: value
|
||||||
|
[1mrougail.var5[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The fifth variable.
|
||||||
|
[1mDefault[0m: value
|
||||||
|
[1mrougail.var6[0m
|
||||||
|
[1;36;40mstring[0m [1;36;40mstandard[0m [1;36;40mmandatory[0m The sixth variable.
|
||||||
|
[1mDefault[0m: value
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[,yaml]
|
[,yaml]
|
||||||
----
|
----
|
||||||
|
---
|
||||||
version: '1.0'
|
version: '1.0'
|
||||||
var:
|
var:
|
||||||
type: choice
|
type: choice
|
||||||
|
@ -12,20 +13,20 @@ var:
|
||||||
- quote"
|
- quote"
|
||||||
- quote"'
|
- quote"'
|
||||||
----
|
----
|
||||||
== Variables pour "rougail"
|
== Variables for "Rougail"
|
||||||
|
|
||||||
[cols="110a,110a",options="header"]
|
[cols="1a,1a"]
|
||||||
|====
|
|====
|
||||||
| Variable | Description
|
| Variable | Description
|
||||||
|
|
|
|
||||||
**rougail.var** +
|
|
||||||
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` `obligatoire` |
|
|
||||||
A choice. +
|
|
||||||
**Choix**:
|
|
||||||
|
|
||||||
* quote' ← (defaut)
|
**rougail.var** +
|
||||||
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `standard` `mandatory` |
|
||||||
|
A choice. +
|
||||||
|
**Choices**:
|
||||||
|
|
||||||
|
* quote' ← (default)
|
||||||
* quote"
|
* quote"
|
||||||
* quote"'
|
* quote"'
|
||||||
|====
|
|====
|
||||||
|
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue