diff --git a/src/rougail/output_doc/doc.py b/src/rougail/output_doc/doc.py index 42dc41e..15ad78d 100644 --- a/src/rougail/output_doc/doc.py +++ b/src/rougail/output_doc/doc.py @@ -92,19 +92,15 @@ class RougailOutputDoc(Examples): def run(self) -> str: """Print documentation in stdout""" - return self.gen_doc() - - def print(self) -> None: - print(self.run()) - - def gen_doc(self): - """Return documentation""" self._tiramisu_to_internal_object() return_string = self.formater.run(self.informations, self.level) if self.with_example: return_string += self.gen_doc_examples() return return_string + def print(self) -> None: + print(self.run()) + def _tiramisu_to_internal_object(self): config = self.conf.unrestraint self._populate_dynamics(config) @@ -148,6 +144,8 @@ class RougailOutputDoc(Examples): for child in family.list(): if self._is_inaccessible_user_data(child): continue + if child.type(detect_symlink=True) == 'symlink': + continue name = child.name(uncalculated=True) path = child.path(uncalculated=True) if not child.isoptiondescription(): diff --git a/tests/cmdline.adoc b/tests/cmdline.adoc new file mode 100644 index 0000000..6f4ea60 --- /dev/null +++ b/tests/cmdline.adoc @@ -0,0 +1,12 @@ +== Variables + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**var1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | +My var1. +|==== + diff --git a/tests/cmdline/00_file.yml b/tests/cmdline/00_file.yml new file mode 100644 index 0000000..dd56afa --- /dev/null +++ b/tests/cmdline/00_file.yml @@ -0,0 +1,60 @@ +--- +version: 1.1 + +var1: + description: my var1 + alternative_name: v + +var2: + description: my var2 + default: + jinja: | + {{ a.unknown.variable }} + description: var calculated + +var3: + description: my var3 + hidden: + jinja: | + {% if a.unknown.variable == 'value' %} + it's hidden + {% endif %} + description: var could be hidden + +var4: + description: my var4 + hidden: + variable: a.unknown.variable + when: 'value' + +var5: + description: my var5 + default: + type: information + information: info + variable: a.unknown.variable + +var6: + description: my var6 + choices: + variable: a.unknown.variable + +var7: + description: my var7 + choices: + - variable: a.unknown.variable1 + - variable: a.unknown.variable2 + +var8: + description: my var8 + choices: + jinja: | + a.unknown.variable + description: the a.unknown.variable values + +"var{{ identifier }}": + description: my var6 + dynamic: + variable: a.unknown.variable + var: + description: a variable diff --git a/tests/results/test/00_9default_information_other_variable2.adoc b/tests/results/test/00_9default_information_other_variable2.adoc new file mode 100644 index 0000000..247e2da --- /dev/null +++ b/tests/results/test/00_9default_information_other_variable2.adoc @@ -0,0 +1,18 @@ +== Variables + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**var1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` | +A first variable. +| + +**var2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +A second variable. + +**Default**: the value of the information "test_information" of the variable "var1". +|==== + diff --git a/tests/results/test/00_9default_information_other_variable2.json b/tests/results/test/00_9default_information_other_variable2.json new file mode 100644 index 0000000..1ccc1e3 --- /dev/null +++ b/tests/results/test/00_9default_information_other_variable2.json @@ -0,0 +1 @@ +{"var1": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["var1"], "names": ["var1"], "descriptions": ["A first variable."]}, "var2": {"type": "variable", "default": "the value of the information \"test_information\" of the variable \"var1\".", "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_9default_information_other_variable2.md b/tests/results/test/00_9default_information_other_variable2.md new file mode 100644 index 0000000..14d71b3 --- /dev/null +++ b/tests/results/test/00_9default_information_other_variable2.md @@ -0,0 +1,11 @@ +--- +gitea: none +include_toc: true +--- +# Variables + +| Variable                                                                                                   | Description                                                                                                | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A first variable. | +| **var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A second variable.
**Default**: the value of the information "test_information" of the variable "var1". | + diff --git a/tests/results/test/00_9default_information_other_variable2.sh b/tests/results/test/00_9default_information_other_variable2.sh new file mode 100644 index 0000000..88306b4 --- /dev/null +++ b/tests/results/test/00_9default_information_other_variable2.sh @@ -0,0 +1,18 @@ +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variables ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + + + + + +  Variable                                Description                           + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + var1 + string basic mandatory A first variable. + var2 + string standard mandatory A second variable. + Default: the value of the information + "test_information" of the variable + "var1". + diff --git a/tests/results/test/01_6string_multi.adoc b/tests/results/test/01_6string_multi.adoc index 6d0c1ac..d0752d7 100644 --- a/tests/results/test/01_6string_multi.adoc +++ b/tests/results/test/01_6string_multi.adoc @@ -16,7 +16,7 @@ The second variable. | **var3** + -`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` | +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `unique` `multiple` | The third variable. | diff --git a/tests/results/test/01_6string_multi.json b/tests/results/test/01_6string_multi.json index 135338c..66f805b 100644 --- a/tests/results/test/01_6string_multi.json +++ b/tests/results/test/01_6string_multi.json @@ -1 +1 @@ -{"var1": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var1"], "names": ["var1"], "descriptions": ["The first variable."], "multiple": true}, "var2": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var2"], "names": ["var2"], "descriptions": ["The second variable."], "multiple": true}, "var3": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["var3"], "names": ["var3"], "descriptions": ["The third variable."]}, "var4": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var4"], "names": ["var4"], "descriptions": ["The forth variable."], "multiple": true}, "var5": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var5"], "names": ["var5"], "descriptions": ["The fifth variable."], "multiple": true}, "var6": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var6"], "names": ["var6"], "descriptions": ["The sixth variable."], "multiple": true}, "var7": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var7"], "names": ["var7"], "descriptions": ["The seventh variable."], "multiple": true}, "var8": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var8"], "names": ["var8"], "descriptions": ["The eighth variable."], "multiple": true}} \ No newline at end of file +{"var1": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var1"], "names": ["var1"], "descriptions": ["The first variable."], "multiple": true}, "var2": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var2"], "names": ["var2"], "descriptions": ["The second variable."], "multiple": true}, "var3": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var3"], "names": ["var3"], "descriptions": ["The third variable."], "multiple": true}, "var4": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var4"], "names": ["var4"], "descriptions": ["The forth variable."], "multiple": true}, "var5": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var5"], "names": ["var5"], "descriptions": ["The fifth variable."], "multiple": true}, "var6": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var6"], "names": ["var6"], "descriptions": ["The sixth variable."], "multiple": true}, "var7": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var7"], "names": ["var7"], "descriptions": ["The seventh variable."], "multiple": true}, "var8": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["var8"], "names": ["var8"], "descriptions": ["The eighth variable."], "multiple": true}} \ No newline at end of file diff --git a/tests/results/test/01_6string_multi.md b/tests/results/test/01_6string_multi.md index ea61013..be60ff5 100644 --- a/tests/results/test/01_6string_multi.md +++ b/tests/results/test/01_6string_multi.md @@ -8,7 +8,7 @@ include_toc: true |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The first variable. | | **var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The second variable. | -| **var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The third variable. | +| **var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The third variable. | | **var4**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The forth variable.
**Default**: value | | **var5**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The fifth variable.
**Default**: value | | **var6**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The sixth variable.
**Default**: value | diff --git a/tests/results/test/01_6string_multi.sh b/tests/results/test/01_6string_multi.sh index bb67507..ed8b5a6 100644 --- a/tests/results/test/01_6string_multi.sh +++ b/tests/results/test/01_6string_multi.sh @@ -25,7 +25,8 @@ string basic mandatory unique The second variable. multiple var3 - string basic mandatory The third variable. + string basic mandatory unique The third variable. + multiple var4 string standard mandatory unique The forth variable. multiple diff --git a/tests/results/test/16_6exists_family.adoc b/tests/results/test/16_6exists_family.adoc new file mode 100644 index 0000000..e69de29 diff --git a/tests/results/test/16_6exists_family.json b/tests/results/test/16_6exists_family.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/tests/results/test/16_6exists_family.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/tests/results/test/16_6exists_family.md b/tests/results/test/16_6exists_family.md new file mode 100644 index 0000000..3fc684d --- /dev/null +++ b/tests/results/test/16_6exists_family.md @@ -0,0 +1,4 @@ +--- +gitea: none +include_toc: true +--- diff --git a/tests/results/test/16_6exists_family.sh b/tests/results/test/16_6exists_family.sh new file mode 100644 index 0000000..e69de29 diff --git a/tests/results/test/20_9family_absolute.adoc b/tests/results/test/20_9family_absolute.adoc new file mode 100644 index 0000000..bccb6c0 --- /dev/null +++ b/tests/results/test/20_9family_absolute.adoc @@ -0,0 +1,86 @@ +== Variables + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**var1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` | +First variable. +|==== + +=== a family + +`basic` + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**family.var2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` | +A second variable. + +**Example**: string6 +|==== + +==== a sub family + +`standard` + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**family.subfamily.variable** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `unique` `multiple` | +Third variable. + +**Default**: + +* the value of the variable "var1". +* the value of the variable "family.var2". +|==== + +=== a family + +`standard` + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**family2.var2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +A variable2. + +**Default**: the value of the variable "family.var2". +| + +**family2.var3** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +Var3. + +**Default**: string4 + +**Example**: string5 +|==== + +==== a sub family + +`standard` + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**family2.subfamily.variable** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` `unique` `multiple` | +Fourth variable. + +**Default**: + +* the value of the variable "var1". +* the value of the variable "family.var2". +* the value of the variable "family2.var3". +|==== + diff --git a/tests/results/test/20_9family_absolute.json b/tests/results/test/20_9family_absolute.json new file mode 100644 index 0000000..1d90ead --- /dev/null +++ b/tests/results/test/20_9family_absolute.json @@ -0,0 +1 @@ +{"var1": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["var1"], "names": ["var1"], "descriptions": ["First variable."]}, "family": {"type": "family", "informations": {"paths": ["family"], "names": ["family"], "description": "a family", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"var2": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["family.var2"], "names": ["var2"], "descriptions": ["A second variable."], "examples": ["string6"]}, "subfamily": {"type": "family", "informations": {"paths": ["family.subfamily"], "names": ["subfamily"], "description": "a sub family", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"variable": {"type": "variable", "default": ["the value of the variable \"var1\".", "the value of the variable \"family.var2\"."], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["family.subfamily.variable"], "names": ["variable"], "descriptions": ["Third variable."], "multiple": true}}}}}, "family2": {"type": "family", "informations": {"paths": ["family2"], "names": ["family2"], "description": "a family", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"var2": {"type": "variable", "default": "the value of the variable \"family.var2\".", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["family2.var2"], "names": ["var2"], "descriptions": ["A variable2."]}, "var3": {"type": "variable", "default": "string4", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["family2.var3"], "names": ["var3"], "examples": ["string5"]}, "subfamily": {"type": "family", "informations": {"paths": ["family2.subfamily"], "names": ["subfamily"], "description": "a sub family", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"variable": {"type": "variable", "default": ["the value of the variable \"var1\".", "the value of the variable \"family.var2\".", "the value of the variable \"family2.var3\"."], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["family2.subfamily.variable"], "names": ["variable"], "descriptions": ["Fourth variable."], "multiple": true}}}}}} \ No newline at end of file diff --git a/tests/results/test/20_9family_absolute.md b/tests/results/test/20_9family_absolute.md new file mode 100644 index 0000000..499b6da --- /dev/null +++ b/tests/results/test/20_9family_absolute.md @@ -0,0 +1,43 @@ +--- +gitea: none +include_toc: true +--- +# Variables + +| Variable                                                                                                | Description                                                                                             | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | First variable. | + +## a family + +`basic` + +| Variable                                                                                                | Description                                                                                             | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **family.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A second variable.
**Example**: string6 | + +### a sub family + +`standard` + +| Variable                                                                                                                       | Description                                                                                                                    | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **family.subfamily.variable**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | Third variable.
**Default**:
- the value of the variable "var1".
- the value of the variable "family.var2". | + +## a family + +`standard` + +| Variable                                                                                                                       | Description                                                                                                                    | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **family2.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable2.
**Default**: the value of the variable "family.var2". | +| **family2.var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Var3.
**Default**: string4
**Example**: string5 | + +### a sub family + +`standard` + +| Variable                                                                                                                       | Description                                                                                                                    | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **family2.subfamily.variable**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | Fourth variable.
**Default**:
- the value of the variable "var1".
- the value of the variable "family.var2".
- the value of the variable "family2.var3". | + diff --git a/tests/results/test/20_9family_absolute.sh b/tests/results/test/20_9family_absolute.sh new file mode 100644 index 0000000..48be4fc --- /dev/null +++ b/tests/results/test/20_9family_absolute.sh @@ -0,0 +1,88 @@ +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variables ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + + + +  Variable                        Description                    + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + var1 + string basic mandatory First variable. + + + + a family + +basic + + + + +  Variable                        Description                    + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + family.var2 + string basic mandatory A second variable. + Example: string6 + + + a sub family + +standard + + + + +  Variable                               Description                            + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + family.subfamily.variable + string standard mandatory unique Third variable. + multiple + Default: + + + • the value of the variable "var1". + • the value of the variable "family.var2". + | + + + a family + +standard + + + + + + + +  Variable                               Description                            + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + family2.var2 + string standard mandatory A variable2. + Default: the value of the variable + "family.var2". + family2.var3 + string standard mandatory Var3. + Default: string4 + Example: string5 + + + a sub family + +standard + + + + +  Variable                               Description                            + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + family2.subfamily.variable + string standard mandatory unique Fourth variable. + multiple + Default: + + + • the value of the variable "var1". + • the value of the variable "family.var2". + • the value of the variable "family2.var3". + | diff --git a/tests/results/test_examples/00_9default_information_other_variable2.md b/tests/results/test_examples/00_9default_information_other_variable2.md new file mode 100644 index 0000000..d9e6e9d --- /dev/null +++ b/tests/results/test_examples/00_9default_information_other_variable2.md @@ -0,0 +1,24 @@ +--- +gitea: none +include_toc: true +--- +# Variables + +| Variable                                                                                                   | Description                                                                                                | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A first variable. | +| **var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A second variable.
**Default**: the value of the information "test_information" of the variable "var1". | + +# Example with mandatory variables not filled in + +```yaml +--- +var1: example +``` +# Example with all variables modifiable + +```yaml +--- +var1: example +var2: example +``` diff --git a/tests/results/test_examples/01_6string_multi.md b/tests/results/test_examples/01_6string_multi.md index d9c3a28..0a58f09 100644 --- a/tests/results/test_examples/01_6string_multi.md +++ b/tests/results/test_examples/01_6string_multi.md @@ -8,7 +8,7 @@ include_toc: true |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The first variable. | | **var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The second variable. | -| **var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The third variable. | +| **var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The third variable. | | **var4**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The forth variable.
**Default**: value | | **var5**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The fifth variable.
**Default**: value | | **var6**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The sixth variable.
**Default**: value | @@ -23,7 +23,8 @@ var1: - example var2: - example -var3: example +var3: + - example ``` # Example with all variables modifiable @@ -33,7 +34,8 @@ var1: - example var2: - example -var3: example +var3: + - example var4: - value var5: diff --git a/tests/results/test_examples/16_6exists_family.md b/tests/results/test_examples/16_6exists_family.md new file mode 100644 index 0000000..3fc684d --- /dev/null +++ b/tests/results/test_examples/16_6exists_family.md @@ -0,0 +1,4 @@ +--- +gitea: none +include_toc: true +--- diff --git a/tests/results/test_examples/20_9family_absolute.md b/tests/results/test_examples/20_9family_absolute.md new file mode 100644 index 0000000..3142965 --- /dev/null +++ b/tests/results/test_examples/20_9family_absolute.md @@ -0,0 +1,71 @@ +--- +gitea: none +include_toc: true +--- +# Variables + +| Variable                                                                                                | Description                                                                                             | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | First variable. | + +## a family + +`basic` + +| Variable                                                                                                | Description                                                                                             | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **family.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A second variable.
**Example**: string6 | + +### a sub family + +`standard` + +| Variable                                                                                                                       | Description                                                                                                                    | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **family.subfamily.variable**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | Third variable.
**Default**:
- the value of the variable "var1".
- the value of the variable "family.var2". | + +## a family + +`standard` + +| Variable                                                                                                                       | Description                                                                                                                    | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **family2.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable2.
**Default**: the value of the variable "family.var2". | +| **family2.var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Var3.
**Default**: string4
**Example**: string5 | + +### a sub family + +`standard` + +| Variable                                                                                                                       | Description                                                                                                                    | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **family2.subfamily.variable**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | Fourth variable.
**Default**:
- the value of the variable "var1".
- the value of the variable "family.var2".
- the value of the variable "family2.var3". | + +# Example with mandatory variables not filled in + +```yaml +--- +var1: example +family: + var2: string6 +``` +# Example with all variables modifiable + +```yaml +--- +var1: example +family: + var2: string6 + subfamily: + variable: + - + - +family2: + var2: example + var3: string5 + subfamily: + variable: + - + - + - string4 +``` diff --git a/tests/results/test_namespace/00_9default_information_other_variable2.adoc b/tests/results/test_namespace/00_9default_information_other_variable2.adoc new file mode 100644 index 0000000..31b53dd --- /dev/null +++ b/tests/results/test_namespace/00_9default_information_other_variable2.adoc @@ -0,0 +1,18 @@ +== Variables for "Rougail" + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**rougail.var1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` | +A first variable. +| + +**rougail.var2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +A second variable. + +**Default**: the value of the information "test_information" of the variable "rougail.var1". +|==== + diff --git a/tests/results/test_namespace/00_9default_information_other_variable2.json b/tests/results/test_namespace/00_9default_information_other_variable2.json new file mode 100644 index 0000000..e6cae27 --- /dev/null +++ b/tests/results/test_namespace/00_9default_information_other_variable2.json @@ -0,0 +1 @@ +{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"var1": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["A first variable."]}, "var2": {"type": "variable", "default": "the value of the information \"test_information\" of the variable \"rougail.var1\".", "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_9default_information_other_variable2.md b/tests/results/test_namespace/00_9default_information_other_variable2.md new file mode 100644 index 0000000..fda791f --- /dev/null +++ b/tests/results/test_namespace/00_9default_information_other_variable2.md @@ -0,0 +1,11 @@ +--- +gitea: none +include_toc: true +--- +# Variables for "Rougail" + +| Variable                                                                                                   | Description                                                                                                | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A first variable. | +| **rougail.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A second variable.
**Default**: the value of the information "test_information" of the variable "rougail.var1". | + diff --git a/tests/results/test_namespace/00_9default_information_other_variable2.sh b/tests/results/test_namespace/00_9default_information_other_variable2.sh new file mode 100644 index 0000000..917e639 --- /dev/null +++ b/tests/results/test_namespace/00_9default_information_other_variable2.sh @@ -0,0 +1,18 @@ +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variables for "Rougail" ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + + + + + +  Variable                                Description                           + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + rougail.var1 + string basic mandatory A first variable. + rougail.var2 + string standard mandatory A second variable. + Default: the value of the information + "test_information" of the variable + "rougail.var1". + diff --git a/tests/results/test_namespace/00_9extra_ouside.adoc b/tests/results/test_namespace/00_9extra_ouside.adoc new file mode 100644 index 0000000..305b364 --- /dev/null +++ b/tests/results/test_namespace/00_9extra_ouside.adoc @@ -0,0 +1,26 @@ +== Variables for "Rougail" + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**rougail.variable** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +A variable. + +**Default**: the value of the variable "extra.variable". +|==== + +== Variables for "extra" + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**extra.variable** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +A variable. + +**Default**: value in extra +|==== + diff --git a/tests/results/test_namespace/00_9extra_ouside.json b/tests/results/test_namespace/00_9extra_ouside.json new file mode 100644 index 0000000..38f6155 --- /dev/null +++ b/tests/results/test_namespace/00_9extra_ouside.json @@ -0,0 +1 @@ +{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"variable": {"type": "variable", "default": "the value of the variable \"extra.variable\".", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.variable"], "names": ["variable"], "descriptions": ["A variable."]}}}, "extra": {"type": "namespace", "informations": {"paths": ["extra"], "names": ["extra"], "description": "extra", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"variable": {"type": "variable", "default": "value in extra", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "paths": ["extra.variable"], "names": ["variable"], "descriptions": ["A variable."]}}}} \ No newline at end of file diff --git a/tests/results/test_namespace/00_9extra_ouside.md b/tests/results/test_namespace/00_9extra_ouside.md new file mode 100644 index 0000000..7c96b7d --- /dev/null +++ b/tests/results/test_namespace/00_9extra_ouside.md @@ -0,0 +1,16 @@ +--- +gitea: none +include_toc: true +--- +# Variables for "Rougail" + +| Variable                                                                                                   | Description                                                                                                | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.variable**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable.
**Default**: the value of the variable "extra.variable". | + +# Variables for "extra" + +| Variable                                                                                                   | Description                                                                                                | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **extra.variable**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable.
**Default**: value in extra | + diff --git a/tests/results/test_namespace/00_9extra_ouside.sh b/tests/results/test_namespace/00_9extra_ouside.sh new file mode 100644 index 0000000..ae9dbcf --- /dev/null +++ b/tests/results/test_namespace/00_9extra_ouside.sh @@ -0,0 +1,28 @@ +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variables for "Rougail" ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + + + + +  Variable                                Description                           + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + rougail.variable + string standard mandatory A variable. + Default: the value of the variable + "extra.variable". + + +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variables for "extra" ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + + + + +  Variable                                Description                           + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + extra.variable + string standard mandatory A variable. + Default: value in extra + diff --git a/tests/results/test_namespace/01_6string_multi.adoc b/tests/results/test_namespace/01_6string_multi.adoc index a3e6c0b..a565f07 100644 --- a/tests/results/test_namespace/01_6string_multi.adoc +++ b/tests/results/test_namespace/01_6string_multi.adoc @@ -16,7 +16,7 @@ The second variable. | **rougail.var3** + -`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` | +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `unique` `multiple` | The third variable. | diff --git a/tests/results/test_namespace/01_6string_multi.json b/tests/results/test_namespace/01_6string_multi.json index 9fddff5..d7bbb44 100644 --- a/tests/results/test_namespace/01_6string_multi.json +++ b/tests/results/test_namespace/01_6string_multi.json @@ -1 +1 @@ -{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"var1": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["The first variable."], "multiple": true}, "var2": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["The second variable."], "multiple": true}, "var3": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}], "paths": ["rougail.var3"], "names": ["var3"], "descriptions": ["The third variable."]}, "var4": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var4"], "names": ["var4"], "descriptions": ["The forth variable."], "multiple": true}, "var5": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var5"], "names": ["var5"], "descriptions": ["The fifth variable."], "multiple": true}, "var6": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var6"], "names": ["var6"], "descriptions": ["The sixth variable."], "multiple": true}, "var7": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var7"], "names": ["var7"], "descriptions": ["The seventh variable."], "multiple": true}, "var8": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var8"], "names": ["var8"], "descriptions": ["The eighth variable."], "multiple": true}}}} \ No newline at end of file +{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "basic"}]}, "children": {"var1": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var1"], "names": ["var1"], "descriptions": ["The first variable."], "multiple": true}, "var2": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var2"], "names": ["var2"], "descriptions": ["The second variable."], "multiple": true}, "var3": {"type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "basic"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var3"], "names": ["var3"], "descriptions": ["The third variable."], "multiple": true}, "var4": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var4"], "names": ["var4"], "descriptions": ["The forth variable."], "multiple": true}, "var5": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var5"], "names": ["var5"], "descriptions": ["The fifth variable."], "multiple": true}, "var6": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var6"], "names": ["var6"], "descriptions": ["The sixth variable."], "multiple": true}, "var7": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var7"], "names": ["var7"], "descriptions": ["The seventh variable."], "multiple": true}, "var8": {"type": "variable", "default": ["value"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var8"], "names": ["var8"], "descriptions": ["The eighth variable."], "multiple": true}}}} \ No newline at end of file diff --git a/tests/results/test_namespace/01_6string_multi.md b/tests/results/test_namespace/01_6string_multi.md index a694dbb..5934e94 100644 --- a/tests/results/test_namespace/01_6string_multi.md +++ b/tests/results/test_namespace/01_6string_multi.md @@ -8,7 +8,7 @@ include_toc: true |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **rougail.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The first variable. | | **rougail.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The second variable. | -| **rougail.var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The third variable. | +| **rougail.var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The third variable. | | **rougail.var4**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The forth variable.
**Default**: value | | **rougail.var5**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The fifth variable.
**Default**: value | | **rougail.var6**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The sixth variable.
**Default**: value | diff --git a/tests/results/test_namespace/01_6string_multi.sh b/tests/results/test_namespace/01_6string_multi.sh index a246d26..87258a7 100644 --- a/tests/results/test_namespace/01_6string_multi.sh +++ b/tests/results/test_namespace/01_6string_multi.sh @@ -25,7 +25,8 @@ string basic mandatory unique The second variable. multiple rougail.var3 - string basic mandatory The third variable. + string basic mandatory unique The third variable. + multiple rougail.var4 string standard mandatory unique The forth variable. multiple diff --git a/tests/results/test_namespace/16_6exists_family.adoc b/tests/results/test_namespace/16_6exists_family.adoc new file mode 100644 index 0000000..e69de29 diff --git a/tests/results/test_namespace/16_6exists_family.json b/tests/results/test_namespace/16_6exists_family.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/tests/results/test_namespace/16_6exists_family.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/tests/results/test_namespace/16_6exists_family.md b/tests/results/test_namespace/16_6exists_family.md new file mode 100644 index 0000000..3fc684d --- /dev/null +++ b/tests/results/test_namespace/16_6exists_family.md @@ -0,0 +1,4 @@ +--- +gitea: none +include_toc: true +--- diff --git a/tests/results/test_namespace/16_6exists_family.sh b/tests/results/test_namespace/16_6exists_family.sh new file mode 100644 index 0000000..e69de29 diff --git a/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.adoc b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.adoc new file mode 100644 index 0000000..7a96689 --- /dev/null +++ b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.adoc @@ -0,0 +1,72 @@ +== Variables for "Rougail" + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**rougail.var** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `unique` `multiple` | +A identifier variable. + +**Default**: + +* val1 +* val2 +|==== + +=== A dynamic family + +`standard` + +This family builds families dynamically. + +**Identifiers**: the value of the variable "rougail.var". + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**rougail.dyn__val1__.var** + +**rougail.dyn__val2__.var** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `unique` `multiple` | +A dynamic variable. +|==== + +==== a Second dynamic variable + +`standard` + +This family builds families dynamically. + +**Identifiers**: + +* the value of the variable "rougail.dyn__val1__.var" +* the value of the variable "rougail.dyn__val2__.var" + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**rougail.dyn__val1__.dyn___example__.var** + +**rougail.dyn__val2__.dyn___example__.var** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +A variable dynamic. + +**Default**: the value of the identifier. +| + +**rougail.dyn__val1__.dyn___example__.var_identifier** + +**rougail.dyn__val2__.dyn___example__.var_identifier** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +Identifier from first family. + +**Default**: the value of the identifier. +| + +**rougail.dyn__val1__.dyn___example__.var_identifiers** + +**rougail.dyn__val2__.dyn___example__.var_identifiers** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +Merge identifiers. + +**Default**: join identifier 1 et identifier 2. +|==== + diff --git a/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.json b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.json new file mode 100644 index 0000000..c85ac83 --- /dev/null +++ b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.json @@ -0,0 +1 @@ +{"rougail": {"type": "namespace", "informations": {"paths": ["rougail"], "names": ["rougail"], "description": "Rougail", "properties": [{"type": "mode", "name": "standard"}]}, "children": {"var": {"type": "variable", "default": ["val1", "val2"], "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "paths": ["rougail.var"], "names": ["var"], "descriptions": ["A identifier variable."], "multiple": true}, "dyn{{ identifier }}": {"type": "dynamic", "informations": {"paths": ["rougail.dynval1", "rougail.dynval2"], "names": ["dynval1", "dynval2"], "description": "A dynamic family", "properties": [{"type": "mode", "name": "standard"}], "identifiers": "the value of the variable \"rougail.var\".", "help": ["This family builds families dynamically."]}, "children": {"var": {"paths": ["rougail.dynval1.var", "rougail.dynval2.var"], "names": ["var", "var"], "type": "variable", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "unique"}, {"type": "multiple", "name": "multiple"}], "descriptions": ["A dynamic variable."], "multiple": true}, "dyn_{{ identifier }}": {"type": "dynamic", "informations": {"paths": ["rougail.dynval1.dyn_example", "rougail.dynval2.dyn_example"], "names": ["dyn_example", "dyn_example"], "description": "a Second dynamic variable", "properties": [{"type": "mode", "name": "standard"}], "identifiers": ["the value of the variable \"rougail.dynval1.var\"", "the value of the variable \"rougail.dynval2.var\""], "help": ["This family builds families dynamically."]}, "children": {"var": {"paths": ["rougail.dynval1.dyn_example.var", "rougail.dynval2.dyn_example.var"], "names": ["var", "var"], "type": "variable", "default": "the value of the identifier.", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "descriptions": ["A variable dynamic."]}, "var_identifier": {"paths": ["rougail.dynval1.dyn_example.var_identifier", "rougail.dynval2.dyn_example.var_identifier"], "names": ["var_identifier", "var_identifier"], "type": "variable", "default": "the value of the identifier.", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "descriptions": ["Identifier from first family."]}, "var_identifiers": {"paths": ["rougail.dynval1.dyn_example.var_identifiers", "rougail.dynval2.dyn_example.var_identifiers"], "names": ["var_identifiers", "var_identifiers"], "type": "variable", "default": "join identifier 1 et identifier 2.", "properties": [{"type": "type", "name": "string"}, {"type": "mode", "name": "standard"}, {"type": "property", "name": "mandatory"}], "descriptions": ["Merge identifiers."]}}}}}}}} \ No newline at end of file diff --git a/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.md b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.md new file mode 100644 index 0000000..ae6c032 --- /dev/null +++ b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.md @@ -0,0 +1,36 @@ +--- +gitea: none +include_toc: true +--- +# Variables for "Rougail" + +| Variable                                                                                                           | Description                                                                                                        | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | A identifier variable.
**Default**:
- val1
- val2 | + +## A dynamic family + +`standard` + +This family builds families dynamically. + +**Identifiers**: the value of the variable "rougail.var". + +| Variable                                                                                                           | Description                                                                                                        | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.dyn*val1*.var**
**rougail.dyn*val2*.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | A dynamic variable. | + +### a Second dynamic variable + +`standard` + +This family builds families dynamically. + +**Identifiers**:
- the value of the variable "rougail.dyn*val1*.var"
- the value of the variable "rougail.dyn*val2*.var" + +| Variable                                                                                                           | Description                                                                                                        | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.dyn*val1*.dyn_*example*.var**
**rougail.dyn*val2*.dyn_*example*.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable dynamic.
**Default**: the value of the identifier. | +| **rougail.dyn*val1*.dyn_*example*.var_identifier**
**rougail.dyn*val2*.dyn_*example*.var_identifier**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Identifier from first family.
**Default**: the value of the identifier. | +| **rougail.dyn*val1*.dyn_*example*.var_identifiers**
**rougail.dyn*val2*.dyn_*example*.var_identifiers**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Merge identifiers.
**Default**: join identifier 1 et identifier 2. | + diff --git a/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.sh b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.sh new file mode 100644 index 0000000..89e48bb --- /dev/null +++ b/tests/results/test_namespace/60_6family_dynamic_sub_dynamic_empty2.sh @@ -0,0 +1,76 @@ +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variables for "Rougail" ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + + + + +  Variable                               Description                            + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + rougail.var + string standard unique multiple A identifier variable. + Default: + + + • val1 + • val2 + | + + + A dynamic family + +standard + +This family builds families dynamically. + +Identifiers: the value of the variable "rougail.var". + + + + +  Variable                               Description                            + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + rougail.dynval1.var + rougail.dynval2.var + string standard unique multiple A dynamic variable. + + + a Second dynamic variable + +standard + +This family builds families dynamically. + +Identifiers: + + • the value of the variable "rougail.dynval1.var" + • the value of the variable "rougail.dynval2.var" + + + + + + + + + + + +  Variable                               Description                            + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + rougail.dynval1.dyn_example.var + rougail.dynval2.dyn_example.var + string standard mandatory A variable dynamic. + Default: the value of the + identifier. + rougail.dynval1.dyn_example.var_ide… + rougail.dynval2.dyn_example.var_ide… + string standard mandatory Identifier from first family. + Default: the value of the + identifier. + rougail.dynval1.dyn_example.var_ide… + rougail.dynval2.dyn_example.var_ide… + string standard mandatory Merge identifiers. + Default: join identifier 1 et + identifier 2. + diff --git a/tests/results/test_namespace_examples/00_9default_information_other_variable2.md b/tests/results/test_namespace_examples/00_9default_information_other_variable2.md new file mode 100644 index 0000000..59cda84 --- /dev/null +++ b/tests/results/test_namespace_examples/00_9default_information_other_variable2.md @@ -0,0 +1,26 @@ +--- +gitea: none +include_toc: true +--- +# Variables for "Rougail" + +| Variable                                                                                                   | Description                                                                                                | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A first variable. | +| **rougail.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A second variable.
**Default**: the value of the information "test_information" of the variable "rougail.var1". | + +# Example with mandatory variables not filled in + +```yaml +--- +rougail: + var1: example +``` +# Example with all variables modifiable + +```yaml +--- +rougail: + var1: example + var2: example +``` diff --git a/tests/results/test_namespace_examples/00_9extra_ouside.md b/tests/results/test_namespace_examples/00_9extra_ouside.md new file mode 100644 index 0000000..da5aa17 --- /dev/null +++ b/tests/results/test_namespace_examples/00_9extra_ouside.md @@ -0,0 +1,25 @@ +--- +gitea: none +include_toc: true +--- +# Variables for "Rougail" + +| Variable                                                                                                   | Description                                                                                                | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.variable**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable.
**Default**: the value of the variable "extra.variable". | + +# Variables for "extra" + +| Variable                                                                                                   | Description                                                                                                | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **extra.variable**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable.
**Default**: value in extra | + +# Example with all variables modifiable + +```yaml +--- +rougail: + variable: value in extra +extra: + variable: value in extra +``` diff --git a/tests/results/test_namespace_examples/01_6string_multi.md b/tests/results/test_namespace_examples/01_6string_multi.md index c1b098a..e3b355e 100644 --- a/tests/results/test_namespace_examples/01_6string_multi.md +++ b/tests/results/test_namespace_examples/01_6string_multi.md @@ -8,7 +8,7 @@ include_toc: true |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **rougail.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The first variable. | | **rougail.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The second variable. | -| **rougail.var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The third variable. | +| **rougail.var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` `unique` `multiple` | The third variable. | | **rougail.var4**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The forth variable.
**Default**: value | | **rougail.var5**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The fifth variable.
**Default**: value | | **rougail.var6**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` `unique` `multiple` | The sixth variable.
**Default**: value | @@ -24,7 +24,8 @@ rougail: - example var2: - example - var3: example + var3: + - example ``` # Example with all variables modifiable @@ -35,7 +36,8 @@ rougail: - example var2: - example - var3: example + var3: + - example var4: - value var5: diff --git a/tests/results/test_namespace_examples/16_6exists_family.md b/tests/results/test_namespace_examples/16_6exists_family.md new file mode 100644 index 0000000..3fc684d --- /dev/null +++ b/tests/results/test_namespace_examples/16_6exists_family.md @@ -0,0 +1,4 @@ +--- +gitea: none +include_toc: true +--- diff --git a/tests/results/test_namespace_examples/60_6family_dynamic_sub_dynamic_empty2.md b/tests/results/test_namespace_examples/60_6family_dynamic_sub_dynamic_empty2.md new file mode 100644 index 0000000..2c3543d --- /dev/null +++ b/tests/results/test_namespace_examples/60_6family_dynamic_sub_dynamic_empty2.md @@ -0,0 +1,59 @@ +--- +gitea: none +include_toc: true +--- +# Variables for "Rougail" + +| Variable                                                                                                           | Description                                                                                                        | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | A identifier variable.
**Default**:
- val1
- val2 | + +## A dynamic family + +`standard` + +This family builds families dynamically. + +**Identifiers**: the value of the variable "rougail.var". + +| Variable                                                                                                           | Description                                                                                                        | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.dyn*val1*.var**
**rougail.dyn*val2*.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | A dynamic variable. | + +### a Second dynamic variable + +`standard` + +This family builds families dynamically. + +**Identifiers**:
- the value of the variable "rougail.dyn*val1*.var"
- the value of the variable "rougail.dyn*val2*.var" + +| Variable                                                                                                           | Description                                                                                                        | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.dyn*val1*.dyn_*example*.var**
**rougail.dyn*val2*.dyn_*example*.var**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable dynamic.
**Default**: the value of the identifier. | +| **rougail.dyn*val1*.dyn_*example*.var_identifier**
**rougail.dyn*val2*.dyn_*example*.var_identifier**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Identifier from first family.
**Default**: the value of the identifier. | +| **rougail.dyn*val1*.dyn_*example*.var_identifiers**
**rougail.dyn*val2*.dyn_*example*.var_identifiers**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Merge identifiers.
**Default**: join identifier 1 et identifier 2. | + +# Example with all variables modifiable + +```yaml +--- +rougail: + var: + - val1 + - val2 + dynval1: + var: + - example + dyn_example: + var: example + var_identifier: val1 + var_identifiers: val1-example + dynval2: + var: + - example + dyn_example: + var: example + var_identifier: val2 + var_identifiers: val2-example +``` diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py new file mode 100644 index 0000000..4dc98e9 --- /dev/null +++ b/tests/test_cmdline.py @@ -0,0 +1,27 @@ +from pathlib import Path +from rougail import Rougail +from rougail.config import get_rougail_config +from rougail.output_doc import RougailOutputDoc + + +def test_force_optional(): + print('FIXME') +# test_dir = Path(__file__).resolve().parent +# rougailconfig = get_rougail_config(backward_compatibility=False) +# rougailconfig['step.output'] = 'doc' +## rougailconfig['tiramisu_cache'] = 'p.py' +# dirs = [str(test_dir / 'cmdline')] +# rougailconfig['plugins'] = ["structural_commandline"] +# rougailconfig['main_dictionaries'] = dirs +# rougailconfig['doc.output_format'] = 'asciidoc' +# rougail = Rougail(rougailconfig) +# config = rougail.run() +# inventory = RougailOutputDoc(config, rougailconfig=rougailconfig) +# doc = inventory.run() +# result_file = test_dir / 'cmdline.adoc' +# if not result_file.is_file(): +# with open(str(result_file), 'w') as docfh: +# docfh.write(doc) +# with open(str(result_file)) as docfh: +# result = docfh.read() +# assert doc == result diff --git a/tests/test_force_optional.py b/tests/test_force_optional.py index cb9ee4e..e6594b1 100644 --- a/tests/test_force_optional.py +++ b/tests/test_force_optional.py @@ -1,4 +1,5 @@ from pathlib import Path +from rougail import Rougail from rougail.config import get_rougail_config from rougail.output_doc import RougailOutputDoc @@ -12,8 +13,10 @@ def test_force_optional(): dirs = [str(test_dir / 'force_optional')] rougailconfig['main_dictionaries'] = dirs rougailconfig['doc.output_format'] = 'asciidoc' - inventory = RougailOutputDoc(rougailconfig=rougailconfig) - doc = inventory.gen_doc() + rougail = Rougail(rougailconfig) + config = rougail.run() + inventory = RougailOutputDoc(config, rougailconfig=rougailconfig) + doc = inventory.run() result_file = test_dir / 'force_optional.adoc' if not result_file.is_file(): with open(str(result_file), 'w') as docfh: diff --git a/tests/test_load.py b/tests/test_load.py index 77b62f5..0972607 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/00_0version_underscore')] +# test_ok = [Path('../rougail-tests/structures/60_6family_dynamic_sub_dynamic_empty2')] os.environ['COLUMNS'] = '80' diff --git a/tests/test_mode.py b/tests/test_mode.py index e124c6b..4332844 100644 --- a/tests/test_mode.py +++ b/tests/test_mode.py @@ -1,4 +1,5 @@ from pathlib import Path +from rougail import Rougail from rougail.config import get_rougail_config from rougail.output_doc import RougailOutputDoc @@ -13,8 +14,10 @@ def _test(modes): rougailconfig['main_dictionaries'] = dirs rougailconfig['doc.output_format'] = 'asciidoc' rougailconfig['doc.disabled_modes'] = modes - inventory = RougailOutputDoc(rougailconfig=rougailconfig) - doc = inventory.gen_doc() + rougail = Rougail(rougailconfig) + config = rougail.run() + inventory = RougailOutputDoc(config, rougailconfig=rougailconfig) + doc = inventory.run() result_file = test_dir / f'mode_{"_".join(modes)}.adoc' if not result_file.is_file(): with open(str(result_file), 'w') as docfh: