fix: doc default value with undocumented variable

This commit is contained in:
egarette@silique.fr 2025-05-05 10:03:44 +02:00
parent 2886cf0348
commit b60792314e
18 changed files with 309 additions and 4 deletions

View file

@ -670,7 +670,13 @@ class RougailOutputDoc(Examples):
# true_msg = _("depends on an undocumented variable")
else:
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:
true_msg = _("depends on an undocumented variable")
if true_msg:

View file

@ -93,7 +93,7 @@ class Formater(CommonFormater):
def list(
self,
choices,
):
) -> str:
"""Display a liste of element"""
char = f"{self.enter_table}- "
ret = ""

View file

@ -41,3 +41,6 @@ class Formater:
def to_phrase(self, text: str) -> str:
return to_phrase(text)
def list(self, lst: list) -> list:
return lst

View file

@ -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).
|====

View file

@ -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."
]
}
}
}
}

View file

@ -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). |

View file

@ -0,0 +1,17 @@
Variables for "Rougail"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
 Variable  ┃ Description  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
rougail.var1 │ A suffix variable. │
 string   standard   unique    │ Default: │
multiple  │ - val1 │
│ │ - val2 │
├───────────────────────────────────────┼──────────────────────────────────────┤
rougail.var2 │ A variable calculated. │
 boolean   standard   mandatory  │ Default: true (from an undocumented │
│ │ variable). │
└───────────────────────────────────────┴──────────────────────────────────────┘

View file

@ -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.
|====

View file

@ -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."
]
}
}
}
}

View file

@ -0,0 +1,7 @@
# Variables for "Rougail"
| Variable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **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. |

View file

@ -0,0 +1,19 @@
Variables for "Rougail"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
 Variable  ┃ Description  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
rougail.var1 │ A suffix variable. │
 string   standard   unique    │ Default: │
multiple  │ - val1 │
│ │ - val2 │
├───────────────────────────────────────┼──────────────────────────────────────┤
rougail.var2 │ A variable calculated. │
 string   standard   mandatory    │ Default: (from an undocumented │
unique   multiple  │ variable)
│ │ - a value │
│ │ - a second value. │
└───────────────────────────────────────┴──────────────────────────────────────┘

View file

@ -0,0 +1,10 @@
# Example with all variables modifiable
```yaml
---
rougail:
var1:
- val1
- val2
var2: true
```

View file

@ -0,0 +1,12 @@
# Example with all variables modifiable
```yaml
---
rougail:
var1:
- val1
- val2
var2:
- a value
- a second value
```

View file

@ -20,8 +20,7 @@ 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'