From 96866e99a4fa9b9273905d3a21de812cdda6badd Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 2 May 2025 21:57:31 +0200 Subject: [PATCH] fix: better documentation variable with variable in default attribut --- src/rougail/output_doc/doc.py | 34 +++- tests/mode_basic.adoc | 2 +- tests/mode_basic_advanced.adoc | 2 +- ...2default_calculated_params_permissive.adoc | 11 ++ ...2default_calculated_params_permissive.json | 29 ++++ ...0_2default_calculated_params_permissive.md | 4 + ...0_2default_calculated_params_permissive.sh | 6 + tests/results/test/04_5validators_multi3.adoc | 18 +++ ...abled2.json => 04_5validators_multi3.json} | 45 ++---- tests/results/test/04_5validators_multi3.md | 4 + tests/results/test/04_5validators_multi3.sh | 12 ++ ...eadership_follower_multi_no_mandatory.adoc | 27 ++++ ...eadership_follower_multi_no_mandatory.json | 118 ++++++++++++++ ...6leadership_follower_multi_no_mandatory.md | 12 ++ ...6leadership_follower_multi_no_mandatory.sh | 26 +++ .../60_0family_dynamic_forbidden_char.adoc | 8 +- .../60_0family_dynamic_forbidden_char.json | 12 +- .../test/60_0family_dynamic_forbidden_char.md | 4 +- .../test/60_0family_dynamic_forbidden_char.sh | 8 +- .../test/60_0family_dynamic_upper_char.adoc | 4 +- .../test/60_0family_dynamic_upper_char.json | 8 +- .../test/60_0family_dynamic_upper_char.md | 2 +- .../test/60_0family_dynamic_upper_char.sh | 4 +- ...0_2default_calculated_params_permissive.md | 6 + .../test_examples/04_5validators_multi3.md | 7 + ...6leadership_follower_multi_no_mandatory.md | 11 ++ ...0_5family_dynamic_calc_suffix_disabled2.md | 15 -- ...2default_calculated_params_permissive.adoc | 13 ++ ...2default_calculated_params_permissive.json | 49 ++++++ ...0_2default_calculated_params_permissive.md | 6 + ...0_2default_calculated_params_permissive.sh | 11 ++ .../test_namespace/04_5validators_multi3.adoc | 20 +++ .../test_namespace/04_5validators_multi3.json | 67 ++++++++ .../test_namespace/04_5validators_multi3.md | 6 + .../test_namespace/04_5validators_multi3.sh | 17 ++ ...eadership_follower_multi_no_mandatory.adoc | 29 ++++ ...eadership_follower_multi_no_mandatory.json | 138 ++++++++++++++++ ...6leadership_follower_multi_no_mandatory.md | 14 ++ ...6leadership_follower_multi_no_mandatory.sh | 31 ++++ .../60_0family_dynamic_forbidden_char.adoc | 8 +- .../60_0family_dynamic_forbidden_char.json | 12 +- .../60_0family_dynamic_forbidden_char.md | 4 +- .../60_0family_dynamic_forbidden_char.sh | 8 +- .../60_0family_dynamic_upper_char.adoc | 4 +- .../60_0family_dynamic_upper_char.json | 8 +- .../60_0family_dynamic_upper_char.md | 2 +- .../60_0family_dynamic_upper_char.sh | 4 +- ...5family_dynamic_calc_suffix_disabled2.adoc | 3 +- ...5family_dynamic_calc_suffix_disabled2.json | 1 - ...0_5family_dynamic_calc_suffix_disabled2.md | 2 +- ...0_5family_dynamic_calc_suffix_disabled2.sh | 3 +- ...0_5family_dynamic_calc_suffix_hidden.adoc} | 9 +- ...60_5family_dynamic_calc_suffix_hidden.json | 83 ++++++++++ .../60_5family_dynamic_calc_suffix_hidden.md} | 6 +- .../60_5family_dynamic_calc_suffix_hidden.sh} | 12 +- .../60_6family_dynamic_sub_dynamic_1_0_2.adoc | 45 ++++++ .../60_6family_dynamic_sub_dynamic_1_0_2.json | 148 ++++++++++++++++++ .../60_6family_dynamic_sub_dynamic_1_0_2.md | 26 +++ .../60_6family_dynamic_sub_dynamic_1_0_2.sh | 50 ++++++ ...0_2default_calculated_params_permissive.md | 7 + .../04_5validators_multi3.md | 8 + ...6leadership_follower_multi_no_mandatory.md | 12 ++ .../60_5family_dynamic_calc_suffix_hidden.md | 10 ++ .../60_6family_dynamic_sub_dynamic_1_0_2.md | 35 +++++ tests/test_load.py | 2 +- tests/test_mode.py | 1 + 66 files changed, 1236 insertions(+), 117 deletions(-) create mode 100644 tests/results/test/00_2default_calculated_params_permissive.adoc create mode 100644 tests/results/test/00_2default_calculated_params_permissive.json create mode 100644 tests/results/test/00_2default_calculated_params_permissive.md create mode 100644 tests/results/test/00_2default_calculated_params_permissive.sh create mode 100644 tests/results/test/04_5validators_multi3.adoc rename tests/results/test/{60_5family_dynamic_calc_suffix_disabled2.json => 04_5validators_multi3.json} (57%) create mode 100644 tests/results/test/04_5validators_multi3.md create mode 100644 tests/results/test/04_5validators_multi3.sh create mode 100644 tests/results/test/40_6leadership_follower_multi_no_mandatory.adoc create mode 100644 tests/results/test/40_6leadership_follower_multi_no_mandatory.json create mode 100644 tests/results/test/40_6leadership_follower_multi_no_mandatory.md create mode 100644 tests/results/test/40_6leadership_follower_multi_no_mandatory.sh create mode 100644 tests/results/test_examples/00_2default_calculated_params_permissive.md create mode 100644 tests/results/test_examples/04_5validators_multi3.md create mode 100644 tests/results/test_examples/40_6leadership_follower_multi_no_mandatory.md delete mode 100644 tests/results/test_examples/60_5family_dynamic_calc_suffix_disabled2.md create mode 100644 tests/results/test_namespace/00_2default_calculated_params_permissive.adoc create mode 100644 tests/results/test_namespace/00_2default_calculated_params_permissive.json create mode 100644 tests/results/test_namespace/00_2default_calculated_params_permissive.md create mode 100644 tests/results/test_namespace/00_2default_calculated_params_permissive.sh create mode 100644 tests/results/test_namespace/04_5validators_multi3.adoc create mode 100644 tests/results/test_namespace/04_5validators_multi3.json create mode 100644 tests/results/test_namespace/04_5validators_multi3.md create mode 100644 tests/results/test_namespace/04_5validators_multi3.sh create mode 100644 tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.adoc create mode 100644 tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.json create mode 100644 tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.md create mode 100644 tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.sh rename tests/results/{test/60_5family_dynamic_calc_suffix_disabled2.adoc => test_namespace/60_5family_dynamic_calc_suffix_hidden.adoc} (70%) create mode 100644 tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.json rename tests/results/{test/60_5family_dynamic_calc_suffix_disabled2.md => test_namespace/60_5family_dynamic_calc_suffix_hidden.md} (90%) rename tests/results/{test/60_5family_dynamic_calc_suffix_disabled2.sh => test_namespace/60_5family_dynamic_calc_suffix_hidden.sh} (82%) create mode 100644 tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.adoc create mode 100644 tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.json create mode 100644 tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.md create mode 100644 tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.sh create mode 100644 tests/results/test_namespace_examples/00_2default_calculated_params_permissive.md create mode 100644 tests/results/test_namespace_examples/04_5validators_multi3.md create mode 100644 tests/results/test_namespace_examples/40_6leadership_follower_multi_no_mandatory.md create mode 100644 tests/results/test_namespace_examples/60_5family_dynamic_calc_suffix_hidden.md create mode 100644 tests/results/test_namespace_examples/60_6family_dynamic_sub_dynamic_1_0_2.md diff --git a/src/rougail/output_doc/doc.py b/src/rougail/output_doc/doc.py index 9a17324a8..ab01920f5 100644 --- a/src/rougail/output_doc/doc.py +++ b/src/rougail/output_doc/doc.py @@ -22,9 +22,10 @@ from itertools import chain from re import compile from tiramisu import Calculation, undefined, groups -from tiramisu.error import ConfigError, display_list +from tiramisu.error import ConfigError, display_list, PropertiesOptionError from rougail.error import display_xmlfiles from rougail.object_model import PROPERTY_ATTRIBUTE +from rougail.utils import normalize_family from .config import OutPuts from .i18n import _ @@ -282,6 +283,7 @@ class RougailOutputDoc(Examples): def _dyn_path_to_italic(self, dico, child, path: str) -> str: display_path = path for identifier in child.identifiers(): + identifier = normalize_family(str(identifier)) display_path = display_path.replace( "{{ identifier }}", self.formater.italic(identifier), 1 ) @@ -534,7 +536,9 @@ class RougailOutputDoc(Examples): default = None return default if variable.information.get("default_value_makes_sense", True): - default = variable.value.get(uncalculated=True) + default_ = variable.value.get(uncalculated=True) + if not isinstance(default_, Calculation): + default = default_ if default == []: default = None return default @@ -587,7 +591,6 @@ class RougailOutputDoc(Examples): try: variable.value.get() except AttributeError as err: - pass variable = None else: uncalculated = variable.value.get(uncalculated=True) @@ -610,7 +613,7 @@ class RougailOutputDoc(Examples): return None else: try: - self.conf.option(path).get() + self.conf.forcepermissive.option(path).get() except AttributeError: return None true_msg = _('the value of the variable "{0}"') @@ -647,7 +650,28 @@ class RougailOutputDoc(Examples): if all_is_undocumented and len(values) > 1: values = _("the values of undocumented variables") else: - values = true_msg.format(calculation["ori_path"]) + variable_path = calculation["ori_path"] + variable = self.conf.forcepermissive.option(variable_path) + try: + isfollower = variable.isfollower() + except AttributeError as err: + pass + else: + if not isfollower and self._is_inaccessible_user_data(variable): + try: + uncalculated = variable.value.get(uncalculated=True) + except PropertiesOptionError: + true_msg = None +# true_msg = _("depends on an undocumented variable") + else: + if uncalculated and not isinstance(uncalculated, Calculation): + true_msg = _('{0} (from an uncalculated variable)').format(uncalculated) + else: + true_msg = _("depends on an undocumented variable") + if true_msg: + values = true_msg.format(calculation["ori_path"]) + else: + values = None elif calculation["type"] == "identifier": if prop in PROPERTY_ATTRIBUTE: values = calculation["value"] diff --git a/tests/mode_basic.adoc b/tests/mode_basic.adoc index 462096e2b..ec0b92116 100644 --- a/tests/mode_basic.adoc +++ b/tests/mode_basic.adoc @@ -6,7 +6,7 @@ **var2** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | My var2. + -**Default**: the value of the variable "var1". +**Default**: depends on an undocumented variable. | **var3** + diff --git a/tests/mode_basic_advanced.adoc b/tests/mode_basic_advanced.adoc index d1c151398..2fc657c00 100644 --- a/tests/mode_basic_advanced.adoc +++ b/tests/mode_basic_advanced.adoc @@ -6,6 +6,6 @@ **var2** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | My var2. + -**Default**: the value of the variable "var1". +**Default**: depends on an undocumented variable. |==== diff --git a/tests/results/test/00_2default_calculated_params_permissive.adoc b/tests/results/test/00_2default_calculated_params_permissive.adoc new file mode 100644 index 000000000..1222dc438 --- /dev/null +++ b/tests/results/test/00_2default_calculated_params_permissive.adoc @@ -0,0 +1,11 @@ +[cols="1a,1a"] +|==== +| Variable | Description +| + +**var2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +A second variable. + +**Default**: depends on a calculation. +|==== + diff --git a/tests/results/test/00_2default_calculated_params_permissive.json b/tests/results/test/00_2default_calculated_params_permissive.json new file mode 100644 index 000000000..e4800f361 --- /dev/null +++ b/tests/results/test/00_2default_calculated_params_permissive.json @@ -0,0 +1,29 @@ +{ + "var2": { + "type": "variable", + "default": "depends on a calculation.", + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "mandatory" + } + ], + "paths": [ + "var2" + ], + "names": [ + "var2" + ], + "descriptions": [ + "A second variable." + ] + } +} \ No newline at end of file diff --git a/tests/results/test/00_2default_calculated_params_permissive.md b/tests/results/test/00_2default_calculated_params_permissive.md new file mode 100644 index 000000000..99cc64364 --- /dev/null +++ b/tests/results/test/00_2default_calculated_params_permissive.md @@ -0,0 +1,4 @@ +| Variable                                                                                                   | Description                                                                                                | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A second variable.
**Default**: depends on a calculation. | + diff --git a/tests/results/test/00_2default_calculated_params_permissive.sh b/tests/results/test/00_2default_calculated_params_permissive.sh new file mode 100644 index 000000000..6024fc48b --- /dev/null +++ b/tests/results/test/00_2default_calculated_params_permissive.sh @@ -0,0 +1,6 @@ +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variable  ┃ Description  ┃ +┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ +│ var2 │ A second variable. │ +│  string   standard   mandatory  │ Default: depends on a calculation. │ +└───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test/04_5validators_multi3.adoc b/tests/results/test/04_5validators_multi3.adoc new file mode 100644 index 000000000..86af06237 --- /dev/null +++ b/tests/results/test/04_5validators_multi3.adoc @@ -0,0 +1,18 @@ +[cols="1a,1a"] +|==== +| Variable | Description +| + +**var1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `mandatory` `unique` `multiple` | +A second variable. + +**Validator**: value must be equal to index. + +**Default**: + +* 0 +* 1 +* 2 + +**Example**: 0 +|==== + diff --git a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.json b/tests/results/test/04_5validators_multi3.json similarity index 57% rename from tests/results/test/60_5family_dynamic_calc_suffix_disabled2.json rename to tests/results/test/04_5validators_multi3.json index c16e97411..93c507445 100644 --- a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.json +++ b/tests/results/test/04_5validators_multi3.json @@ -1,15 +1,24 @@ { "var1": { "type": "variable", + "default": [ + 0, + 1, + 2 + ], "properties": [ { "type": "type", - "name": "string" + "name": "number" }, { "type": "mode", "name": "standard" }, + { + "type": "property", + "name": "mandatory" + }, { "type": "property", "name": "unique" @@ -19,6 +28,9 @@ "name": "multiple" } ], + "validators": [ + "value must be equal to index." + ], "paths": [ "var1" ], @@ -26,37 +38,10 @@ "var1" ], "descriptions": [ - "A suffix variable." + "A second variable." ], "examples": [ - "val1", - "val2" - ] - }, - "var2": { - "type": "variable", - "properties": [ - { - "type": "type", - "name": "string" - }, - { - "type": "mode", - "name": "standard" - }, - { - "type": "property", - "name": "mandatory" - } - ], - "paths": [ - "var2" - ], - "names": [ - "var2" - ], - "descriptions": [ - "A variable calculated." + 0 ] } } \ No newline at end of file diff --git a/tests/results/test/04_5validators_multi3.md b/tests/results/test/04_5validators_multi3.md new file mode 100644 index 000000000..cdc89b814 --- /dev/null +++ b/tests/results/test/04_5validators_multi3.md @@ -0,0 +1,4 @@ +| Variable                                                                                                                       | Description                                                                                                                    | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **var1**
[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | A second variable.
**Validator**: value must be equal to index.
**Default**:
- 0
- 1
- 2
**Example**: 0 | + diff --git a/tests/results/test/04_5validators_multi3.sh b/tests/results/test/04_5validators_multi3.sh new file mode 100644 index 000000000..4b3ff9a70 --- /dev/null +++ b/tests/results/test/04_5validators_multi3.sh @@ -0,0 +1,12 @@ +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variable  ┃ Description  ┃ +┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ +│ var1 │ A second variable. │ +│  number   standard   mandatory    │ Validator: value must be equal to │ +│ unique   multiple  │ index. │ +│ │ Default: │ +│ │ - 0 │ +│ │ - 1 │ +│ │ - 2 │ +│ │ Example: 0 │ +└───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test/40_6leadership_follower_multi_no_mandatory.adoc b/tests/results/test/40_6leadership_follower_multi_no_mandatory.adoc new file mode 100644 index 000000000..bf2c978c3 --- /dev/null +++ b/tests/results/test/40_6leadership_follower_multi_no_mandatory.adoc @@ -0,0 +1,27 @@ +== A leadership + +`basic` + +This family contains lists of variable blocks. + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**leadership.leader** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `unique` `multiple` | +The leader. +| + +**leadership.follower1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `multiple` | +The first follower. +| + +**leadership.follower2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `multiple` | +The second follower. + +**Default**: value +|==== + diff --git a/tests/results/test/40_6leadership_follower_multi_no_mandatory.json b/tests/results/test/40_6leadership_follower_multi_no_mandatory.json new file mode 100644 index 000000000..651440c45 --- /dev/null +++ b/tests/results/test/40_6leadership_follower_multi_no_mandatory.json @@ -0,0 +1,118 @@ +{ + "leadership": { + "type": "leadership", + "informations": { + "paths": [ + "leadership" + ], + "names": [ + "leadership" + ], + "description": "A leadership", + "properties": [ + { + "type": "mode", + "name": "basic" + } + ], + "help": [ + "This family contains lists of variable blocks." + ] + }, + "children": { + "leadership.leader": { + "type": "variable", + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "unique" + }, + { + "type": "multiple", + "name": "multiple" + } + ], + "paths": [ + "leadership.leader" + ], + "names": [ + "leader" + ], + "descriptions": [ + "The leader." + ] + }, + "leadership.follower1": { + "type": "variable", + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "basic" + }, + { + "type": "property", + "name": "mandatory" + }, + { + "type": "multiple", + "name": "multiple" + } + ], + "paths": [ + "leadership.follower1" + ], + "names": [ + "follower1" + ], + "descriptions": [ + "The first follower." + ] + }, + "leadership.follower2": { + "type": "variable", + "default": [ + "value" + ], + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "mandatory" + }, + { + "type": "multiple", + "name": "multiple" + } + ], + "paths": [ + "leadership.follower2" + ], + "names": [ + "follower2" + ], + "descriptions": [ + "The second follower." + ] + } + } + } +} \ No newline at end of file diff --git a/tests/results/test/40_6leadership_follower_multi_no_mandatory.md b/tests/results/test/40_6leadership_follower_multi_no_mandatory.md new file mode 100644 index 000000000..0870c5c42 --- /dev/null +++ b/tests/results/test/40_6leadership_follower_multi_no_mandatory.md @@ -0,0 +1,12 @@ +# A leadership + +`basic` + +This family contains lists of variable blocks. + +| Variable                                                                                                              | Description                                                                                                           | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **leadership.leader**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | The leader. | +| **leadership.follower1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `multiple` | The first follower. | +| **leadership.follower2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `multiple` | The second follower.
**Default**: value | + diff --git a/tests/results/test/40_6leadership_follower_multi_no_mandatory.sh b/tests/results/test/40_6leadership_follower_multi_no_mandatory.sh new file mode 100644 index 000000000..dca326574 --- /dev/null +++ b/tests/results/test/40_6leadership_follower_multi_no_mandatory.sh @@ -0,0 +1,26 @@ + + +A leadership + + + basic  + + +This family contains lists of variable blocks. + + +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variable  ┃ Description  ┃ +┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ +│ leadership.leader │ The leader. │ +│  string   standard   unique    │ │ +│ multiple  │ │ +├───────────────────────────────────────┼──────────────────────────────────────┤ +│ leadership.follower1 │ The first follower. │ +│  string   basic   mandatory    │ │ +│ multiple  │ │ +├───────────────────────────────────────┼──────────────────────────────────────┤ +│ leadership.follower2 │ The second follower. │ +│  string   standard   mandatory    │ Default: value │ +│ multiple  │ │ +└───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test/60_0family_dynamic_forbidden_char.adoc b/tests/results/test/60_0family_dynamic_forbidden_char.adoc index 9277b2346..5458dcc7f 100644 --- a/tests/results/test/60_0family_dynamic_forbidden_char.adoc +++ b/tests/results/test/60_0family_dynamic_forbidden_char.adoc @@ -25,15 +25,15 @@ This family builds families dynamically. | Variable | Description | -**dyn__val.1__.var1** + -**dyn__val.2__.var1** + +**dyn__val_1__.var1** + +**dyn__val_2__.var1** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | A dynamic variable. + **Default**: the value of the identifier. | -**dyn__val.1__.var2** + -**dyn__val.2__.var2** + +**dyn__val_1__.var2** + +**dyn__val_2__.var2** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | A dynamic variable. + **Default**: depends on a calculation. diff --git a/tests/results/test/60_0family_dynamic_forbidden_char.json b/tests/results/test/60_0family_dynamic_forbidden_char.json index bc6475334..92d279472 100644 --- a/tests/results/test/60_0family_dynamic_forbidden_char.json +++ b/tests/results/test/60_0family_dynamic_forbidden_char.json @@ -41,8 +41,8 @@ "type": "dynamic", "informations": { "paths": [ - "dynval.1", - "dynval.2" + "dynval_1", + "dynval_2" ], "names": [ "dynval_1", @@ -63,8 +63,8 @@ "children": { "dyn{{ identifier }}.var1": { "paths": [ - "dynval.1.var1", - "dynval.2.var1" + "dynval_1.var1", + "dynval_2.var1" ], "names": [ "var1", @@ -92,8 +92,8 @@ }, "dyn{{ identifier }}.var2": { "paths": [ - "dynval.1.var2", - "dynval.2.var2" + "dynval_1.var2", + "dynval_2.var2" ], "names": [ "var2", diff --git a/tests/results/test/60_0family_dynamic_forbidden_char.md b/tests/results/test/60_0family_dynamic_forbidden_char.md index 2f58231ab..b26e41587 100644 --- a/tests/results/test/60_0family_dynamic_forbidden_char.md +++ b/tests/results/test/60_0family_dynamic_forbidden_char.md @@ -12,6 +12,6 @@ This family builds families dynamically. | Variable                                                                                                                       | Description                                                                                                                    | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **dyn*val.1*.var1**
**dyn*val.2*.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A dynamic variable.
**Default**: the value of the identifier. | -| **dyn*val.1*.var2**
**dyn*val.2*.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A dynamic variable.
**Default**: depends on a calculation. | +| **dyn*val_1*.var1**
**dyn*val_2*.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A dynamic variable.
**Default**: the value of the identifier. | +| **dyn*val_1*.var2**
**dyn*val_2*.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A dynamic variable.
**Default**: depends on a calculation. | diff --git a/tests/results/test/60_0family_dynamic_forbidden_char.sh b/tests/results/test/60_0family_dynamic_forbidden_char.sh index 883afb5ac..6bef5edee 100644 --- a/tests/results/test/60_0family_dynamic_forbidden_char.sh +++ b/tests/results/test/60_0family_dynamic_forbidden_char.sh @@ -23,11 +23,11 @@ This family builds families dynamically. ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Variable  ┃ Description  ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ -│ dynval.1.var1 │ A dynamic variable. │ -│ dynval.2.var1 │ Default: the value of the │ +│ dynval_1.var1 │ A dynamic variable. │ +│ dynval_2.var1 │ Default: the value of the │ │  string   standard   mandatory  │ identifier. │ ├───────────────────────────────────────┼──────────────────────────────────────┤ -│ dynval.1.var2 │ A dynamic variable. │ -│ dynval.2.var2 │ Default: depends on a calculation. │ +│ dynval_1.var2 │ A dynamic variable. │ +│ dynval_2.var2 │ Default: depends on a calculation. │ │  string   standard   mandatory  │ │ └───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test/60_0family_dynamic_upper_char.adoc b/tests/results/test/60_0family_dynamic_upper_char.adoc index 5d5d77884..83fe212a7 100644 --- a/tests/results/test/60_0family_dynamic_upper_char.adoc +++ b/tests/results/test/60_0family_dynamic_upper_char.adoc @@ -25,8 +25,8 @@ This family builds families dynamically. | Variable | Description | -**dyn__Val1__.var** + -**dyn__VAL2__.var** + +**dyn__val1__.var** + +**dyn__val2__.var** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` | A dynamic variable. |==== diff --git a/tests/results/test/60_0family_dynamic_upper_char.json b/tests/results/test/60_0family_dynamic_upper_char.json index b69589cab..4e4c11229 100644 --- a/tests/results/test/60_0family_dynamic_upper_char.json +++ b/tests/results/test/60_0family_dynamic_upper_char.json @@ -41,8 +41,8 @@ "type": "dynamic", "informations": { "paths": [ - "dynVal1", - "dynVAL2" + "dynval1", + "dynval2" ], "names": [ "dynval1", @@ -63,8 +63,8 @@ "children": { "dyn{{ identifier }}.var": { "paths": [ - "dynVal1.var", - "dynVAL2.var" + "dynval1.var", + "dynval2.var" ], "names": [ "var", diff --git a/tests/results/test/60_0family_dynamic_upper_char.md b/tests/results/test/60_0family_dynamic_upper_char.md index cc8cc7337..09229422a 100644 --- a/tests/results/test/60_0family_dynamic_upper_char.md +++ b/tests/results/test/60_0family_dynamic_upper_char.md @@ -12,5 +12,5 @@ This family builds families dynamically. | Variable                                                                                                                       | Description                                                                                                                    | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **dyn*Val1*.var**
**dyn*VAL2*.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A dynamic variable. | +| **dyn*val1*.var**
**dyn*val2*.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A dynamic variable. | diff --git a/tests/results/test/60_0family_dynamic_upper_char.sh b/tests/results/test/60_0family_dynamic_upper_char.sh index 744e9c448..1e0231d70 100644 --- a/tests/results/test/60_0family_dynamic_upper_char.sh +++ b/tests/results/test/60_0family_dynamic_upper_char.sh @@ -23,7 +23,7 @@ This family builds families dynamically. ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Variable  ┃ Description  ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ -│ dynVal1.var │ A dynamic variable. │ -│ dynVAL2.var │ │ +│ dynval1.var │ A dynamic variable. │ +│ dynval2.var │ │ │  string   basic   mandatory  │ │ └───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test_examples/00_2default_calculated_params_permissive.md b/tests/results/test_examples/00_2default_calculated_params_permissive.md new file mode 100644 index 000000000..576045d0e --- /dev/null +++ b/tests/results/test_examples/00_2default_calculated_params_permissive.md @@ -0,0 +1,6 @@ +# Example with all variables modifiable + +```yaml +--- +var2: a_value +``` diff --git a/tests/results/test_examples/04_5validators_multi3.md b/tests/results/test_examples/04_5validators_multi3.md new file mode 100644 index 000000000..b777a3fd6 --- /dev/null +++ b/tests/results/test_examples/04_5validators_multi3.md @@ -0,0 +1,7 @@ +# Example with all variables modifiable + +```yaml +--- +var1: + - 0 +``` diff --git a/tests/results/test_examples/40_6leadership_follower_multi_no_mandatory.md b/tests/results/test_examples/40_6leadership_follower_multi_no_mandatory.md new file mode 100644 index 000000000..3b7720845 --- /dev/null +++ b/tests/results/test_examples/40_6leadership_follower_multi_no_mandatory.md @@ -0,0 +1,11 @@ +# Example with all variables modifiable + +```yaml +--- +leadership: + - leader: example + follower1: + - example + follower2: + - value +``` diff --git a/tests/results/test_examples/60_5family_dynamic_calc_suffix_disabled2.md b/tests/results/test_examples/60_5family_dynamic_calc_suffix_disabled2.md deleted file mode 100644 index 2d1647afc..000000000 --- a/tests/results/test_examples/60_5family_dynamic_calc_suffix_disabled2.md +++ /dev/null @@ -1,15 +0,0 @@ -# Example with mandatory variables not filled in - -```yaml ---- -var2: example -``` -# Example with all variables modifiable - -```yaml ---- -var1: - - val1 - - val2 -var2: example -``` diff --git a/tests/results/test_namespace/00_2default_calculated_params_permissive.adoc b/tests/results/test_namespace/00_2default_calculated_params_permissive.adoc new file mode 100644 index 000000000..b5e011d1f --- /dev/null +++ b/tests/results/test_namespace/00_2default_calculated_params_permissive.adoc @@ -0,0 +1,13 @@ +== Variables for "Rougail" + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**rougail.var2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +A second variable. + +**Default**: depends on a calculation. +|==== + diff --git a/tests/results/test_namespace/00_2default_calculated_params_permissive.json b/tests/results/test_namespace/00_2default_calculated_params_permissive.json new file mode 100644 index 000000000..108ceb231 --- /dev/null +++ b/tests/results/test_namespace/00_2default_calculated_params_permissive.json @@ -0,0 +1,49 @@ +{ + "rougail": { + "type": "namespace", + "informations": { + "paths": [ + "rougail" + ], + "names": [ + "rougail" + ], + "description": "Rougail", + "properties": [ + { + "type": "mode", + "name": "standard" + } + ] + }, + "children": { + "rougail.var2": { + "type": "variable", + "default": "depends on a calculation.", + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "mandatory" + } + ], + "paths": [ + "rougail.var2" + ], + "names": [ + "var2" + ], + "descriptions": [ + "A second variable." + ] + } + } + } +} \ No newline at end of file diff --git a/tests/results/test_namespace/00_2default_calculated_params_permissive.md b/tests/results/test_namespace/00_2default_calculated_params_permissive.md new file mode 100644 index 000000000..ad0ea4e3d --- /dev/null +++ b/tests/results/test_namespace/00_2default_calculated_params_permissive.md @@ -0,0 +1,6 @@ +# Variables for "Rougail" + +| Variable                                                                                                   | Description                                                                                                | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A second variable.
**Default**: depends on a calculation. | + diff --git a/tests/results/test_namespace/00_2default_calculated_params_permissive.sh b/tests/results/test_namespace/00_2default_calculated_params_permissive.sh new file mode 100644 index 000000000..f7dc9d64d --- /dev/null +++ b/tests/results/test_namespace/00_2default_calculated_params_permissive.sh @@ -0,0 +1,11 @@ + + +Variables for "Rougail" + + +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variable  ┃ Description  ┃ +┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ +│ rougail.var2 │ A second variable. │ +│  string   standard   mandatory  │ Default: depends on a calculation. │ +└───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test_namespace/04_5validators_multi3.adoc b/tests/results/test_namespace/04_5validators_multi3.adoc new file mode 100644 index 000000000..4f7919fcd --- /dev/null +++ b/tests/results/test_namespace/04_5validators_multi3.adoc @@ -0,0 +1,20 @@ +== Variables for "Rougail" + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**rougail.var1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[number]` `standard` `mandatory` `unique` `multiple` | +A second variable. + +**Validator**: value must be equal to index. + +**Default**: + +* 0 +* 1 +* 2 + +**Example**: 0 +|==== + diff --git a/tests/results/test_namespace/04_5validators_multi3.json b/tests/results/test_namespace/04_5validators_multi3.json new file mode 100644 index 000000000..5c42e7af6 --- /dev/null +++ b/tests/results/test_namespace/04_5validators_multi3.json @@ -0,0 +1,67 @@ +{ + "rougail": { + "type": "namespace", + "informations": { + "paths": [ + "rougail" + ], + "names": [ + "rougail" + ], + "description": "Rougail", + "properties": [ + { + "type": "mode", + "name": "standard" + } + ] + }, + "children": { + "rougail.var1": { + "type": "variable", + "default": [ + 0, + 1, + 2 + ], + "properties": [ + { + "type": "type", + "name": "number" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "mandatory" + }, + { + "type": "property", + "name": "unique" + }, + { + "type": "multiple", + "name": "multiple" + } + ], + "validators": [ + "value must be equal to index." + ], + "paths": [ + "rougail.var1" + ], + "names": [ + "var1" + ], + "descriptions": [ + "A second variable." + ], + "examples": [ + 0 + ] + } + } + } +} \ No newline at end of file diff --git a/tests/results/test_namespace/04_5validators_multi3.md b/tests/results/test_namespace/04_5validators_multi3.md new file mode 100644 index 000000000..0c4dd29a3 --- /dev/null +++ b/tests/results/test_namespace/04_5validators_multi3.md @@ -0,0 +1,6 @@ +# Variables for "Rougail" + +| Variable                                                                                                                       | Description                                                                                                                    | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.var1**
[`number`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | A second variable.
**Validator**: value must be equal to index.
**Default**:
- 0
- 1
- 2
**Example**: 0 | + diff --git a/tests/results/test_namespace/04_5validators_multi3.sh b/tests/results/test_namespace/04_5validators_multi3.sh new file mode 100644 index 000000000..b1b9e8026 --- /dev/null +++ b/tests/results/test_namespace/04_5validators_multi3.sh @@ -0,0 +1,17 @@ + + +Variables for "Rougail" + + +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variable  ┃ Description  ┃ +┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ +│ rougail.var1 │ A second variable. │ +│  number   standard   mandatory    │ Validator: value must be equal to │ +│ unique   multiple  │ index. │ +│ │ Default: │ +│ │ - 0 │ +│ │ - 1 │ +│ │ - 2 │ +│ │ Example: 0 │ +└───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.adoc b/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.adoc new file mode 100644 index 000000000..f81ba2ed9 --- /dev/null +++ b/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.adoc @@ -0,0 +1,29 @@ +== Variables for "Rougail" + +=== A leadership + +`basic` + +This family contains lists of variable blocks. + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**rougail.leadership.leader** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `unique` `multiple` | +The leader. +| + +**rougail.leadership.follower1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `multiple` | +The first follower. +| + +**rougail.leadership.follower2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `multiple` | +The second follower. + +**Default**: value +|==== + diff --git a/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.json b/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.json new file mode 100644 index 000000000..9ccfa9b4d --- /dev/null +++ b/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.json @@ -0,0 +1,138 @@ +{ + "rougail": { + "type": "namespace", + "informations": { + "paths": [ + "rougail" + ], + "names": [ + "rougail" + ], + "description": "Rougail", + "properties": [ + { + "type": "mode", + "name": "basic" + } + ] + }, + "children": { + "leadership": { + "type": "leadership", + "informations": { + "paths": [ + "rougail.leadership" + ], + "names": [ + "leadership" + ], + "description": "A leadership", + "properties": [ + { + "type": "mode", + "name": "basic" + } + ], + "help": [ + "This family contains lists of variable blocks." + ] + }, + "children": { + "rougail.leadership.leader": { + "type": "variable", + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "unique" + }, + { + "type": "multiple", + "name": "multiple" + } + ], + "paths": [ + "rougail.leadership.leader" + ], + "names": [ + "leader" + ], + "descriptions": [ + "The leader." + ] + }, + "rougail.leadership.follower1": { + "type": "variable", + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "basic" + }, + { + "type": "property", + "name": "mandatory" + }, + { + "type": "multiple", + "name": "multiple" + } + ], + "paths": [ + "rougail.leadership.follower1" + ], + "names": [ + "follower1" + ], + "descriptions": [ + "The first follower." + ] + }, + "rougail.leadership.follower2": { + "type": "variable", + "default": [ + "value" + ], + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "mandatory" + }, + { + "type": "multiple", + "name": "multiple" + } + ], + "paths": [ + "rougail.leadership.follower2" + ], + "names": [ + "follower2" + ], + "descriptions": [ + "The second follower." + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.md b/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.md new file mode 100644 index 000000000..975fac830 --- /dev/null +++ b/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.md @@ -0,0 +1,14 @@ +# Variables for "Rougail" + +## A leadership + +`basic` + +This family contains lists of variable blocks. + +| Variable                                                                                                              | Description                                                                                                           | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.leadership.leader**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | The leader. | +| **rougail.leadership.follower1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `multiple` | The first follower. | +| **rougail.leadership.follower2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `multiple` | The second follower.
**Default**: value | + diff --git a/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.sh b/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.sh new file mode 100644 index 000000000..a2abb93a2 --- /dev/null +++ b/tests/results/test_namespace/40_6leadership_follower_multi_no_mandatory.sh @@ -0,0 +1,31 @@ + + +Variables for "Rougail" + + + + + A leadership + + + basic  + + +This family contains lists of variable blocks. + + +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variable  ┃ Description  ┃ +┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ +│ rougail.leadership.leader │ The leader. │ +│  string   standard   unique    │ │ +│ multiple  │ │ +├───────────────────────────────────────┼──────────────────────────────────────┤ +│ rougail.leadership.follower1 │ The first follower. │ +│  string   basic   mandatory    │ │ +│ multiple  │ │ +├───────────────────────────────────────┼──────────────────────────────────────┤ +│ rougail.leadership.follower2 │ The second follower. │ +│  string   standard   mandatory    │ Default: value │ +│ multiple  │ │ +└───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test_namespace/60_0family_dynamic_forbidden_char.adoc b/tests/results/test_namespace/60_0family_dynamic_forbidden_char.adoc index 1c2d4b9d5..e53e290a6 100644 --- a/tests/results/test_namespace/60_0family_dynamic_forbidden_char.adoc +++ b/tests/results/test_namespace/60_0family_dynamic_forbidden_char.adoc @@ -27,15 +27,15 @@ This family builds families dynamically. | Variable | Description | -**rougail.dyn__val.1__.var1** + -**rougail.dyn__val.2__.var1** + +**rougail.dyn__val_1__.var1** + +**rougail.dyn__val_2__.var1** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | A dynamic variable. + **Default**: the value of the identifier. | -**rougail.dyn__val.1__.var2** + -**rougail.dyn__val.2__.var2** + +**rougail.dyn__val_1__.var2** + +**rougail.dyn__val_2__.var2** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | A dynamic variable. + **Default**: depends on a calculation. diff --git a/tests/results/test_namespace/60_0family_dynamic_forbidden_char.json b/tests/results/test_namespace/60_0family_dynamic_forbidden_char.json index e383d3b14..8a4543b62 100644 --- a/tests/results/test_namespace/60_0family_dynamic_forbidden_char.json +++ b/tests/results/test_namespace/60_0family_dynamic_forbidden_char.json @@ -59,8 +59,8 @@ "type": "dynamic", "informations": { "paths": [ - "rougail.dynval.1", - "rougail.dynval.2" + "rougail.dynval_1", + "rougail.dynval_2" ], "names": [ "dynval_1", @@ -81,8 +81,8 @@ "children": { "rougail.dyn{{ identifier }}.var1": { "paths": [ - "rougail.dynval.1.var1", - "rougail.dynval.2.var1" + "rougail.dynval_1.var1", + "rougail.dynval_2.var1" ], "names": [ "var1", @@ -110,8 +110,8 @@ }, "rougail.dyn{{ identifier }}.var2": { "paths": [ - "rougail.dynval.1.var2", - "rougail.dynval.2.var2" + "rougail.dynval_1.var2", + "rougail.dynval_2.var2" ], "names": [ "var2", diff --git a/tests/results/test_namespace/60_0family_dynamic_forbidden_char.md b/tests/results/test_namespace/60_0family_dynamic_forbidden_char.md index 310435935..d436f644c 100644 --- a/tests/results/test_namespace/60_0family_dynamic_forbidden_char.md +++ b/tests/results/test_namespace/60_0family_dynamic_forbidden_char.md @@ -14,6 +14,6 @@ This family builds families dynamically. | Variable                                                                                                                       | Description                                                                                                                    | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **rougail.dyn*val.1*.var1**
**rougail.dyn*val.2*.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A dynamic variable.
**Default**: the value of the identifier. | -| **rougail.dyn*val.1*.var2**
**rougail.dyn*val.2*.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A dynamic variable.
**Default**: depends on a calculation. | +| **rougail.dyn*val_1*.var1**
**rougail.dyn*val_2*.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A dynamic variable.
**Default**: the value of the identifier. | +| **rougail.dyn*val_1*.var2**
**rougail.dyn*val_2*.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A dynamic variable.
**Default**: depends on a calculation. | diff --git a/tests/results/test_namespace/60_0family_dynamic_forbidden_char.sh b/tests/results/test_namespace/60_0family_dynamic_forbidden_char.sh index 45089d2bd..4992cb126 100644 --- a/tests/results/test_namespace/60_0family_dynamic_forbidden_char.sh +++ b/tests/results/test_namespace/60_0family_dynamic_forbidden_char.sh @@ -28,11 +28,11 @@ This family builds families dynamically. ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Variable  ┃ Description  ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ -│ rougail.dynval.1.var1 │ A dynamic variable. │ -│ rougail.dynval.2.var1 │ Default: the value of the │ +│ rougail.dynval_1.var1 │ A dynamic variable. │ +│ rougail.dynval_2.var1 │ Default: the value of the │ │  string   standard   mandatory  │ identifier. │ ├───────────────────────────────────────┼──────────────────────────────────────┤ -│ rougail.dynval.1.var2 │ A dynamic variable. │ -│ rougail.dynval.2.var2 │ Default: depends on a calculation. │ +│ rougail.dynval_1.var2 │ A dynamic variable. │ +│ rougail.dynval_2.var2 │ Default: depends on a calculation. │ │  string   standard   mandatory  │ │ └───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test_namespace/60_0family_dynamic_upper_char.adoc b/tests/results/test_namespace/60_0family_dynamic_upper_char.adoc index ded13d683..d666023fb 100644 --- a/tests/results/test_namespace/60_0family_dynamic_upper_char.adoc +++ b/tests/results/test_namespace/60_0family_dynamic_upper_char.adoc @@ -27,8 +27,8 @@ This family builds families dynamically. | Variable | Description | -**rougail.dyn__Val1__.var** + -**rougail.dyn__VAL2__.var** + +**rougail.dyn__val1__.var** + +**rougail.dyn__val2__.var** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` | A dynamic variable. |==== diff --git a/tests/results/test_namespace/60_0family_dynamic_upper_char.json b/tests/results/test_namespace/60_0family_dynamic_upper_char.json index e8a02d4de..c6be7c028 100644 --- a/tests/results/test_namespace/60_0family_dynamic_upper_char.json +++ b/tests/results/test_namespace/60_0family_dynamic_upper_char.json @@ -59,8 +59,8 @@ "type": "dynamic", "informations": { "paths": [ - "rougail.dynVal1", - "rougail.dynVAL2" + "rougail.dynval1", + "rougail.dynval2" ], "names": [ "dynval1", @@ -81,8 +81,8 @@ "children": { "rougail.dyn{{ identifier }}.var": { "paths": [ - "rougail.dynVal1.var", - "rougail.dynVAL2.var" + "rougail.dynval1.var", + "rougail.dynval2.var" ], "names": [ "var", diff --git a/tests/results/test_namespace/60_0family_dynamic_upper_char.md b/tests/results/test_namespace/60_0family_dynamic_upper_char.md index 992b753b1..1ceb2513f 100644 --- a/tests/results/test_namespace/60_0family_dynamic_upper_char.md +++ b/tests/results/test_namespace/60_0family_dynamic_upper_char.md @@ -14,5 +14,5 @@ This family builds families dynamically. | Variable                                                                                                                       | Description                                                                                                                    | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **rougail.dyn*Val1*.var**
**rougail.dyn*VAL2*.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A dynamic variable. | +| **rougail.dyn*val1*.var**
**rougail.dyn*val2*.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A dynamic variable. | diff --git a/tests/results/test_namespace/60_0family_dynamic_upper_char.sh b/tests/results/test_namespace/60_0family_dynamic_upper_char.sh index ec61dd1f2..4f8718985 100644 --- a/tests/results/test_namespace/60_0family_dynamic_upper_char.sh +++ b/tests/results/test_namespace/60_0family_dynamic_upper_char.sh @@ -28,7 +28,7 @@ This family builds families dynamically. ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Variable  ┃ Description  ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ -│ rougail.dynVal1.var │ A dynamic variable. │ -│ rougail.dynVAL2.var │ │ +│ rougail.dynval1.var │ A dynamic variable. │ +│ rougail.dynval2.var │ │ │  string   basic   mandatory  │ │ └───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.adoc b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.adoc index 1fc76ce23..e71df16dc 100644 --- a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.adoc +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.adoc @@ -16,7 +16,6 @@ A suffix variable. + **rougail.var2** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | -A variable calculated. + -**Default**: the value of the variable "rougail.dynval1.var". +A variable calculated. |==== diff --git a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.json b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.json index 475caf3aa..4ad4e1ebd 100644 --- a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.json +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.json @@ -53,7 +53,6 @@ }, "rougail.var2": { "type": "variable", - "default": "the value of the variable \"rougail.dynval1.var\".", "properties": [ { "type": "type", diff --git a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.md b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.md index c7e0185bc..34d2a9759 100644 --- a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.md +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.md @@ -3,5 +3,5 @@ | Variable                                                                                                           | Description                                                                                                        | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **rougail.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | A suffix variable.
**Examples**:
- val1
- val2 | -| **rougail.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable calculated.
**Default**: the value of the variable "rougail.dynval1.var". | +| **rougail.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable calculated. | diff --git a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.sh b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.sh index f053e4253..da34802de 100644 --- a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.sh +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.sh @@ -12,6 +12,5 @@ │ │ - val2 │ ├───────────────────────────────────────┼──────────────────────────────────────┤ │ rougail.var2 │ A variable calculated. │ -│  string   standard   mandatory  │ Default: the value of the variable │ -│ │ "rougail.dynval1.var". │ +│  string   standard   mandatory  │ │ └───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.adoc b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.adoc similarity index 70% rename from tests/results/test/60_5family_dynamic_calc_suffix_disabled2.adoc rename to tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.adoc index de37f00ad..b07d3dc66 100644 --- a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.adoc +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.adoc @@ -1,9 +1,11 @@ +== Variables for "Rougail" + [cols="1a,1a"] |==== | Variable | Description | -**var1** + +**rougail.var1** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `unique` `multiple` | A suffix variable. + **Examples**: @@ -12,8 +14,9 @@ A suffix variable. + * val2 | -**var2** + +**rougail.var2** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | -A variable calculated. +A variable calculated. + +**Default**: a value (from an uncalculated variable). |==== diff --git a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.json b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.json new file mode 100644 index 000000000..87d6fb3e1 --- /dev/null +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.json @@ -0,0 +1,83 @@ +{ + "rougail": { + "type": "namespace", + "informations": { + "paths": [ + "rougail" + ], + "names": [ + "rougail" + ], + "description": "Rougail", + "properties": [ + { + "type": "mode", + "name": "standard" + } + ] + }, + "children": { + "rougail.var1": { + "type": "variable", + "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." + ], + "examples": [ + "val1", + "val2" + ] + }, + "rougail.var2": { + "type": "variable", + "default": "a value (from an uncalculated variable).", + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "mandatory" + } + ], + "paths": [ + "rougail.var2" + ], + "names": [ + "var2" + ], + "descriptions": [ + "A variable calculated." + ] + } + } + } +} \ No newline at end of file diff --git a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.md b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.md similarity index 90% rename from tests/results/test/60_5family_dynamic_calc_suffix_disabled2.md rename to tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.md index b5e0fff13..1b6fd56c9 100644 --- a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.md +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.md @@ -1,5 +1,7 @@ +# Variables for "Rougail" + | Variable                                                                                                           | Description                                                                                                        | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | A suffix variable.
**Examples**:
- val1
- val2 | -| **var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable calculated. | +| **rougail.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | A suffix variable.
**Examples**:
- val1
- val2 | +| **rougail.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable calculated.
**Default**: a value (from an uncalculated variable). | diff --git a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.sh b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.sh similarity index 82% rename from tests/results/test/60_5family_dynamic_calc_suffix_disabled2.sh rename to tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.sh index 261f9b263..caa9c9253 100644 --- a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.sh +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_hidden.sh @@ -1,11 +1,17 @@ + + +Variables for "Rougail" + + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Variable  ┃ Description  ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ -│ var1 │ A suffix variable. │ +│ rougail.var1 │ A suffix variable. │ │  string   standard   unique    │ Examples: │ │ multiple  │ - val1 │ │ │ - val2 │ ├───────────────────────────────────────┼──────────────────────────────────────┤ -│ var2 │ A variable calculated. │ -│  string   standard   mandatory  │ │ +│ rougail.var2 │ A variable calculated. │ +│  string   standard   mandatory  │ Default: a value (from an │ +│ │ uncalculated variable). │ └───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.adoc b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.adoc new file mode 100644 index 000000000..3ee8c0bfb --- /dev/null +++ b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.adoc @@ -0,0 +1,45 @@ +== Variables for "Rougail" + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**rougail.var** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `unique` `multiple` | +A identifier variable. + +**Default**: + +* val1 +* val2 +|==== + +=== A dynamic family + +`basic` + +This family builds families dynamically. + +**Identifiers**: the value of the variable "rougail.var". + +==== A dynamic family + +`basic` + +This family builds families dynamically. + +**Identifiers**: the value of the variable "rougail.var". + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**rougail.__val1__.__val1__.var** + +**rougail.__val1__.__val2__.var** + +**rougail.__val2__.__val1__.var** + +**rougail.__val2__.__val2__.var** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` | +A dynamic variable. +|==== + diff --git a/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.json b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.json new file mode 100644 index 000000000..a5f8a4c51 --- /dev/null +++ b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.json @@ -0,0 +1,148 @@ +{ + "rougail": { + "type": "namespace", + "informations": { + "paths": [ + "rougail" + ], + "names": [ + "rougail" + ], + "description": "Rougail", + "properties": [ + { + "type": "mode", + "name": "basic" + } + ] + }, + "children": { + "rougail.var": { + "type": "variable", + "default": [ + "val1", + "val2" + ], + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "mandatory" + }, + { + "type": "property", + "name": "unique" + }, + { + "type": "multiple", + "name": "multiple" + } + ], + "paths": [ + "rougail.var" + ], + "names": [ + "var" + ], + "descriptions": [ + "A identifier variable." + ] + }, + "{{ identifier }}": { + "type": "dynamic", + "informations": { + "paths": [ + "rougail.val1", + "rougail.val2" + ], + "names": [ + "val1", + "val2" + ], + "description": "A dynamic family", + "properties": [ + { + "type": "mode", + "name": "basic" + } + ], + "identifiers": "the value of the variable \"rougail.var\".", + "help": [ + "This family builds families dynamically." + ] + }, + "children": { + "{{ identifier }}": { + "type": "dynamic", + "informations": { + "paths": [ + "rougail.val1.val1", + "rougail.val1.val2", + "rougail.val2.val1", + "rougail.val2.val2" + ], + "names": [ + "val1", + "val2", + "val1", + "val2" + ], + "description": "A dynamic family", + "properties": [ + { + "type": "mode", + "name": "basic" + } + ], + "identifiers": "the value of the variable \"rougail.var\".", + "help": [ + "This family builds families dynamically." + ] + }, + "children": { + "rougail.{{ identifier }}.{{ identifier }}.var": { + "paths": [ + "rougail.val1.val1.var", + "rougail.val1.val2.var", + "rougail.val2.val1.var", + "rougail.val2.val2.var" + ], + "names": [ + "var", + "var", + "var", + "var" + ], + "type": "variable", + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "basic" + }, + { + "type": "property", + "name": "mandatory" + } + ], + "descriptions": [ + "A dynamic variable." + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.md b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.md new file mode 100644 index 000000000..cfe78ae90 --- /dev/null +++ b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.md @@ -0,0 +1,26 @@ +# Variables for "Rougail" + +| Variable                                                                                                                       | Description                                                                                                                    | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | A identifier variable.
**Default**:
- val1
- val2 | + +## A dynamic family + +`basic` + +This family builds families dynamically. + +**Identifiers**: the value of the variable "rougail.var". + +### A dynamic family + +`basic` + +This family builds families dynamically. + +**Identifiers**: the value of the variable "rougail.var". + +| Variable                                                                                                                       | Description                                                                                                                    | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.*val1*.*val1*.var**
**rougail.*val1*.*val2*.var**
**rougail.*val2*.*val1*.var**
**rougail.*val2*.*val2*.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A dynamic variable. | + diff --git a/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.sh b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.sh new file mode 100644 index 000000000..978a087ae --- /dev/null +++ b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_1_0_2.sh @@ -0,0 +1,50 @@ + + +Variables for "Rougail" + + +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variable  ┃ Description  ┃ +┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ +│ rougail.var │ A identifier variable. │ +│  string   standard   mandatory    │ Default: │ +│ unique   multiple  │ - val1 │ +│ │ - val2 │ +└───────────────────────────────────────┴──────────────────────────────────────┘ + + + A dynamic family + + + basic  + + +This family builds families dynamically. + + +Identifiers: the value of the variable "rougail.var". + + + + + A dynamic family + + + basic  + + +This family builds families dynamically. + + +Identifiers: the value of the variable "rougail.var". + + +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variable  ┃ Description  ┃ +┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ +│ rougail.val1.val1.var │ A dynamic variable. │ +│ rougail.val1.val2.var │ │ +│ rougail.val2.val1.var │ │ +│ rougail.val2.val2.var │ │ +│  string   basic   mandatory  │ │ +└───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test_namespace_examples/00_2default_calculated_params_permissive.md b/tests/results/test_namespace_examples/00_2default_calculated_params_permissive.md new file mode 100644 index 000000000..aa15bab0b --- /dev/null +++ b/tests/results/test_namespace_examples/00_2default_calculated_params_permissive.md @@ -0,0 +1,7 @@ +# Example with all variables modifiable + +```yaml +--- +rougail: + var2: a_value +``` diff --git a/tests/results/test_namespace_examples/04_5validators_multi3.md b/tests/results/test_namespace_examples/04_5validators_multi3.md new file mode 100644 index 000000000..6fb0ea4f2 --- /dev/null +++ b/tests/results/test_namespace_examples/04_5validators_multi3.md @@ -0,0 +1,8 @@ +# Example with all variables modifiable + +```yaml +--- +rougail: + var1: + - 0 +``` diff --git a/tests/results/test_namespace_examples/40_6leadership_follower_multi_no_mandatory.md b/tests/results/test_namespace_examples/40_6leadership_follower_multi_no_mandatory.md new file mode 100644 index 000000000..039280c41 --- /dev/null +++ b/tests/results/test_namespace_examples/40_6leadership_follower_multi_no_mandatory.md @@ -0,0 +1,12 @@ +# Example with all variables modifiable + +```yaml +--- +rougail: + leadership: + - leader: example + follower1: + - example + follower2: + - value +``` diff --git a/tests/results/test_namespace_examples/60_5family_dynamic_calc_suffix_hidden.md b/tests/results/test_namespace_examples/60_5family_dynamic_calc_suffix_hidden.md new file mode 100644 index 000000000..8dac5cb9f --- /dev/null +++ b/tests/results/test_namespace_examples/60_5family_dynamic_calc_suffix_hidden.md @@ -0,0 +1,10 @@ +# Example with all variables modifiable + +```yaml +--- +rougail: + var1: + - val1 + - val2 + var2: a value +``` diff --git a/tests/results/test_namespace_examples/60_6family_dynamic_sub_dynamic_1_0_2.md b/tests/results/test_namespace_examples/60_6family_dynamic_sub_dynamic_1_0_2.md new file mode 100644 index 000000000..58889b932 --- /dev/null +++ b/tests/results/test_namespace_examples/60_6family_dynamic_sub_dynamic_1_0_2.md @@ -0,0 +1,35 @@ +# Example with mandatory variables not filled in + +```yaml +--- +rougail: + val1: + val1: + var: example + val2: + var: example + val2: + val1: + var: example + val2: + var: example +``` +# Example with all variables modifiable + +```yaml +--- +rougail: + var: + - val1 + - val2 + val1: + val1: + var: example + val2: + var: example + val2: + val1: + var: example + val2: + var: example +``` diff --git a/tests/test_load.py b/tests/test_load.py index db7d3537f..711932162 100644 --- a/tests/test_load.py +++ b/tests/test_load.py @@ -14,7 +14,7 @@ excludes = [ ] test_ok = get_structures_list(excludes) -# test_ok = [Path('../rougail-tests/structures/60_6family_dynamic_suffix_auto_multi2')] +# test_ok = [Path('../rougail-tests/structures/60_0family_dynamic_upper_char')] os.environ['COLUMNS'] = '80' diff --git a/tests/test_mode.py b/tests/test_mode.py index 1d9834198..5f68f1369 100644 --- a/tests/test_mode.py +++ b/tests/test_mode.py @@ -19,6 +19,7 @@ def _test(modes): inventory = RougailOutputDoc(config, rougailconfig=rougailconfig) doc = inventory.run()[1] result_file = test_dir / f'mode_{"_".join(modes)}.adoc' + print(result_file) if not result_file.is_file(): with open(str(result_file), 'w') as docfh: docfh.write(doc)