feat: add vars deprecated and type scope to built-in templates (#509)

This commit is contained in:
Robert Kaussow 2023-06-14 16:47:44 +02:00 committed by GitHub
parent ea5760fa29
commit 458f9fc577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 67 additions and 0 deletions

View File

@ -10,6 +10,23 @@
{{ description | map("replace", "\n\n", "\n") | safe_join("\n") }}
{% endif %}
{% if item.deprecated is defined or item.type is defined %}
{% if item.deprecated is defined %}
{% set deprecated = [item.deprecated] if item.deprecated is string else item.deprecated %}
{% set deprecated_string = deprecated | map("replace", "\n\n", "\n") | safe_join("\n") %}
{% if deprecated_string %}
**_Deprecated:_** {{ deprecated_string }}<br />
{% else %}
**_Deprecated_**<br />
{% endif %}
{% endif %}
{% if item.type is defined and item.type %}
{% set type = [item.type] if item.type is string else item.type %}
**_Type:_** {{ type | map("replace", "\n\n", "\n") | safe_join("\n") }}<br />
{% endif %}
{% endif %}
{% if item.value is defined and item.value %}
#### Default value

View File

@ -10,6 +10,23 @@
{{ description | map("replace", "\n\n", "\n") | safe_join("\n") }}
{% endif %}
{% if item.deprecated is defined or item.type is defined %}
{% if item.deprecated is defined %}
{% set deprecated = [item.deprecated] if item.deprecated is string else item.deprecated %}
{% set deprecated_string = deprecated | map("replace", "\n\n", "\n") | safe_join("\n") %}
{% if deprecated_string %}
**_Deprecated:_** {{ deprecated_string }}<br />
{% else %}
**_Deprecated_**<br />
{% endif %}
{% endif %}
{% if item.type is defined and item.type %}
{% set type = [item.type] if item.type is string else item.type %}
**_Type:_** {{ type | map("replace", "\n\n", "\n") | safe_join("\n") }}<br />
{% endif %}
{% endif %}
{% if item.value is defined and item.value %}
#### Default value

View File

@ -10,6 +10,8 @@ the default description with an annotation.
- [Requirements](#requirements)
- [Default Variables](#default-variables)
- [demo_role_deprecated](#demo_role_deprecated)
- [demo_role_deprecated_info](#demo_role_deprecated_info)
- [demo_role_dict](#demo_role_dict)
- [demo_role_empty](#demo_role_empty)
- [demo_role_empty_dict](#demo_role_empty_dict)
@ -34,6 +36,29 @@ the default description with an annotation.
## Default Variables
### demo_role_deprecated
**_Deprecated_**<br />
#### Default value
```YAML
demo_role_deprecated: b
```
### demo_role_deprecated_info
**_Deprecated:_** This variable is deprected since `v2.0.0` and will be removed in a future release.<br />
**_Type:_** string<br />
#### Default value
```YAML
demo_role_deprecated_info: a
```
### demo_role_dict
#### Default value

View File

@ -57,3 +57,11 @@ demo_role_override: original
## Complex value
# @var demo_role_override_complex:value: $ {"foo":"bar", "second":"value"}
demo_role_override_complex: {}
# @var demo_role_deprecated:deprecated:
demo_role_deprecated: "b"
# @var demo_role_deprecated_info:deprecated: >
# This variable is deprected since `v2.0.0` and will be removed in a future release.
# @var demo_role_deprecated_info:type: string
demo_role_deprecated_info: "a"