fix: doc default value with undocumented variable
This commit is contained in:
parent
2886cf0348
commit
b60792314e
18 changed files with 309 additions and 4 deletions
|
|
@ -670,7 +670,13 @@ class RougailOutputDoc(Examples):
|
||||||
# true_msg = _("depends on an undocumented variable")
|
# true_msg = _("depends on an undocumented variable")
|
||||||
else:
|
else:
|
||||||
if uncalculated and not isinstance(uncalculated, Calculation):
|
if uncalculated and not isinstance(uncalculated, Calculation):
|
||||||
true_msg = _('{0} (from an undocumented variable)').format(uncalculated)
|
if isinstance(uncalculated, list):
|
||||||
|
uncalculated = self.formater.list(uncalculated)
|
||||||
|
true_msg = _('(from an undocumented variable){0}').format(uncalculated)
|
||||||
|
else:
|
||||||
|
if not isinstance(uncalculated, str):
|
||||||
|
uncalculated = dump(uncalculated)
|
||||||
|
true_msg = _('{0} (from an undocumented variable)').format(uncalculated)
|
||||||
else:
|
else:
|
||||||
true_msg = _("depends on an undocumented variable")
|
true_msg = _("depends on an undocumented variable")
|
||||||
if true_msg:
|
if true_msg:
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ class Formater(CommonFormater):
|
||||||
def list(
|
def list(
|
||||||
self,
|
self,
|
||||||
choices,
|
choices,
|
||||||
):
|
) -> str:
|
||||||
"""Display a liste of element"""
|
"""Display a liste of element"""
|
||||||
char = f"{self.enter_table}- "
|
char = f"{self.enter_table}- "
|
||||||
ret = ""
|
ret = ""
|
||||||
|
|
|
||||||
|
|
@ -41,3 +41,6 @@ class Formater:
|
||||||
|
|
||||||
def to_phrase(self, text: str) -> str:
|
def to_phrase(self, text: str) -> str:
|
||||||
return to_phrase(text)
|
return to_phrase(text)
|
||||||
|
|
||||||
|
def list(self, lst: list) -> list:
|
||||||
|
return lst
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
== Variables for "Rougail"
|
||||||
|
|
||||||
|
[cols="1a,1a"]
|
||||||
|
|====
|
||||||
|
| Variable | Description
|
||||||
|
|
|
||||||
|
|
||||||
|
**rougail.var1** +
|
||||||
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `unique` `multiple` |
|
||||||
|
A suffix variable. +
|
||||||
|
**Default**:
|
||||||
|
|
||||||
|
* val1
|
||||||
|
* val2
|
||||||
|
|
|
||||||
|
|
||||||
|
**rougail.var2** +
|
||||||
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `mandatory` |
|
||||||
|
A variable calculated. +
|
||||||
|
**Default**: true (from an undocumented variable).
|
||||||
|
|====
|
||||||
|
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
{
|
||||||
|
"rougail": {
|
||||||
|
"type": "namespace",
|
||||||
|
"informations": {
|
||||||
|
"paths": [
|
||||||
|
"rougail"
|
||||||
|
],
|
||||||
|
"names": [
|
||||||
|
"rougail"
|
||||||
|
],
|
||||||
|
"description": "Rougail",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"type": "mode",
|
||||||
|
"name": "standard"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"children": {
|
||||||
|
"rougail.var1": {
|
||||||
|
"type": "variable",
|
||||||
|
"default": [
|
||||||
|
"val1",
|
||||||
|
"val2"
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"type": "type",
|
||||||
|
"name": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "mode",
|
||||||
|
"name": "standard"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "property",
|
||||||
|
"name": "unique"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "multiple",
|
||||||
|
"name": "multiple"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paths": [
|
||||||
|
"rougail.var1"
|
||||||
|
],
|
||||||
|
"names": [
|
||||||
|
"var1"
|
||||||
|
],
|
||||||
|
"descriptions": [
|
||||||
|
"A suffix variable."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rougail.var2": {
|
||||||
|
"type": "variable",
|
||||||
|
"default": "true (from an undocumented variable).",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"type": "type",
|
||||||
|
"name": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "mode",
|
||||||
|
"name": "standard"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "property",
|
||||||
|
"name": "mandatory"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paths": [
|
||||||
|
"rougail.var2"
|
||||||
|
],
|
||||||
|
"names": [
|
||||||
|
"var2"
|
||||||
|
],
|
||||||
|
"descriptions": [
|
||||||
|
"A variable calculated."
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Variables for "Rougail"
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | A suffix variable.<br/>**Default**: <br/>- val1<br/>- val2 |
|
||||||
|
| **rougail.var2**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable calculated.<br/>**Default**: true (from an undocumented variable). |
|
||||||
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
|
||||||
|
|
||||||
|
[1;4;96mVariables for [0m[1;4;96m"Rougail"[0m
|
||||||
|
|
||||||
|
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃[1m [0m[1mVariable [0m[1m [0m┃[1m [0m[1mDescription [0m[1m [0m┃
|
||||||
|
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
|
||||||
|
│ [1mrougail.var1[0m │ A suffix variable. │
|
||||||
|
│ [1;7m string [0m [1;7m standard [0m [1;7m unique [0m [1;7m [0m │ [1mDefault[0m: │
|
||||||
|
│ [1;7mmultiple [0m │ - val1 │
|
||||||
|
│ │ - val2 │
|
||||||
|
├───────────────────────────────────────┼──────────────────────────────────────┤
|
||||||
|
│ [1mrougail.var2[0m │ A variable calculated. │
|
||||||
|
│ [1;7m boolean [0m [1;7m standard [0m [1;7m mandatory [0m │ [1mDefault[0m: true (from an undocumented │
|
||||||
|
│ │ variable). │
|
||||||
|
└───────────────────────────────────────┴──────────────────────────────────────┘
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
== Variables for "Rougail"
|
||||||
|
|
||||||
|
[cols="1a,1a"]
|
||||||
|
|====
|
||||||
|
| Variable | Description
|
||||||
|
|
|
||||||
|
|
||||||
|
**rougail.var1** +
|
||||||
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `unique` `multiple` |
|
||||||
|
A suffix variable. +
|
||||||
|
**Default**:
|
||||||
|
|
||||||
|
* val1
|
||||||
|
* val2
|
||||||
|
|
|
||||||
|
|
||||||
|
**rougail.var2** +
|
||||||
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `unique` `multiple` |
|
||||||
|
A variable calculated. +
|
||||||
|
**Default**: (from an undocumented variable)
|
||||||
|
|
||||||
|
* a value
|
||||||
|
* a second value.
|
||||||
|
|====
|
||||||
|
|
||||||
|
|
@ -0,0 +1,91 @@
|
||||||
|
{
|
||||||
|
"rougail": {
|
||||||
|
"type": "namespace",
|
||||||
|
"informations": {
|
||||||
|
"paths": [
|
||||||
|
"rougail"
|
||||||
|
],
|
||||||
|
"names": [
|
||||||
|
"rougail"
|
||||||
|
],
|
||||||
|
"description": "Rougail",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"type": "mode",
|
||||||
|
"name": "standard"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"children": {
|
||||||
|
"rougail.var1": {
|
||||||
|
"type": "variable",
|
||||||
|
"default": [
|
||||||
|
"val1",
|
||||||
|
"val2"
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"type": "type",
|
||||||
|
"name": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "mode",
|
||||||
|
"name": "standard"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "property",
|
||||||
|
"name": "unique"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "multiple",
|
||||||
|
"name": "multiple"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paths": [
|
||||||
|
"rougail.var1"
|
||||||
|
],
|
||||||
|
"names": [
|
||||||
|
"var1"
|
||||||
|
],
|
||||||
|
"descriptions": [
|
||||||
|
"A suffix variable."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rougail.var2": {
|
||||||
|
"type": "variable",
|
||||||
|
"default": "(from an undocumented variable)['a value', 'a second value'].",
|
||||||
|
"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 variable calculated."
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Variables for "Rougail"
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **rougail.var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | A suffix variable.<br/>**Default**: <br/>- val1<br/>- val2 |
|
||||||
|
| **rougail.var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | A variable calculated.<br/>**Default**: (from an undocumented variable)<br/>- a value<br/>- a second value. |
|
||||||
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
|
||||||
|
|
||||||
|
[1;4;96mVariables for [0m[1;4;96m"Rougail"[0m
|
||||||
|
|
||||||
|
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃[1m [0m[1mVariable [0m[1m [0m┃[1m [0m[1mDescription [0m[1m [0m┃
|
||||||
|
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
|
||||||
|
│ [1mrougail.var1[0m │ A suffix variable. │
|
||||||
|
│ [1;7m string [0m [1;7m standard [0m [1;7m unique [0m [1;7m [0m │ [1mDefault[0m: │
|
||||||
|
│ [1;7mmultiple [0m │ - val1 │
|
||||||
|
│ │ - val2 │
|
||||||
|
├───────────────────────────────────────┼──────────────────────────────────────┤
|
||||||
|
│ [1mrougail.var2[0m │ A variable calculated. │
|
||||||
|
│ [1;7m string [0m [1;7m standard [0m [1;7m mandatory [0m [1;7m [0m │ [1mDefault[0m: (from an undocumented │
|
||||||
|
│ [1;7munique [0m [1;7m multiple [0m │ variable) │
|
||||||
|
│ │ - a value │
|
||||||
|
│ │ - a second value. │
|
||||||
|
└───────────────────────────────────────┴──────────────────────────────────────┘
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
[]
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
[]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
# Example with all variables modifiable
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
rougail:
|
||||||
|
var1:
|
||||||
|
- val1
|
||||||
|
- val2
|
||||||
|
var2: true
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
# Example with all variables modifiable
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
rougail:
|
||||||
|
var1:
|
||||||
|
- val1
|
||||||
|
- val2
|
||||||
|
var2:
|
||||||
|
- a value
|
||||||
|
- a second value
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
[]
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
[]
|
||||||
|
|
@ -20,8 +20,7 @@ excludes = [
|
||||||
]
|
]
|
||||||
|
|
||||||
test_ok = get_structures_list(excludes)
|
test_ok = get_structures_list(excludes)
|
||||||
# test_ok = [Path('../rougail-tests/structures/04_5validators')]
|
# test_ok = [HERE.parent.parent / "rougail-tests" / "structures" / "60_5family_dynamic_calc_suffix_hidden"]
|
||||||
|
|
||||||
|
|
||||||
os.environ['COLUMNS'] = '80'
|
os.environ['COLUMNS'] = '80'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue