diff --git a/src/rougail/output_doc/annotator.py b/src/rougail/output_doc/annotator.py
index 8e33d5718..4f09cb357 100644
--- a/src/rougail/output_doc/annotator.py
+++ b/src/rougail/output_doc/annotator.py
@@ -38,7 +38,6 @@ from rougail.object_model import (
CONVERT_OPTION,
PROPERTY_ATTRIBUTE,
)
-from rougail.output_doc.utils import dump
class Annotator(Walk):
@@ -289,18 +288,16 @@ class Annotator(Walk):
# get comparative value
if values.when_not is not undefined:
value = values.when_not
- msg = _('when the variable "{0}" hasn\'t the value "{1}"')
+ condition = "when_not"
+ elif values.when is not undefined:
+ value = values.when
+ condition = "when"
else:
- if values.when is not undefined:
- value = values.when
- else:
- value = True
- msg = _('when the variable "{0}" has the value "{1}"')
- if not isinstance(value, str):
- value = dump(value)
+ value = True
+ condition = "when"
# set message
- values_calculation = msg.format(variable_path, value)
+ values_calculation = (variable_path, value, condition)
else:
values_calculation = variable_path
diff --git a/src/rougail/output_doc/doc.py b/src/rougail/output_doc/doc.py
index 56ba54866..9a17324a8 100644
--- a/src/rougail/output_doc/doc.py
+++ b/src/rougail/output_doc/doc.py
@@ -1,7 +1,7 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2024-2025
-
+
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
@@ -28,7 +28,7 @@ from rougail.object_model import PROPERTY_ATTRIBUTE
from .config import OutPuts
from .i18n import _
-from .utils import DocTypes, get_display_path
+from .utils import DocTypes, get_display_path, dump
from .example import Examples
@@ -168,6 +168,20 @@ class RougailOutputDoc(Examples):
]: # chain(["hidden", "disabled"], self.disabled_modes):
if hidden_property in properties:
return True
+
+ calculation = child.information.get(f"{hidden_property}_calculation", None)
+ if calculation and calculation['type'] == 'variable':
+ variable_path, value, condition = calculation["value"]
+ variable = self.conf.forcepermissive.option(variable_path)
+ try:
+ variable_value = variable.value.get()
+ except AttributeError as err:
+ pass
+ else:
+ uncalculated = variable.value.get(uncalculated=True)
+ if not isinstance(uncalculated, Calculation) and self._is_inaccessible_user_data(variable) and (condition == 'when' and value == variable_value or
+ condition == 'when_not' and value != variable_value):
+ return True
if not child.isoptiondescription():
for hidden_property in self.disabled_modes:
if hidden_property in properties:
@@ -498,10 +512,13 @@ class RougailOutputDoc(Examples):
"name": msg,
}
elif variable.information.get(f"{prop}_calculation", False):
+ annotation = self._to_string(variable, prop)
+ if not annotation:
+ continue
prop_obj = {
"type": "property",
"name": msg,
- "annotation": self._to_string(variable, prop),
+ "annotation": annotation,
}
else:
continue
@@ -547,7 +564,7 @@ class RougailOutputDoc(Examples):
return values
return self._calculation_to_string(variable, calculation, prop)
- def _calculation_to_string(self, variable, calculation, prop):
+ def _calculation_to_string(self, child, calculation, prop):
if "type" not in calculation:
return calculation["value"]
if calculation["type"] == "jinja":
@@ -559,13 +576,32 @@ class RougailOutputDoc(Examples):
'"{0}" is a calculation for {1} but has no description in {2}'
).format(
prop,
- variable.path(),
- display_xmlfiles(variable.information.get("ymlfiles")),
+ child.path(),
+ display_xmlfiles(child.information.get("ymlfiles")),
)
warn(warning)
elif calculation["type"] == "variable":
if prop in PROPERTY_ATTRIBUTE:
- values = calculation["value"]
+ variable_path, value, condition = calculation["value"]
+ variable = self.conf.forcepermissive.option(variable_path)
+ try:
+ variable.value.get()
+ except AttributeError as err:
+ pass
+ variable = None
+ else:
+ uncalculated = variable.value.get(uncalculated=True)
+ if not isinstance(uncalculated, Calculation) and self._is_inaccessible_user_data(variable):
+ return None
+ if variable and self._is_inaccessible_user_data(variable):
+ msg = _("depends on an undocumented variable")
+ elif condition == "when_not":
+ msg = _('when the variable "{0}" hasn\'t the value "{1}"')
+ else:
+ msg = _('when the variable "{0}" has the value "{1}"')
+ if not isinstance(value, str):
+ value = dump(value)
+ values = msg.format(variable_path, value)
else:
if calculation.get("optional", False):
path = calculation["value"]
diff --git a/tests/results/test/04_1default_calculation_hidden_3.adoc b/tests/results/test/04_1default_calculation_hidden_3.adoc
new file mode 100644
index 000000000..857be9f4f
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_3.adoc
@@ -0,0 +1,11 @@
+[cols="1a,1a"]
+|====
+| Variable | Description
+|
+
+**var3** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
+A third variable. +
+**Default**: depends on a calculation.
+|====
+
diff --git a/tests/results/test/04_1default_calculation_hidden_3.json b/tests/results/test/04_1default_calculation_hidden_3.json
new file mode 100644
index 000000000..ca1be1f52
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_3.json
@@ -0,0 +1,29 @@
+{
+ "var3": {
+ "type": "variable",
+ "default": "depends on a calculation.",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "standard"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ }
+ ],
+ "paths": [
+ "var3"
+ ],
+ "names": [
+ "var3"
+ ],
+ "descriptions": [
+ "A third variable."
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/results/test/04_1default_calculation_hidden_3.md b/tests/results/test/04_1default_calculation_hidden_3.md
new file mode 100644
index 000000000..43ceecb65
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_3.md
@@ -0,0 +1,4 @@
+| Variable | Description |
+|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A third variable.
**Default**: depends on a calculation. |
+
diff --git a/tests/results/test/04_1default_calculation_hidden_3.sh b/tests/results/test/04_1default_calculation_hidden_3.sh
new file mode 100644
index 000000000..b3e81aa7a
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_3.sh
@@ -0,0 +1,6 @@
+┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
+┃[1m [0m[1mVariable [0m[1m [0m┃[1m [0m[1mDescription [0m[1m [0m┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
+│ [1mvar3[0m │ A third variable. │
+│ [1;7m string [0m [1;7m standard [0m [1;7m mandatory [0m │ [1mDefault[0m: depends on a calculation. │
+└───────────────────────────────────────┴──────────────────────────────────────┘
diff --git a/tests/results/test/04_1default_calculation_hidden_4.adoc b/tests/results/test/04_1default_calculation_hidden_4.adoc
new file mode 100644
index 000000000..c511a0698
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_4.adoc
@@ -0,0 +1,16 @@
+[cols="1a,1a"]
+|====
+| Variable | Description
+|
+
+**var2** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` |
+A second variable.
+|
+
+**var3** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
+A third variable. +
+**Default**: depends on a calculation.
+|====
+
diff --git a/tests/results/test/04_1default_calculation_hidden_4.json b/tests/results/test/04_1default_calculation_hidden_4.json
new file mode 100644
index 000000000..47cd980fa
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_4.json
@@ -0,0 +1,55 @@
+{
+ "var2": {
+ "type": "variable",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "basic"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ }
+ ],
+ "paths": [
+ "var2"
+ ],
+ "names": [
+ "var2"
+ ],
+ "descriptions": [
+ "A second variable."
+ ]
+ },
+ "var3": {
+ "type": "variable",
+ "default": "depends on a calculation.",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "standard"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ }
+ ],
+ "paths": [
+ "var3"
+ ],
+ "names": [
+ "var3"
+ ],
+ "descriptions": [
+ "A third variable."
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/results/test/04_1default_calculation_hidden_4.md b/tests/results/test/04_1default_calculation_hidden_4.md
new file mode 100644
index 000000000..404eaaa6d
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_4.md
@@ -0,0 +1,5 @@
+| Variable | Description |
+|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A second variable. |
+| **var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A third variable.
**Default**: depends on a calculation. |
+
diff --git a/tests/results/test/04_1default_calculation_hidden_4.sh b/tests/results/test/04_1default_calculation_hidden_4.sh
new file mode 100644
index 000000000..6df71a2f1
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_4.sh
@@ -0,0 +1,9 @@
+┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
+┃[1m [0m[1mVariable [0m[1m [0m┃[1m [0m[1mDescription [0m[1m [0m┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
+│ [1mvar2[0m │ A second variable. │
+│ [1;7m string [0m [1;7m basic [0m [1;7m mandatory [0m │ │
+├───────────────────────────────────────┼──────────────────────────────────────┤
+│ [1mvar3[0m │ A third variable. │
+│ [1;7m string [0m [1;7m standard [0m [1;7m mandatory [0m │ [1mDefault[0m: depends on a calculation. │
+└───────────────────────────────────────┴──────────────────────────────────────┘
diff --git a/tests/results/test/04_1default_calculation_hidden_5.adoc b/tests/results/test/04_1default_calculation_hidden_5.adoc
new file mode 100644
index 000000000..9b17eeb43
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_5.adoc
@@ -0,0 +1,17 @@
+[cols="1a,1a"]
+|====
+| Variable | Description
+|
+
+**var1** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
+A first variable. +
+**Default**: value
+|
+
+**var3** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` |
+A third variable. +
+**Disabled**: depends on an undocumented variable.
+|====
+
diff --git a/tests/results/test/04_1default_calculation_hidden_5.json b/tests/results/test/04_1default_calculation_hidden_5.json
new file mode 100644
index 000000000..ac08b08a9
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_5.json
@@ -0,0 +1,60 @@
+{
+ "var1": {
+ "type": "variable",
+ "default": "value",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "standard"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ }
+ ],
+ "paths": [
+ "var1"
+ ],
+ "names": [
+ "var1"
+ ],
+ "descriptions": [
+ "A first variable."
+ ]
+ },
+ "var3": {
+ "type": "variable",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "basic"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ },
+ {
+ "type": "property",
+ "name": "disabled",
+ "annotation": "depends on an undocumented variable."
+ }
+ ],
+ "paths": [
+ "var3"
+ ],
+ "names": [
+ "var3"
+ ],
+ "descriptions": [
+ "A third variable."
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/results/test/04_1default_calculation_hidden_5.md b/tests/results/test/04_1default_calculation_hidden_5.md
new file mode 100644
index 000000000..2fc395a9d
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_5.md
@@ -0,0 +1,5 @@
+| Variable | Description |
+|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A first variable.
**Default**: value |
+| **var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` *`disabled`* | A third variable.
**Disabled**: depends on an undocumented variable. |
+
diff --git a/tests/results/test/04_1default_calculation_hidden_5.sh b/tests/results/test/04_1default_calculation_hidden_5.sh
new file mode 100644
index 000000000..69fdac064
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_5.sh
@@ -0,0 +1,10 @@
+┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
+┃[1m [0m[1mVariable [0m[1m [0m┃[1m [0m[1mDescription [0m[1m [0m┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
+│ [1mvar1[0m │ A first variable. │
+│ [1;7m string [0m [1;7m standard [0m [1;7m mandatory [0m │ [1mDefault[0m: value │
+├───────────────────────────────────────┼──────────────────────────────────────┤
+│ [1mvar3[0m │ A third variable. │
+│ [1;7m string [0m [1;7m basic [0m [1;7m mandatory [0m [1;3;7m [0m │ [1mDisabled[0m: depends on an undocumented │
+│ [1;3;7mdisabled [0m │ variable. │
+└───────────────────────────────────────┴──────────────────────────────────────┘
diff --git a/tests/results/test/04_1default_calculation_hidden_6.adoc b/tests/results/test/04_1default_calculation_hidden_6.adoc
new file mode 100644
index 000000000..9b17eeb43
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_6.adoc
@@ -0,0 +1,17 @@
+[cols="1a,1a"]
+|====
+| Variable | Description
+|
+
+**var1** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
+A first variable. +
+**Default**: value
+|
+
+**var3** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` |
+A third variable. +
+**Disabled**: depends on an undocumented variable.
+|====
+
diff --git a/tests/results/test/04_1default_calculation_hidden_6.json b/tests/results/test/04_1default_calculation_hidden_6.json
new file mode 100644
index 000000000..ac08b08a9
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_6.json
@@ -0,0 +1,60 @@
+{
+ "var1": {
+ "type": "variable",
+ "default": "value",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "standard"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ }
+ ],
+ "paths": [
+ "var1"
+ ],
+ "names": [
+ "var1"
+ ],
+ "descriptions": [
+ "A first variable."
+ ]
+ },
+ "var3": {
+ "type": "variable",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "basic"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ },
+ {
+ "type": "property",
+ "name": "disabled",
+ "annotation": "depends on an undocumented variable."
+ }
+ ],
+ "paths": [
+ "var3"
+ ],
+ "names": [
+ "var3"
+ ],
+ "descriptions": [
+ "A third variable."
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/results/test/04_1default_calculation_hidden_6.md b/tests/results/test/04_1default_calculation_hidden_6.md
new file mode 100644
index 000000000..2fc395a9d
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_6.md
@@ -0,0 +1,5 @@
+| Variable | Description |
+|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A first variable.
**Default**: value |
+| **var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` *`disabled`* | A third variable.
**Disabled**: depends on an undocumented variable. |
+
diff --git a/tests/results/test/04_1default_calculation_hidden_6.sh b/tests/results/test/04_1default_calculation_hidden_6.sh
new file mode 100644
index 000000000..69fdac064
--- /dev/null
+++ b/tests/results/test/04_1default_calculation_hidden_6.sh
@@ -0,0 +1,10 @@
+┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
+┃[1m [0m[1mVariable [0m[1m [0m┃[1m [0m[1mDescription [0m[1m [0m┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
+│ [1mvar1[0m │ A first variable. │
+│ [1;7m string [0m [1;7m standard [0m [1;7m mandatory [0m │ [1mDefault[0m: value │
+├───────────────────────────────────────┼──────────────────────────────────────┤
+│ [1mvar3[0m │ A third variable. │
+│ [1;7m string [0m [1;7m basic [0m [1;7m mandatory [0m [1;3;7m [0m │ [1mDisabled[0m: depends on an undocumented │
+│ [1;3;7mdisabled [0m │ variable. │
+└───────────────────────────────────────┴──────────────────────────────────────┘
diff --git a/tests/results/test_examples/04_1default_calculation_hidden_3.md b/tests/results/test_examples/04_1default_calculation_hidden_3.md
new file mode 100644
index 000000000..f4a1fabd7
--- /dev/null
+++ b/tests/results/test_examples/04_1default_calculation_hidden_3.md
@@ -0,0 +1,6 @@
+# Example with all variables modifiable
+
+```yaml
+---
+var3: value
+```
diff --git a/tests/results/test_examples/04_1default_calculation_hidden_4.md b/tests/results/test_examples/04_1default_calculation_hidden_4.md
new file mode 100644
index 000000000..e3dad7586
--- /dev/null
+++ b/tests/results/test_examples/04_1default_calculation_hidden_4.md
@@ -0,0 +1,13 @@
+# Example with mandatory variables not filled in
+
+```yaml
+---
+var2: example
+```
+# Example with all variables modifiable
+
+```yaml
+---
+var2: example
+var3: value
+```
diff --git a/tests/results/test_examples/04_1default_calculation_hidden_5.md b/tests/results/test_examples/04_1default_calculation_hidden_5.md
new file mode 100644
index 000000000..54b22484d
--- /dev/null
+++ b/tests/results/test_examples/04_1default_calculation_hidden_5.md
@@ -0,0 +1,13 @@
+# Example with mandatory variables not filled in
+
+```yaml
+---
+var3: example
+```
+# Example with all variables modifiable
+
+```yaml
+---
+var1: value
+var3: example
+```
diff --git a/tests/results/test_examples/04_1default_calculation_hidden_6.md b/tests/results/test_examples/04_1default_calculation_hidden_6.md
new file mode 100644
index 000000000..54b22484d
--- /dev/null
+++ b/tests/results/test_examples/04_1default_calculation_hidden_6.md
@@ -0,0 +1,13 @@
+# Example with mandatory variables not filled in
+
+```yaml
+---
+var3: example
+```
+# Example with all variables modifiable
+
+```yaml
+---
+var1: value
+var3: example
+```
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_3.adoc b/tests/results/test_namespace/04_1default_calculation_hidden_3.adoc
new file mode 100644
index 000000000..0db856674
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_3.adoc
@@ -0,0 +1,13 @@
+== Variables for "Rougail"
+
+[cols="1a,1a"]
+|====
+| Variable | Description
+|
+
+**rougail.var3** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
+A third variable. +
+**Default**: depends on a calculation.
+|====
+
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_3.json b/tests/results/test_namespace/04_1default_calculation_hidden_3.json
new file mode 100644
index 000000000..46227174c
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_3.json
@@ -0,0 +1,49 @@
+{
+ "rougail": {
+ "type": "namespace",
+ "informations": {
+ "paths": [
+ "rougail"
+ ],
+ "names": [
+ "rougail"
+ ],
+ "description": "Rougail",
+ "properties": [
+ {
+ "type": "mode",
+ "name": "basic"
+ }
+ ]
+ },
+ "children": {
+ "rougail.var3": {
+ "type": "variable",
+ "default": "depends on a calculation.",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "standard"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ }
+ ],
+ "paths": [
+ "rougail.var3"
+ ],
+ "names": [
+ "var3"
+ ],
+ "descriptions": [
+ "A third variable."
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_3.md b/tests/results/test_namespace/04_1default_calculation_hidden_3.md
new file mode 100644
index 000000000..158817a44
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_3.md
@@ -0,0 +1,6 @@
+# Variables for "Rougail"
+
+| Variable | Description |
+|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **rougail.var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A third variable.
**Default**: depends on a calculation. |
+
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_3.sh b/tests/results/test_namespace/04_1default_calculation_hidden_3.sh
new file mode 100644
index 000000000..78a873524
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_3.sh
@@ -0,0 +1,11 @@
+
+
+[1;4;96mVariables for [0m[1;4;96m"Rougail"[0m
+
+
+┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
+┃[1m [0m[1mVariable [0m[1m [0m┃[1m [0m[1mDescription [0m[1m [0m┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
+│ [1mrougail.var3[0m │ A third variable. │
+│ [1;7m string [0m [1;7m standard [0m [1;7m mandatory [0m │ [1mDefault[0m: depends on a calculation. │
+└───────────────────────────────────────┴──────────────────────────────────────┘
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_4.adoc b/tests/results/test_namespace/04_1default_calculation_hidden_4.adoc
new file mode 100644
index 000000000..b05f6b1f6
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_4.adoc
@@ -0,0 +1,18 @@
+== Variables for "Rougail"
+
+[cols="1a,1a"]
+|====
+| Variable | Description
+|
+
+**rougail.var2** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` |
+A second variable.
+|
+
+**rougail.var3** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
+A third variable. +
+**Default**: depends on a calculation.
+|====
+
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_4.json b/tests/results/test_namespace/04_1default_calculation_hidden_4.json
new file mode 100644
index 000000000..c28666ac0
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_4.json
@@ -0,0 +1,75 @@
+{
+ "rougail": {
+ "type": "namespace",
+ "informations": {
+ "paths": [
+ "rougail"
+ ],
+ "names": [
+ "rougail"
+ ],
+ "description": "Rougail",
+ "properties": [
+ {
+ "type": "mode",
+ "name": "basic"
+ }
+ ]
+ },
+ "children": {
+ "rougail.var2": {
+ "type": "variable",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "basic"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ }
+ ],
+ "paths": [
+ "rougail.var2"
+ ],
+ "names": [
+ "var2"
+ ],
+ "descriptions": [
+ "A second variable."
+ ]
+ },
+ "rougail.var3": {
+ "type": "variable",
+ "default": "depends on a calculation.",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "standard"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ }
+ ],
+ "paths": [
+ "rougail.var3"
+ ],
+ "names": [
+ "var3"
+ ],
+ "descriptions": [
+ "A third variable."
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_4.md b/tests/results/test_namespace/04_1default_calculation_hidden_4.md
new file mode 100644
index 000000000..577e80667
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_4.md
@@ -0,0 +1,7 @@
+# Variables for "Rougail"
+
+| Variable | Description |
+|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **rougail.var2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A second variable. |
+| **rougail.var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A third variable.
**Default**: depends on a calculation. |
+
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_4.sh b/tests/results/test_namespace/04_1default_calculation_hidden_4.sh
new file mode 100644
index 000000000..5119b7240
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_4.sh
@@ -0,0 +1,14 @@
+
+
+[1;4;96mVariables for [0m[1;4;96m"Rougail"[0m
+
+
+┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
+┃[1m [0m[1mVariable [0m[1m [0m┃[1m [0m[1mDescription [0m[1m [0m┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
+│ [1mrougail.var2[0m │ A second variable. │
+│ [1;7m string [0m [1;7m basic [0m [1;7m mandatory [0m │ │
+├───────────────────────────────────────┼──────────────────────────────────────┤
+│ [1mrougail.var3[0m │ A third variable. │
+│ [1;7m string [0m [1;7m standard [0m [1;7m mandatory [0m │ [1mDefault[0m: depends on a calculation. │
+└───────────────────────────────────────┴──────────────────────────────────────┘
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_5.adoc b/tests/results/test_namespace/04_1default_calculation_hidden_5.adoc
new file mode 100644
index 000000000..8d377100e
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_5.adoc
@@ -0,0 +1,19 @@
+== Variables for "Rougail"
+
+[cols="1a,1a"]
+|====
+| Variable | Description
+|
+
+**rougail.var1** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
+A first variable. +
+**Default**: value
+|
+
+**rougail.var3** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` |
+A third variable. +
+**Disabled**: depends on an undocumented variable.
+|====
+
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_5.json b/tests/results/test_namespace/04_1default_calculation_hidden_5.json
new file mode 100644
index 000000000..e6202f27b
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_5.json
@@ -0,0 +1,80 @@
+{
+ "rougail": {
+ "type": "namespace",
+ "informations": {
+ "paths": [
+ "rougail"
+ ],
+ "names": [
+ "rougail"
+ ],
+ "description": "Rougail",
+ "properties": [
+ {
+ "type": "mode",
+ "name": "basic"
+ }
+ ]
+ },
+ "children": {
+ "rougail.var1": {
+ "type": "variable",
+ "default": "value",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "standard"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ }
+ ],
+ "paths": [
+ "rougail.var1"
+ ],
+ "names": [
+ "var1"
+ ],
+ "descriptions": [
+ "A first variable."
+ ]
+ },
+ "rougail.var3": {
+ "type": "variable",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "basic"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ },
+ {
+ "type": "property",
+ "name": "disabled",
+ "annotation": "depends on an undocumented variable."
+ }
+ ],
+ "paths": [
+ "rougail.var3"
+ ],
+ "names": [
+ "var3"
+ ],
+ "descriptions": [
+ "A third variable."
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_5.md b/tests/results/test_namespace/04_1default_calculation_hidden_5.md
new file mode 100644
index 000000000..79ee1a82a
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_5.md
@@ -0,0 +1,7 @@
+# Variables for "Rougail"
+
+| Variable | Description |
+|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **rougail.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A first variable.
**Default**: value |
+| **rougail.var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` *`disabled`* | A third variable.
**Disabled**: depends on an undocumented variable. |
+
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_5.sh b/tests/results/test_namespace/04_1default_calculation_hidden_5.sh
new file mode 100644
index 000000000..1decd30b8
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_5.sh
@@ -0,0 +1,15 @@
+
+
+[1;4;96mVariables for [0m[1;4;96m"Rougail"[0m
+
+
+┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
+┃[1m [0m[1mVariable [0m[1m [0m┃[1m [0m[1mDescription [0m[1m [0m┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
+│ [1mrougail.var1[0m │ A first variable. │
+│ [1;7m string [0m [1;7m standard [0m [1;7m mandatory [0m │ [1mDefault[0m: value │
+├───────────────────────────────────────┼──────────────────────────────────────┤
+│ [1mrougail.var3[0m │ A third variable. │
+│ [1;7m string [0m [1;7m basic [0m [1;7m mandatory [0m [1;3;7m [0m │ [1mDisabled[0m: depends on an undocumented │
+│ [1;3;7mdisabled [0m │ variable. │
+└───────────────────────────────────────┴──────────────────────────────────────┘
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_6.adoc b/tests/results/test_namespace/04_1default_calculation_hidden_6.adoc
new file mode 100644
index 000000000..8d377100e
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_6.adoc
@@ -0,0 +1,19 @@
+== Variables for "Rougail"
+
+[cols="1a,1a"]
+|====
+| Variable | Description
+|
+
+**rougail.var1** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
+A first variable. +
+**Default**: value
+|
+
+**rougail.var3** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` |
+A third variable. +
+**Disabled**: depends on an undocumented variable.
+|====
+
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_6.json b/tests/results/test_namespace/04_1default_calculation_hidden_6.json
new file mode 100644
index 000000000..e6202f27b
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_6.json
@@ -0,0 +1,80 @@
+{
+ "rougail": {
+ "type": "namespace",
+ "informations": {
+ "paths": [
+ "rougail"
+ ],
+ "names": [
+ "rougail"
+ ],
+ "description": "Rougail",
+ "properties": [
+ {
+ "type": "mode",
+ "name": "basic"
+ }
+ ]
+ },
+ "children": {
+ "rougail.var1": {
+ "type": "variable",
+ "default": "value",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "standard"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ }
+ ],
+ "paths": [
+ "rougail.var1"
+ ],
+ "names": [
+ "var1"
+ ],
+ "descriptions": [
+ "A first variable."
+ ]
+ },
+ "rougail.var3": {
+ "type": "variable",
+ "properties": [
+ {
+ "type": "type",
+ "name": "string"
+ },
+ {
+ "type": "mode",
+ "name": "basic"
+ },
+ {
+ "type": "property",
+ "name": "mandatory"
+ },
+ {
+ "type": "property",
+ "name": "disabled",
+ "annotation": "depends on an undocumented variable."
+ }
+ ],
+ "paths": [
+ "rougail.var3"
+ ],
+ "names": [
+ "var3"
+ ],
+ "descriptions": [
+ "A third variable."
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_6.md b/tests/results/test_namespace/04_1default_calculation_hidden_6.md
new file mode 100644
index 000000000..79ee1a82a
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_6.md
@@ -0,0 +1,7 @@
+# Variables for "Rougail"
+
+| Variable | Description |
+|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **rougail.var1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A first variable.
**Default**: value |
+| **rougail.var3**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` *`disabled`* | A third variable.
**Disabled**: depends on an undocumented variable. |
+
diff --git a/tests/results/test_namespace/04_1default_calculation_hidden_6.sh b/tests/results/test_namespace/04_1default_calculation_hidden_6.sh
new file mode 100644
index 000000000..1decd30b8
--- /dev/null
+++ b/tests/results/test_namespace/04_1default_calculation_hidden_6.sh
@@ -0,0 +1,15 @@
+
+
+[1;4;96mVariables for [0m[1;4;96m"Rougail"[0m
+
+
+┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
+┃[1m [0m[1mVariable [0m[1m [0m┃[1m [0m[1mDescription [0m[1m [0m┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
+│ [1mrougail.var1[0m │ A first variable. │
+│ [1;7m string [0m [1;7m standard [0m [1;7m mandatory [0m │ [1mDefault[0m: value │
+├───────────────────────────────────────┼──────────────────────────────────────┤
+│ [1mrougail.var3[0m │ A third variable. │
+│ [1;7m string [0m [1;7m basic [0m [1;7m mandatory [0m [1;3;7m [0m │ [1mDisabled[0m: depends on an undocumented │
+│ [1;3;7mdisabled [0m │ variable. │
+└───────────────────────────────────────┴──────────────────────────────────────┘
diff --git a/tests/results/test_namespace_examples/04_1default_calculation_hidden_3.md b/tests/results/test_namespace_examples/04_1default_calculation_hidden_3.md
new file mode 100644
index 000000000..61437fe2c
--- /dev/null
+++ b/tests/results/test_namespace_examples/04_1default_calculation_hidden_3.md
@@ -0,0 +1,7 @@
+# Example with all variables modifiable
+
+```yaml
+---
+rougail:
+ var3: value
+```
diff --git a/tests/results/test_namespace_examples/04_1default_calculation_hidden_4.md b/tests/results/test_namespace_examples/04_1default_calculation_hidden_4.md
new file mode 100644
index 000000000..132800d65
--- /dev/null
+++ b/tests/results/test_namespace_examples/04_1default_calculation_hidden_4.md
@@ -0,0 +1,15 @@
+# Example with mandatory variables not filled in
+
+```yaml
+---
+rougail:
+ var2: example
+```
+# Example with all variables modifiable
+
+```yaml
+---
+rougail:
+ var2: example
+ var3: value
+```
diff --git a/tests/results/test_namespace_examples/04_1default_calculation_hidden_5.md b/tests/results/test_namespace_examples/04_1default_calculation_hidden_5.md
new file mode 100644
index 000000000..34dbe31f5
--- /dev/null
+++ b/tests/results/test_namespace_examples/04_1default_calculation_hidden_5.md
@@ -0,0 +1,15 @@
+# Example with mandatory variables not filled in
+
+```yaml
+---
+rougail:
+ var3: example
+```
+# Example with all variables modifiable
+
+```yaml
+---
+rougail:
+ var1: value
+ var3: example
+```
diff --git a/tests/results/test_namespace_examples/04_1default_calculation_hidden_6.md b/tests/results/test_namespace_examples/04_1default_calculation_hidden_6.md
new file mode 100644
index 000000000..34dbe31f5
--- /dev/null
+++ b/tests/results/test_namespace_examples/04_1default_calculation_hidden_6.md
@@ -0,0 +1,15 @@
+# Example with mandatory variables not filled in
+
+```yaml
+---
+rougail:
+ var3: example
+```
+# Example with all variables modifiable
+
+```yaml
+---
+rougail:
+ var1: value
+ var3: example
+```