fix: root could be a variable
This commit is contained in:
parent
fe3c28f6d4
commit
0024c2cb2a
8 changed files with 160 additions and 5 deletions
|
|
@ -117,9 +117,13 @@ class RougailOutputDoc(Examples, Changelog):
|
||||||
self.property_to_string = get_properties_to_string()
|
self.property_to_string = get_properties_to_string()
|
||||||
self.outputs = OutPuts().get()
|
self.outputs = OutPuts().get()
|
||||||
self.dynamic_paths = {}
|
self.dynamic_paths = {}
|
||||||
config = self.config.unrestraint
|
if not self.config.isoptiondescription():
|
||||||
self.populate_dynamics(config=config)
|
informations = {}
|
||||||
informations = self.parse_families(config)
|
self.parse_variable(self.config, None, informations)
|
||||||
|
else:
|
||||||
|
config = self.config.unrestraint
|
||||||
|
self.populate_dynamics(config=config)
|
||||||
|
informations = self.parse_families(config)
|
||||||
if informations is None:
|
if informations is None:
|
||||||
informations = {}
|
informations = {}
|
||||||
elif self.config.type() not in ['config', 'metaconfig', 'groupconfig', 'mixconfig']:
|
elif self.config.type() not in ['config', 'metaconfig', 'groupconfig', 'mixconfig']:
|
||||||
|
|
@ -129,8 +133,9 @@ class RougailOutputDoc(Examples, Changelog):
|
||||||
for path in self.config.path().split('.'):
|
for path in self.config.path().split('.'):
|
||||||
family = family.option(path)
|
family = family.option(path)
|
||||||
name = family.name(uncalculated=True)
|
name = family.name(uncalculated=True)
|
||||||
infos[name] = self.get_root_family(family)
|
if family.isoptiondescription():
|
||||||
infos = infos[name]["children"]
|
infos[name] = self.get_root_family(family)
|
||||||
|
infos = infos[name]["children"]
|
||||||
infos.update(informations)
|
infos.update(informations)
|
||||||
informations = root_informations
|
informations = root_informations
|
||||||
self.informations = informations
|
self.informations = informations
|
||||||
|
|
|
||||||
22
tests/root_a_family.a_second_family.a_variable.adoc
Normal file
22
tests/root_a_family.a_second_family.a_variable.adoc
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
== First family
|
||||||
|
|
||||||
|
====
|
||||||
|
**🛈 Informations**
|
||||||
|
|
||||||
|
**Path**: a_family
|
||||||
|
====
|
||||||
|
=== A second family
|
||||||
|
|
||||||
|
====
|
||||||
|
**🛈 Informations**
|
||||||
|
|
||||||
|
**Path**: a_family.a_second_family
|
||||||
|
====
|
||||||
|
[cols="1a,1a"]
|
||||||
|
|====
|
||||||
|
| Variable | Description
|
||||||
|
| **a_family.a_second_family.a_variable** +
|
||||||
|
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `mandatory` | A boolean variable. +
|
||||||
|
**Default**: true
|
||||||
|
|====
|
||||||
|
|
||||||
18
tests/root_a_family.a_second_family.a_variable.gitlab.md
Normal file
18
tests/root_a_family.a_second_family.a_variable.gitlab.md
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<details><summary>First family</summary>
|
||||||
|
|
||||||
|
> [!note] 🛈 Informations
|
||||||
|
> **Path**: a_family
|
||||||
|
|
||||||
|
<details><summary>A second family</summary>
|
||||||
|
|
||||||
|
> [!note] 🛈 Informations
|
||||||
|
> **Path**: a_family.a_second_family
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
|
||||||
|
| **<a id="a_family.a_second_family.a_variable" name="a_family.a_second_family.a_variable">a_family.a_second_family.a_variable</a>**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | A boolean variable.<br/>**Default**: true |
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
17
tests/root_a_family.a_second_family.a_variable.html
Normal file
17
tests/root_a_family.a_second_family.a_variable.html
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<h1>First family</h1>
|
||||||
|
|
||||||
|
<b>Path</b>: a_family
|
||||||
|
|
||||||
|
<h2>A second family</h2>
|
||||||
|
|
||||||
|
<b>Path</b>: a_family.a_second_family
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr><th>Variable </th><th>Description </th></tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td><b>a_family.a_second_family.a_variable</b><br/><mark><a href='https://rougail.readthedocs.io/en/latest/variable.html#variables-types'>boolean</a></mark> <mark>mandatory</mark></td><td>A boolean variable.<br/><b>Default</b>: true</td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
53
tests/root_a_family.a_second_family.a_variable.json
Normal file
53
tests/root_a_family.a_second_family.a_variable.json
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
{
|
||||||
|
"a_family": {
|
||||||
|
"type": "family",
|
||||||
|
"informations": {
|
||||||
|
"path": "a_family",
|
||||||
|
"names": [
|
||||||
|
"a_family"
|
||||||
|
],
|
||||||
|
"description": "First family",
|
||||||
|
"properties": []
|
||||||
|
},
|
||||||
|
"children": {
|
||||||
|
"a_second_family": {
|
||||||
|
"type": "family",
|
||||||
|
"informations": {
|
||||||
|
"path": "a_family.a_second_family",
|
||||||
|
"names": [
|
||||||
|
"a_second_family"
|
||||||
|
],
|
||||||
|
"description": "A second family",
|
||||||
|
"properties": []
|
||||||
|
},
|
||||||
|
"children": {
|
||||||
|
"a_variable": {
|
||||||
|
"type": "variable",
|
||||||
|
"default": {
|
||||||
|
"name": "Default",
|
||||||
|
"values": true
|
||||||
|
},
|
||||||
|
"variable_type": "boolean",
|
||||||
|
"path": "a_family.a_second_family.a_variable",
|
||||||
|
"names": [
|
||||||
|
"a_variable"
|
||||||
|
],
|
||||||
|
"description": "A boolean variable.",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"type": "property",
|
||||||
|
"name": "mandatory",
|
||||||
|
"ori_name": "mandatory",
|
||||||
|
"access_control": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"gen_examples": [
|
||||||
|
true
|
||||||
|
],
|
||||||
|
"mandatory_without_value": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16
tests/root_a_family.a_second_family.a_variable.md
Normal file
16
tests/root_a_family.a_second_family.a_variable.md
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
# First family
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
>
|
||||||
|
> **Path**: a_family
|
||||||
|
|
||||||
|
## A second family
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
>
|
||||||
|
> **Path**: a_family.a_second_family
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
|
||||||
|
| **<a id="a_family.a_second_family.a_variable" name="a_family.a_second_family.a_variable">a_family.a_second_family.a_variable</a>**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | A boolean variable.<br/>**Default**: true |
|
||||||
|
|
||||||
20
tests/root_a_family.a_second_family.a_variable.sh
Normal file
20
tests/root_a_family.a_second_family.a_variable.sh
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
[1;4;96mFirst family[0m
|
||||||
|
|
||||||
|
[34m▌ [0m[1;34m🛈 Informations[0m
|
||||||
|
[34m▌ [0m
|
||||||
|
[34m▌ [0m[1mPath[0m: a_family
|
||||||
|
|
||||||
|
[1;4;92mA second family[0m
|
||||||
|
|
||||||
|
[34m▌ [0m[1;34m🛈 Informations[0m
|
||||||
|
[34m▌ [0m
|
||||||
|
[34m▌ [0m[1mPath[0m: a_family.a_second_family
|
||||||
|
|
||||||
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
|
┃[1m [0m[1mVariable [0m[1m [0m┃[1m [0m[1mDescription [0m[1m [0m┃
|
||||||
|
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
|
||||||
|
│ [1ma_family.a_second_family.a_variable[0m │ A boolean variable. │
|
||||||
|
│ [1;7m boolean [0m [1;7m mandatory [0m │ [1mDefault[0m: true │
|
||||||
|
└───────────────────────────────────────┴──────────────────────────────────────┘
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -50,6 +50,10 @@ def test_root_sub():
|
||||||
_test_root('a_family.an_other_family')
|
_test_root('a_family.an_other_family')
|
||||||
|
|
||||||
|
|
||||||
|
def test_root_variable():
|
||||||
|
_test_root('a_family.a_second_family.a_variable')
|
||||||
|
|
||||||
|
|
||||||
def test_root_changelog():
|
def test_root_changelog():
|
||||||
_test_root('a_family', "changelog")
|
_test_root('a_family', "changelog")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue