diff --git a/src/rougail/output_doc/doc.py b/src/rougail/output_doc/doc.py index ed2024cd9..bff0a4e2a 100644 --- a/src/rougail/output_doc/doc.py +++ b/src/rougail/output_doc/doc.py @@ -588,7 +588,7 @@ class RougailOutputDoc(Examples): all_is_undocumented = None for idx, path in enumerate(informations["paths"]): if self._is_inaccessible_user_data(self.conf.option(path)): - msg = true_msg.format(get_display_path(informations, index)) + msg = true_msg.format(get_display_path(informations, idx)) all_is_undocumented = False else: if all_is_undocumented is None: diff --git a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.adoc b/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.adoc new file mode 100644 index 000000000..de37f00ad --- /dev/null +++ b/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.adoc @@ -0,0 +1,19 @@ +[cols="1a,1a"] +|==== +| Variable | Description +| + +**var1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `unique` `multiple` | +A suffix variable. + +**Examples**: + +* val1 +* val2 +| + +**var2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +A variable calculated. +|==== + diff --git a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.json b/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.json new file mode 100644 index 000000000..c16e97411 --- /dev/null +++ b/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.json @@ -0,0 +1,62 @@ +{ + "var1": { + "type": "variable", + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "unique" + }, + { + "type": "multiple", + "name": "multiple" + } + ], + "paths": [ + "var1" + ], + "names": [ + "var1" + ], + "descriptions": [ + "A suffix variable." + ], + "examples": [ + "val1", + "val2" + ] + }, + "var2": { + "type": "variable", + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "mandatory" + } + ], + "paths": [ + "var2" + ], + "names": [ + "var2" + ], + "descriptions": [ + "A variable calculated." + ] + } +} \ No newline at end of file diff --git a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.md b/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.md new file mode 100644 index 000000000..b5e0fff13 --- /dev/null +++ b/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.md @@ -0,0 +1,5 @@ +| Variable                                                                                                           | Description                                                                                                        | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | A suffix variable.
**Examples**:
- val1
- val2 | +| **var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable calculated. | + diff --git a/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.sh b/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.sh new file mode 100644 index 000000000..261f9b263 --- /dev/null +++ b/tests/results/test/60_5family_dynamic_calc_suffix_disabled2.sh @@ -0,0 +1,11 @@ +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variable  ┃ Description  ┃ +┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ +│ var1 │ A suffix variable. │ +│  string   standard   unique    │ Examples: │ +│ multiple  │ - val1 │ +│ │ - val2 │ +├───────────────────────────────────────┼──────────────────────────────────────┤ +│ var2 │ A variable calculated. │ +│  string   standard   mandatory  │ │ +└───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test_examples/60_5family_dynamic_calc_suffix_disabled2.md b/tests/results/test_examples/60_5family_dynamic_calc_suffix_disabled2.md new file mode 100644 index 000000000..2d1647afc --- /dev/null +++ b/tests/results/test_examples/60_5family_dynamic_calc_suffix_disabled2.md @@ -0,0 +1,15 @@ +# Example with mandatory variables not filled in + +```yaml +--- +var2: example +``` +# Example with all variables modifiable + +```yaml +--- +var1: + - val1 + - val2 +var2: example +``` diff --git a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.adoc b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.adoc new file mode 100644 index 000000000..ee0e3d132 --- /dev/null +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.adoc @@ -0,0 +1,25 @@ +== Variables for "Rougail" + +[cols="1a,1a"] +|==== +| Variable | Description +| + +**rougail.var1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `unique` `multiple` | +A suffix variable. + +**Examples**: + +* val1 +* val2 +| + +**rougail.var2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` | +A variable calculated. + +**Default**: + +* the value of the variable "rougail.dyn__val1__.var" +* the value of the variable "rougail.dyn__val2__.var" +|==== + diff --git a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.json b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.json new file mode 100644 index 000000000..eb8ddbed9 --- /dev/null +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.json @@ -0,0 +1,86 @@ +{ + "rougail": { + "type": "namespace", + "informations": { + "paths": [ + "rougail" + ], + "names": [ + "rougail" + ], + "description": "Rougail", + "properties": [ + { + "type": "mode", + "name": "basic" + } + ] + }, + "children": { + "rougail.var1": { + "type": "variable", + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "unique" + }, + { + "type": "multiple", + "name": "multiple" + } + ], + "paths": [ + "rougail.var1" + ], + "names": [ + "var1" + ], + "descriptions": [ + "A suffix variable." + ], + "examples": [ + "val1", + "val2" + ] + }, + "rougail.var2": { + "type": "variable", + "default": [ + "the value of the variable \"rougail.dynval1.var\"", + "the value of the variable \"rougail.dynval2.var\"" + ], + "properties": [ + { + "type": "type", + "name": "string" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "mandatory" + } + ], + "paths": [ + "rougail.var2" + ], + "names": [ + "var2" + ], + "descriptions": [ + "A variable calculated." + ] + } + } + } +} \ No newline at end of file diff --git a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.md b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.md new file mode 100644 index 000000000..846cef2e5 --- /dev/null +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.md @@ -0,0 +1,7 @@ +# Variables for "Rougail" + +| Variable                                                                                                           | Description                                                                                                        | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **rougail.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `unique` `multiple` | A suffix variable.
**Examples**:
- val1
- val2 | +| **rougail.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A variable calculated.
**Default**:
- the value of the variable "rougail.dyn*val1*.var"
- the value of the variable "rougail.dyn*val2*.var" | + diff --git a/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.sh b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.sh new file mode 100644 index 000000000..1342d0435 --- /dev/null +++ b/tests/results/test_namespace/60_5family_dynamic_calc_suffix_disabled2.sh @@ -0,0 +1,20 @@ + + +Variables for "Rougail" + + +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Variable  ┃ Description  ┃ +┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ +│ rougail.var1 │ A suffix variable. │ +│  string   standard   unique    │ Examples: │ +│ multiple  │ - val1 │ +│ │ - val2 │ +├───────────────────────────────────────┼──────────────────────────────────────┤ +│ rougail.var2 │ A variable calculated. │ +│  string   standard   mandatory  │ Default: │ +│ │ - the value of the variable │ +│ │ "rougail.dynval1.var" │ +│ │ - the value of the variable │ +│ │ "rougail.dynval2.var" │ +└───────────────────────────────────────┴──────────────────────────────────────┘ diff --git a/tests/results/test_namespace_examples/60_5family_dynamic_calc_suffix_disabled2.md b/tests/results/test_namespace_examples/60_5family_dynamic_calc_suffix_disabled2.md new file mode 100644 index 000000000..0d65ad3f9 --- /dev/null +++ b/tests/results/test_namespace_examples/60_5family_dynamic_calc_suffix_disabled2.md @@ -0,0 +1,10 @@ +# Example with all variables modifiable + +```yaml +--- +rougail: + var1: + - val1 + - val2 + var2: example +``` diff --git a/tests/test_load.py b/tests/test_load.py index 4337f1d89..6ad648fda 100644 --- a/tests/test_load.py +++ b/tests/test_load.py @@ -14,7 +14,7 @@ excludes = [ ] test_ok = get_structures_list(excludes) -# test_ok = [Path('../rougail-tests/structures/60_9family_dynamic_calc_both')] +# test_ok = [Path('../rougail-tests/structures/60_5family_dynamic_calc_suffix_disabled2')] os.environ['COLUMNS'] = '80'