forked from open-telemetry/semantic-conventions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenum_macros.j2
15 lines (14 loc) · 913 Bytes
/
enum_macros.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{% import 'stability.j2' as stability %}
{% macro filter(member) %}{% if snippet_type is not defined or (member.deprecated is none or member.deprecated == "") %}{{ "True" }}{% else %}{{ "False" }}{% endif %}{% endmacro %}
{% macro table(enum, notes) %}
`{{enum.name}}` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
{% for espec in enum.type.members | sort(attribute='value') %}
{%- if filter(espec) == "True" -%}
| `{{ espec.value }}` | {{ (espec.brief or espec.id) | trim }}{{ notes.add(espec.note) }} | {{ stability.badge(espec.stability, espec.deprecated) }} |
{% endif %}{% endfor %}{{ notes.render() }}{% endmacro %}
{% macro tables(enums, notes) -%}
{% for enum in enums | sort(attribute="name") -%}
{{ table(enum, notes) -}}
{% endfor %}{% endmacro %}