diff --git a/src/rougail/output_doc/annotator.py b/src/rougail/output_doc/annotator.py
index 0bcbe1cf8..dce62d920 100644
--- a/src/rougail/output_doc/annotator.py
+++ b/src/rougail/output_doc/annotator.py
@@ -222,7 +222,7 @@ class Annotator(Walk):
if "type" in data or "description" in data:
one_is_calculation = True
datas.append(data)
- if one_is_calculation:
+ if one_is_calculation and datas:
self.objectspace.informations.add(
path,
f"{prop}_calculation",
@@ -287,16 +287,9 @@ class Annotator(Walk):
"propertyerror": values.propertyerror,
}
if isinstance(values, InformationCalculation):
- value, variable_path = self.calculation_to_information_information(
- values, version, path
- )
- ret = {
- "type": "information",
- "value": value,
- }
- if variable_path:
- ret["path"] = variable_path
- return ret
+ return self.calculation_to_information_information(
+ values, version, path
+ )
if isinstance(values, (IdentifierCalculation, IdentifierPropertyCalculation)):
return {
"type": "identifier",
@@ -327,38 +320,48 @@ class Annotator(Walk):
values.namespace,
values.xmlfiles,
)[0]
- if isinstance(values, VariableCalculation) and values.optional and not variable:
+ if not variable or (isinstance(values, VariableCalculation) and values.optional and not variable):
return None
- if variable:
- variable_path = variable.path
+ values_calculation = {"path": variable.path}
if prop in PROPERTY_ATTRIBUTE:
# get comparative value
+# values_calculation["transitive"] = values.propertyerror == "transitive"
if values.when_not is not undefined:
- value = values.when_not
- condition = "when_not"
+ values_calculation["type"] = "condition"
+ values_calculation["value"] = values.when_not
+ values_calculation["condition"] = "when_not"
elif values.when is not undefined:
- value = values.when
- condition = "when"
+ values_calculation["type"] = "condition"
+ values_calculation["value"] = values.when
+ values_calculation["condition"] = "when"
+ elif values.propertyerror == "transitive":
+ values_calculation["type"] = "transitive"
else:
- value = True
- condition = "when"
-
- # set message
- values_calculation = (variable_path, value, condition)
+ values_calculation["type"] = "condition"
+ values_calculation["value"] = True
+ values_calculation["condition"] = "when"
else:
- values_calculation = variable_path
-
+ values_calculation["type"] = "variable"
return values_calculation
def calculation_to_information_information(
self, values, version: str, path: str
) -> Union[str, bool]:
+ values_calculation = {"type": "information",
+ "information": values.information,
+ }
if values.variable:
- variable_path = self.get_path_from_variable(values, version, path)
- return _('the value of the information "{0}" of the variable "{{0}}"').format(
- values.information
- ), variable_path
- return _('the value of the global information "{0}"').format(values.information), None
+ variable = self.objectspace.paths.get_with_dynamic(
+ values.variable,
+ path,
+ values.version,
+ values.namespace,
+ values.xmlfiles,
+ )[0]
+ if not variable:
+ return None
+ values_calculation["path"] = variable.path
+ return values_calculation
def calculation_to_information_identifier(
self, values, prop: str, version: str
diff --git a/src/rougail/output_doc/doc.py b/src/rougail/output_doc/doc.py
index b548c5d95..b4ddbd5c7 100644
--- a/src/rougail/output_doc/doc.py
+++ b/src/rougail/output_doc/doc.py
@@ -226,9 +226,9 @@ class RougailOutputDoc(Examples, Changelog):
return True
calculation = child.information.get(f"{hidden_property}_calculation", None)
- if calculation and calculation.get("type") == "variable":
- variable_path, value, condition = calculation["value"]
- variable = self.true_config.forcepermissive.option(variable_path)
+ if calculation and calculation.get("type") == "variable" and calculation["value"]["type"] == "condition":
+ condition = calculation["value"]
+ variable = self.true_config.forcepermissive.option(condition["path"])
try:
variable.value.get()
except AttributeError:
@@ -239,7 +239,9 @@ class RougailOutputDoc(Examples, Changelog):
except VariableCalculationDependencyError:
pass
else:
- if (condition == "when" and value == variable_value) or (condition == "when_not" and value != variable_value):
+ condition_type = condition["condition"]
+ value = condition["value"]
+ if (condition_type == "when" and value == variable_value) or (condition_type == "when_not" and value != variable_value):
return True
if not child.isoptiondescription():
for hidden_property in self.disabled_modes:
@@ -685,7 +687,7 @@ class RougailOutputDoc(Examples, Changelog):
return values
return self._calculation_to_string(child, calculation, prop)
- def _calculation_to_string(self, child, calculation, prop):
+ def _calculation_to_string(self, child, calculation, attribute_type):
if "description" in calculation:
values = calculation
if self.document_a_type and "variables" in values:
@@ -695,24 +697,27 @@ class RougailOutputDoc(Examples, Changelog):
elif "type" not in calculation:
values = calculation["value"]
elif calculation["type"] == "jinja":
- values = self._calculation_jinja_to_string(child, calculation, prop)
+ values = self._calculation_jinja_to_string(child, calculation, attribute_type)
elif calculation["type"] == "variable":
- values = self._calculation_variable_to_string(child, calculation, prop)
+ values = self._calculation_variable_to_string(child, calculation, attribute_type)
elif calculation["type"] == "identifier":
- if prop in PROPERTY_ATTRIBUTE:
+ if attribute_type in PROPERTY_ATTRIBUTE:
values = calculation["value"]
else:
values = _("the value of the identifier")
elif calculation["type"] == "information":
- values = calculation["value"]
if "path" in calculation:
variable_path = self.doc_path(calculation["path"])
- values = values.format(variable_path)
+ values = _('the value of the information "{0}" of the variable "{1}"').format(
+ calculation["information"], variable_path
+ )
+ else:
+ values = _('the value of the global information "{0}"').format(calculation["information"])
else:
values = _("the value of the {0}").format(calculation["type"])
return values
- def _calculation_jinja_to_string(self, child, calculation, prop):
+ def _calculation_jinja_to_string(self, child, calculation, attribute_type):
if calculation["value"] is not True:
values = calculation["value"]
else:
@@ -725,7 +730,7 @@ class RougailOutputDoc(Examples, Changelog):
warning = _(
'"{0}" is a calculation for {1} but has no description in {2}'
).format(
- prop,
+ attribute_type,
self.doc_path(child.path()),
display_xmlfiles(child.information.get("ymlfiles")),
)
@@ -735,107 +740,16 @@ class RougailOutputDoc(Examples, Changelog):
)
return values
- def _calculation_variable_to_string(self, child, calculation, prop):
- if prop in PROPERTY_ATTRIBUTE:
- values = self._calculation_variable_to_string_known_property(child, calculation, prop)
+ def _calculation_variable_to_string(self, child, calculation, attribute_type):
+ if attribute_type in PROPERTY_ATTRIBUTE:
+ func = self._calculation_variable_to_string_known_property
else:
- if calculation["optional"]:
- path = calculation["value"]
- if "{{ identifier }}" in path:
- if path not in self.dynamic_paths:
- return None
- else:
- try:
- self.true_config.forcepermissive.option(path).get()
- except AttributeError:
- return None
- if not calculation["optional"]:
- true_msg = _('the value of the variable "{0}"')
- else:
- true_msg = _('the value of the variable "{0}" if it is defined')
- if "{{ identifier }}" in calculation["ori_path"]:
- values = []
- all_is_undocumented = False
- for cpath, description, identifiers in self.get_annotation_variable(calculation["value"], calculation["ori_path"]):
- if cpath:
- all_is_undocumented = False
- path_obj = {
- "path": self.doc_path(cpath),
- }
- if identifiers:
- path_obj["identifiers"] = identifiers
- values.append({
- "message": true_msg,
- "path": path_obj,
- "description": description,
- })
- else:
- if all_is_undocumented is None:
- all_is_undocumented = True
- values.append(_("the value of an undocumented variable"))
- if all_is_undocumented:
- if len(values) > 1:
- values = _("the values of undocumented variables")
- else:
- values = values[0]
- else:
- # FIXME A MUTUALISER AUSSI
- variable_path = calculation["ori_path"]
- variable = self.true_config.unrestraint.option(variable_path)
- try:
- isfollower = variable.isfollower()
- except AttributeError:
- pass
- else:
- if not isfollower and self.is_inaccessible_user_data(variable):
- try:
- uncalculated = variable.value.get(uncalculated=True)
- except PropertiesOptionError:
- true_msg = None
- else:
- if uncalculated and not isinstance(
- uncalculated, Calculation
- ):
- if isinstance(uncalculated, list):
- true_msg = {
- "submessage": _(
- "(from an undocumented variable)"
- ),
- "values": uncalculated,
- }
- else:
- if not isinstance(uncalculated, str):
- uncalculated = dump(uncalculated)
- true_msg = _(
- "{0} (from an undocumented variable)"
- ).format(uncalculated)
- else:
- true_msg = _("depends on an undocumented variable")
- if true_msg:
- if isinstance(true_msg, dict):
- values = true_msg
- else:
- try:
- description = self._convert_description(self.true_config.option(calculation["ori_path"]).description(uncalculated=True), "description", its_a_path=False)
- except AttributeError:
- description = calculation["ori_path"]
- values = {
- "message": true_msg,
- "path": {
- "path": self.doc_path(calculation["ori_path"]),
- },
- "description": description,
- }
- else:
- values = None
- return values
+ func = self._calculation_variable_to_string_not_properties
+ return func(child, calculation, attribute_type)
def _calculation_variable_to_string_known_property(self, child, calculation, prop):
- variable_path, value, condition = calculation["value"]
- if isinstance(value, str):
- str_value = value
- else:
- str_value = dump(value)
+ condition = calculation["value"]
+ variable_path = condition["path"]
values = []
if "{{ identifier }}" in calculation["ori_path"] or "{{ identifier }}" in variable_path:
variables = self.get_annotation_variable(variable_path, calculation["ori_path"])
@@ -853,41 +767,46 @@ class RougailOutputDoc(Examples, Changelog):
description = self._convert_description(option.description(uncalculated=True), "description", its_a_path=False)
variables = [[variable_path, description, None]]
for cpath, description, identifiers in variables:
- if calculation["propertyerror"] == "transitive":
- if not cpath:
- return True
+ if not cpath:
+ # we cannot access to this variable, so try with permissive
+ if condition["type"] == "transitive":
+ value = None
else:
- print(variable_path)
- continue
- pass
- elif not cpath:
- # we cannot access to this variable so try with permissive
- variable = self.true_config.forcepermissive.option(variable_path)
+ value = condition["value"]
+ option = self.true_config.forcepermissive.option(variable_path)
try:
- variable_value = self._get_unmodified_default_value(variable)
+ variable_value = self._get_unmodified_default_value(option)
except PropertiesOptionError as err:
if calculation["propertyerror"] is True:
raise err from err
- variable_value = value
+ if calculation["propertyerror"] == "transitive":
+ return True
+ return False
except VariableCalculationDependencyError:
values.append(_("depends on an undocumented variable"))
continue
except AttributeError as err:
return calculation.get("default", False)
- if (
- condition == "when"
- and value == variable_value
- or condition == "when_not"
- and value != variable_value
- ):
- if prop in HIDDEN_PROPERTIES:
- return False
- # always "prop"
+ if condition["type"] == "transitive":
return True
- # never "prop"
+ if prop in HIDDEN_PROPERTIES:
+ condition_type = condition["condition"]
+ if (
+ condition_type == "when"
+ and value == variable_value
+ or condition_type == "when_not"
+ and value != variable_value
+ ):
+ # always "prop"
+ return True
return False
+ if condition["type"] == "transitive":
+ msg = _(
+ 'when the variable "{{0}}" is {0}"'
+ ).format(prop)
else:
- if condition == "when_not":
+ condition_type = condition["condition"]
+ if condition_type == "when_not":
if calculation["optional"]:
if not calculation["propertyerror"]:
msg = _(
@@ -915,21 +834,118 @@ class RougailOutputDoc(Examples, Changelog):
msg = _('when the variable "{{0}}" is accessible and has the value "{0}"')
else:
msg = _('when the variable "{{0}}" has the value "{0}"')
- path_obj = {
- "path": self.doc_path(variable_path),
- }
- if identifiers:
- path_obj["identifiers"] = identifiers
+ value = condition["value"]
+ if isinstance(value, str):
+ str_value = value
+ else:
+ str_value = dump(value)
+ msg = msg.format(str_value)
+ path_obj = {
+ "path": self.doc_path(variable_path),
+ }
+ if identifiers:
+ path_obj["identifiers"] = identifiers
- values.append({
- "message": msg.format(str_value),
- "path": path_obj,
- "description": description,
- })
+ values.append({
+ "message": msg,
+ "path": path_obj,
+ "description": description,
+ })
if len(values) == 1:
return values[0]
return values
+ def _calculation_variable_to_string_not_properties(self, child, calculation, attribute_type):
+ if calculation["optional"]:
+ path = calculation["value"]["path"]
+ if "{{ identifier }}" in path:
+ if path not in self.dynamic_paths:
+ return None
+ else:
+ try:
+ self.true_config.forcepermissive.option(path).get()
+ except AttributeError:
+ return None
+ true_msg = _('the value of the variable "{0}" if it is defined')
+ else:
+ true_msg = _('the value of the variable "{0}"')
+ if "{{ identifier }}" in calculation["ori_path"]:
+ values = []
+ all_is_undocumented = False
+ for cpath, description, identifiers in self.get_annotation_variable(calculation["value"]["path"], calculation["ori_path"]):
+ if cpath:
+ all_is_undocumented = False
+ path_obj = {
+ "path": self.doc_path(cpath),
+ }
+ if identifiers:
+ path_obj["identifiers"] = identifiers
+ values.append({
+ "message": true_msg,
+ "path": path_obj,
+ "description": description,
+ })
+ else:
+ if all_is_undocumented is None:
+ all_is_undocumented = True
+ values.append(_("the value of an undocumented variable"))
+ if all_is_undocumented:
+ if len(values) > 1:
+ values = _("the values of undocumented variables")
+ else:
+ values = values[0]
+ else:
+ # FIXME A MUTUALISER AUSSI
+ variable_path = calculation["ori_path"]
+ variable = self.true_config.unrestraint.option(variable_path)
+ try:
+ isfollower = variable.isfollower()
+ except AttributeError:
+ pass
+ else:
+ if not isfollower and self.is_inaccessible_user_data(variable):
+ try:
+ uncalculated = variable.value.get(uncalculated=True)
+ except PropertiesOptionError:
+ true_msg = None
+ else:
+ if uncalculated and not isinstance(
+ uncalculated, Calculation
+ ):
+ if isinstance(uncalculated, list):
+ true_msg = {
+ "submessage": _(
+ "(from an undocumented variable)"
+ ),
+ "values": uncalculated,
+ }
+ else:
+ if not isinstance(uncalculated, str):
+ uncalculated = dump(uncalculated)
+ true_msg = _(
+ "{0} (from an undocumented variable)"
+ ).format(uncalculated)
+ else:
+ true_msg = _("depends on an undocumented variable")
+ if true_msg:
+ if isinstance(true_msg, dict):
+ values = true_msg
+ else:
+ try:
+ description = self._convert_description(self.true_config.option(calculation["ori_path"]).description(uncalculated=True), "description", its_a_path=False)
+ except AttributeError:
+ description = calculation["ori_path"]
+ values = {
+ "message": true_msg,
+ "path": {
+ "path": self.doc_path(calculation["ori_path"]),
+ },
+ "description": description,
+ }
+ else:
+ values = None
+ return values
+
def get_annotation_variable(self, current_path, ori_path):
if current_path == ori_path:
regexp = None
@@ -959,7 +975,7 @@ class RougailOutputDoc(Examples, Changelog):
if not calculation:
return child.value.get()
if calculation["type"] == "variable":
- variable = self.true_config.forcepermissive.option(calculation["value"])
+ variable = self.true_config.forcepermissive.option(calculation["value"]["path"])
if variable and self.is_inaccessible_user_data(variable):
return self._get_unmodified_default_value(variable)
raise VariableCalculationDependencyError()
diff --git a/tests/force_optional.adoc b/tests/force_optional.adoc
index 280a38efa..50da90bbe 100644
--- a/tests/force_optional.adoc
+++ b/tests/force_optional.adoc
@@ -2,8 +2,7 @@
|====
| Variable | Description
| **var1** +
-`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | My var1. +
-**Default**: the value of the variable "a.unknown.variable"
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | My var1.
| **var2** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | My var2. +
**Default**: var calculated
@@ -13,17 +12,17 @@
| **var4** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | My var4.
| **var5** +
-`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | My var5. +
-**Default**: the value of the information "info" of the variable "a.unknown.variable"
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | My var5.
| **var6** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `mandatory` | My var6. +
-**Choices**: the value of the variable "a.unknown.variable"
+**Choices**:
+
+*
| **var7** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `mandatory` | My var7. +
**Choices**:
-* the value of the variable "a.unknown.variable1"
-* the value of the variable "a.unknown.variable2"
+*
| **var8** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[choice]` `mandatory` | My var8. +
**Choices**: the a.unknown.variable values
@@ -36,7 +35,7 @@
This family builds families dynamically. +
**Path**: var___example__ +
-**Identifiers**: the value of the variable "a.unknown.variable"
+**Identifiers**: example
====
[cols="1a,1a"]
|====
diff --git a/tests/results/test/04_5disabled_calculation_variable12.adoc b/tests/results/test/04_5disabled_calculation_variable12.adoc
new file mode 100644
index 000000000..8875321b6
--- /dev/null
+++ b/tests/results/test/04_5disabled_calculation_variable12.adoc
@@ -0,0 +1,14 @@
+[cols="1a,1a"]
+|====
+| Variable | Description
+| **condition** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `mandatory` | A condition. +
+**Default**: true
+| **variable1** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` | A variable. +
+**Disabled**: when the variable "condition" has the value "true"
+| **variable2** +
+`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` | A second variable. +
+**Disabled**: when the variable "variable1" is disabled"
+|====
+
diff --git a/tests/results/test/04_5disabled_calculation_variable12.gitlab.md b/tests/results/test/04_5disabled_calculation_variable12.gitlab.md
new file mode 100644
index 000000000..74e7f4258
--- /dev/null
+++ b/tests/results/test/04_5disabled_calculation_variable12.gitlab.md
@@ -0,0 +1,6 @@
+| Variable | Description |
+|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
+| **condition**
[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A condition.
**Default**: true |
+| **variable1**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` *`disabled`* | A variable.
**Disabled**: when the variable "[A condition](#condition)" has the value "true" |
+| **variable2**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` *`disabled`* | A second variable.
**Disabled**: when the variable "[A variable](#variable1)" is disabled" |
+
diff --git a/tests/results/test/04_5disabled_calculation_variable12.html b/tests/results/test/04_5disabled_calculation_variable12.html
new file mode 100644
index 000000000..437f3560f
--- /dev/null
+++ b/tests/results/test/04_5disabled_calculation_variable12.html
@@ -0,0 +1,11 @@
+
| Variable | Description |
|---|---|
| condition boolean standard mandatory | A condition. Default: true |
| variable1 string basic mandatory disabled | A variable. Disabled: when the variable "condition" has the value "true" |
| variable2 string basic mandatory disabled | A second variable. Disabled: when the variable "variable1" is disabled" |
variable1: example +variable2: example
condition: true +variable1: example +variable2: example\ No newline at end of file diff --git a/tests/results/test_examples/04_5disabled_calculation_variable12.md b/tests/results/test_examples/04_5disabled_calculation_variable12.md new file mode 100644 index 000000000..50fa50cb6 --- /dev/null +++ b/tests/results/test_examples/04_5disabled_calculation_variable12.md @@ -0,0 +1,15 @@ +# Example with mandatory variables not filled in + +```yaml +--- +variable1: example +variable2: example +``` +# Example with all variables modifiable + +```yaml +--- +condition: true +variable1: example +variable2: example +``` diff --git a/tests/results/test_examples/04_5disabled_calculation_variable12.sh b/tests/results/test_examples/04_5disabled_calculation_variable12.sh new file mode 100644 index 000000000..c6a19251a --- /dev/null +++ b/tests/results/test_examples/04_5disabled_calculation_variable12.sh @@ -0,0 +1,13 @@ +[1;4;96mExample with mandatory variables not filled in[0m + +[38;2;248;248;242;48;2;39;40;34m---[0m[48;2;39;40;34m [0m +[38;2;255;70;137;48;2;39;40;34mvariable1[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample [0m +[38;2;255;70;137;48;2;39;40;34mvariable2[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample [0m + +[1;4;96mExample with all variables modifiable[0m + +[38;2;248;248;242;48;2;39;40;34m---[0m[48;2;39;40;34m [0m +[38;2;255;70;137;48;2;39;40;34mcondition[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mtrue [0m +[38;2;255;70;137;48;2;39;40;34mvariable1[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample [0m +[38;2;255;70;137;48;2;39;40;34mvariable2[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample [0m + diff --git a/tests/results/test_examples/warnings_04_5disabled_calculation_variable12 b/tests/results/test_examples/warnings_04_5disabled_calculation_variable12 new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/results/test_examples/warnings_04_5disabled_calculation_variable12 @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/results/test_examples_comment/04_5disabled_calculation_variable12.adoc b/tests/results/test_examples_comment/04_5disabled_calculation_variable12.adoc new file mode 100644 index 000000000..1acc0cbe5 --- /dev/null +++ b/tests/results/test_examples_comment/04_5disabled_calculation_variable12.adoc @@ -0,0 +1,17 @@ +== Example with mandatory variables not filled in + +[,yaml] +---- +--- +variable1: example # A variable +variable2: example # A second variable +---- +== Example with all variables modifiable + +[,yaml] +---- +--- +condition: true # A condition +variable1: example # A variable +variable2: example # A second variable +---- diff --git a/tests/results/test_examples_comment/04_5disabled_calculation_variable12.gitlab.md b/tests/results/test_examples_comment/04_5disabled_calculation_variable12.gitlab.md new file mode 100644 index 000000000..4c0259a73 --- /dev/null +++ b/tests/results/test_examples_comment/04_5disabled_calculation_variable12.gitlab.md @@ -0,0 +1,19 @@ +
variable1: example # A variable +variable2: example # A second variable
condition: true # A condition +variable1: example # A variable +variable2: example # A second variable\ No newline at end of file diff --git a/tests/results/test_examples_comment/04_5disabled_calculation_variable12.md b/tests/results/test_examples_comment/04_5disabled_calculation_variable12.md new file mode 100644 index 000000000..051d389ef --- /dev/null +++ b/tests/results/test_examples_comment/04_5disabled_calculation_variable12.md @@ -0,0 +1,15 @@ +# Example with mandatory variables not filled in + +```yaml +--- +variable1: example # A variable +variable2: example # A second variable +``` +# Example with all variables modifiable + +```yaml +--- +condition: true # A condition +variable1: example # A variable +variable2: example # A second variable +``` diff --git a/tests/results/test_examples_comment/04_5disabled_calculation_variable12.sh b/tests/results/test_examples_comment/04_5disabled_calculation_variable12.sh new file mode 100644 index 000000000..69960544a --- /dev/null +++ b/tests/results/test_examples_comment/04_5disabled_calculation_variable12.sh @@ -0,0 +1,13 @@ +[1;4;96mExample with mandatory variables not filled in[0m + +[38;2;248;248;242;48;2;39;40;34m---[0m[48;2;39;40;34m [0m +[38;2;255;70;137;48;2;39;40;34mvariable1[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# A variable[0m[48;2;39;40;34m [0m +[38;2;255;70;137;48;2;39;40;34mvariable2[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# A second variable[0m[48;2;39;40;34m [0m + +[1;4;96mExample with all variables modifiable[0m + +[38;2;248;248;242;48;2;39;40;34m---[0m[48;2;39;40;34m [0m +[38;2;255;70;137;48;2;39;40;34mcondition[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mtrue[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# A condition[0m[48;2;39;40;34m [0m +[38;2;255;70;137;48;2;39;40;34mvariable1[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# A variable[0m[48;2;39;40;34m [0m +[38;2;255;70;137;48;2;39;40;34mvariable2[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# A second variable[0m[48;2;39;40;34m [0m + diff --git a/tests/results/test_examples_comment/warnings_04_5disabled_calculation_variable12 b/tests/results/test_examples_comment/warnings_04_5disabled_calculation_variable12 new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/results/test_examples_comment/warnings_04_5disabled_calculation_variable12 @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/results/test_namespace/04_5disabled_calculation_variable12.adoc b/tests/results/test_namespace/04_5disabled_calculation_variable12.adoc new file mode 100644 index 000000000..268624866 --- /dev/null +++ b/tests/results/test_namespace/04_5disabled_calculation_variable12.adoc @@ -0,0 +1,22 @@ +== Rougail + +==== +**🛈 Informations** + +**Path**: rougail + +`basic` +==== +[cols="1a,1a"] +|==== +| Variable | Description +| **rougail.condition** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `mandatory` | A condition. + +**Default**: true +| **rougail.variable1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` | A variable. + +**Disabled**: when the variable "rougail.condition" has the value "true" +| **rougail.variable2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` | A second variable. + +**Disabled**: when the variable "rougail.variable1" is disabled" +|==== + diff --git a/tests/results/test_namespace/04_5disabled_calculation_variable12.gitlab.md b/tests/results/test_namespace/04_5disabled_calculation_variable12.gitlab.md new file mode 100644 index 000000000..b4b4a8358 --- /dev/null +++ b/tests/results/test_namespace/04_5disabled_calculation_variable12.gitlab.md @@ -0,0 +1,14 @@ +
| Variable | Description |
|---|---|
| rougail.condition boolean standard mandatory | A condition. Default: true |
| rougail.variable1 string basic mandatory disabled | A variable. Disabled: when the variable "rougail.condition" has the value "true" |
| rougail.variable2 string basic mandatory disabled | A second variable. Disabled: when the variable "rougail.variable1" is disabled" |
rougail: + variable1: example + variable2: example
rougail: + condition: true + variable1: example + variable2: example\ No newline at end of file diff --git a/tests/results/test_namespace_examples/04_5disabled_calculation_variable12.md b/tests/results/test_namespace_examples/04_5disabled_calculation_variable12.md new file mode 100644 index 000000000..d38aa2a5f --- /dev/null +++ b/tests/results/test_namespace_examples/04_5disabled_calculation_variable12.md @@ -0,0 +1,17 @@ +# Example with mandatory variables not filled in + +```yaml +--- +rougail: + variable1: example + variable2: example +``` +# Example with all variables modifiable + +```yaml +--- +rougail: + condition: true + variable1: example + variable2: example +``` diff --git a/tests/results/test_namespace_examples/04_5disabled_calculation_variable12.sh b/tests/results/test_namespace_examples/04_5disabled_calculation_variable12.sh new file mode 100644 index 000000000..bec914733 --- /dev/null +++ b/tests/results/test_namespace_examples/04_5disabled_calculation_variable12.sh @@ -0,0 +1,15 @@ +[1;4;96mExample with mandatory variables not filled in[0m + +[38;2;248;248;242;48;2;39;40;34m---[0m[48;2;39;40;34m [0m +[38;2;255;70;137;48;2;39;40;34mrougail[0m[38;2;248;248;242;48;2;39;40;34m:[0m[48;2;39;40;34m [0m +[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34mvariable1[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample [0m +[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34mvariable2[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample [0m + +[1;4;96mExample with all variables modifiable[0m + +[38;2;248;248;242;48;2;39;40;34m---[0m[48;2;39;40;34m [0m +[38;2;255;70;137;48;2;39;40;34mrougail[0m[38;2;248;248;242;48;2;39;40;34m:[0m[48;2;39;40;34m [0m +[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34mcondition[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mtrue [0m +[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34mvariable1[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample [0m +[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34mvariable2[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample [0m + diff --git a/tests/results/test_namespace_examples/warnings_04_5disabled_calculation_variable12 b/tests/results/test_namespace_examples/warnings_04_5disabled_calculation_variable12 new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/results/test_namespace_examples/warnings_04_5disabled_calculation_variable12 @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.adoc b/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.adoc new file mode 100644 index 000000000..fb8d106ab --- /dev/null +++ b/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.adoc @@ -0,0 +1,19 @@ +== Example with mandatory variables not filled in + +[,yaml] +---- +--- +rougail: # Rougail + variable1: example # A variable + variable2: example # A second variable +---- +== Example with all variables modifiable + +[,yaml] +---- +--- +rougail: # Rougail + condition: true # A condition + variable1: example # A variable + variable2: example # A second variable +---- diff --git a/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.gitlab.md b/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.gitlab.md new file mode 100644 index 000000000..9725ba139 --- /dev/null +++ b/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.gitlab.md @@ -0,0 +1,21 @@ +
rougail: # Rougail + variable1: example # A variable + variable2: example # A second variable
rougail: # Rougail + condition: true # A condition + variable1: example # A variable + variable2: example # A second variable\ No newline at end of file diff --git a/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.md b/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.md new file mode 100644 index 000000000..3e8aa9b08 --- /dev/null +++ b/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.md @@ -0,0 +1,17 @@ +# Example with mandatory variables not filled in + +```yaml +--- +rougail: # Rougail + variable1: example # A variable + variable2: example # A second variable +``` +# Example with all variables modifiable + +```yaml +--- +rougail: # Rougail + condition: true # A condition + variable1: example # A variable + variable2: example # A second variable +``` diff --git a/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.sh b/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.sh new file mode 100644 index 000000000..0b4ae9337 --- /dev/null +++ b/tests/results/test_namespace_examples_comment/04_5disabled_calculation_variable12.sh @@ -0,0 +1,15 @@ +[1;4;96mExample with mandatory variables not filled in[0m + +[38;2;248;248;242;48;2;39;40;34m---[0m[48;2;39;40;34m [0m +[38;2;255;70;137;48;2;39;40;34mrougail[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# Rougail[0m[48;2;39;40;34m [0m +[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34mvariable1[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# A variable[0m[48;2;39;40;34m [0m +[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34mvariable2[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# A second variable[0m[48;2;39;40;34m [0m + +[1;4;96mExample with all variables modifiable[0m + +[38;2;248;248;242;48;2;39;40;34m---[0m[48;2;39;40;34m [0m +[38;2;255;70;137;48;2;39;40;34mrougail[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# Rougail[0m[48;2;39;40;34m [0m +[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34mcondition[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mtrue[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# A condition[0m[48;2;39;40;34m [0m +[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34mvariable1[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# A variable[0m[48;2;39;40;34m [0m +[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34mvariable2[0m[38;2;248;248;242;48;2;39;40;34m:[0m[38;2;248;248;242;48;2;39;40;34m [0m[48;2;39;40;34mexample[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;149;144;119;48;2;39;40;34m# A second variable[0m[48;2;39;40;34m [0m + diff --git a/tests/results/test_namespace_examples_comment/warnings_04_5disabled_calculation_variable12 b/tests/results/test_namespace_examples_comment/warnings_04_5disabled_calculation_variable12 new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/results/test_namespace_examples_comment/warnings_04_5disabled_calculation_variable12 @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/results/test_namespace_without_family/04_5disabled_calculation_variable12.adoc b/tests/results/test_namespace_without_family/04_5disabled_calculation_variable12.adoc new file mode 100644 index 000000000..ce18114da --- /dev/null +++ b/tests/results/test_namespace_without_family/04_5disabled_calculation_variable12.adoc @@ -0,0 +1,14 @@ +[cols="1a,1a"] +|==== +| Variable | Description +| **rougail.condition** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `mandatory` | A condition. + +**Default**: true +| **rougail.variable1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` | A variable. + +**Disabled**: when the variable "rougail.condition" has the value "true" +| **rougail.variable2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` | A second variable. + +**Disabled**: when the variable "rougail.variable1" is disabled" +|==== + diff --git a/tests/results/test_namespace_without_family/04_5disabled_calculation_variable12.changelog.adoc b/tests/results/test_namespace_without_family/04_5disabled_calculation_variable12.changelog.adoc new file mode 100644 index 000000000..b0bbf4699 --- /dev/null +++ b/tests/results/test_namespace_without_family/04_5disabled_calculation_variable12.changelog.adoc @@ -0,0 +1,16 @@ +== New variables + +[cols="1a,1a"] +|==== +| Variable | Description +| **rougail.condition** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[boolean]` `standard` `mandatory` | A condition. + +**Default**: true +| **rougail.variable1** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` | A variable. + +**Disabled**: when the variable "rougail.condition" has the value "true" +| **rougail.variable2** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` `__disabled__` | A second variable. + +**Disabled**: when the variable "rougail.variable1" is disabled" +|==== + diff --git a/tests/results/test_namespace_without_family/04_5disabled_calculation_variable12.changelog.gitlab.md b/tests/results/test_namespace_without_family/04_5disabled_calculation_variable12.changelog.gitlab.md new file mode 100644 index 000000000..90396e8b6 --- /dev/null +++ b/tests/results/test_namespace_without_family/04_5disabled_calculation_variable12.changelog.gitlab.md @@ -0,0 +1,10 @@ +
| Variable | Description |
|---|---|
| rougail.condition boolean standard mandatory | A condition. Default: true |
| rougail.variable1 string basic mandatory disabled | A variable. Disabled: when the variable "rougail.condition" has the value "true" |
| rougail.variable2 string basic mandatory disabled | A second variable. Disabled: when the variable "rougail.variable1" is disabled" |
| Variable | Description |
|---|---|
| rougail.condition boolean standard mandatory | A condition. Default: true |
| rougail.variable1 string basic mandatory disabled | A variable. Disabled: when the variable "rougail.condition" has the value "true" |
| rougail.variable2 string basic mandatory disabled | A second variable. Disabled: when the variable "rougail.variable1" is disabled" |
| Variable | Description |
|---|---|
| condition boolean standard mandatory | A condition. Default: true |
| variable1 string basic mandatory disabled | A variable. Disabled: when the variable "condition" has the value "true" |
| variable2 string basic mandatory disabled | A second variable. Disabled: when the variable "variable1" is disabled" |
| Variable | Description |
|---|---|
| condition boolean standard mandatory | A condition. Default: true |
| variable1 string basic mandatory disabled | A variable. Disabled: when the variable "condition" has the value "true" |
| variable2 string basic mandatory disabled | A second variable. Disabled: when the variable "variable1" is disabled" |