semantic-conventions/templates/registry/markdown/attribute_namespace.md.j2

50 lines
2.0 KiB
Django/Jinja

{#- This template is rendered per top-level registry namespace. -#}
{#- It consists of two variables: -#}
{#- - id: The top-level namespace id. -#}
{#- - groups: A sequence of all attribute groups under this namespace. -#}
{#- This includes deprecated groups. -#}
{% import 'stability.j2' as stability %}
{% import 'notes.j2' as notes %}
{% import 'enum_macros.j2' as enums %}
{% import 'attribute_macros.j2' as attrs %}
{%- set my_file_name = ctx.id | lower | kebab_case ~ ".md" -%}
{{- template.set_file_name(my_file_name) -}}
{%- set groups = namespace(deprecated=[], non_deprecated=[]) -%}
{% for group in ctx.groups | sort(attribute="id") %}
{% if group.id[-10:] == "deprecated" %}
{%- set groups.deprecated = groups.deprecated + [group] -%}
{%- else -%}
{%- set groups.non_deprecated = groups.non_deprecated + [group] -%}
{%- endif -%}
{%- endfor -%}
{%- set attr_groups = groups.non_deprecated + groups.deprecated -%}
<!--- Hugo front matter used to generate the website version of this page:
--->
<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/attribute_namespace.md.j2 -->
# {{ ctx.id | title_case | acronym }}
{%- if attr_groups | length > 1 %}{% for group in attr_groups %}
- [{{ attrs.display_name(group) }}](#{{ attrs.heading_link_fragments(attrs.display_name(group)) }})
{%- endfor -%}{%- endif -%}
{% for group in attr_groups %}
## {{ attrs.display_name(group) }}
{{ group.brief }}
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
{%- for attribute in group.attributes | sort(attribute="name") %}
| {{ attrs.name(attribute) }} | {{ attrs.type(attribute) }} | {{ attribute.brief | trim }}{{ notes.add(attribute.note) }} | {{ attrs.examples(attribute) | trim }} | {{ stability.badge(attribute.stability, attribute.deprecated) | trim }} |
{%- endfor %}
{{ notes.render() }}
{% for enum in group.attributes | sort(attribute="name") %}
{%- if enum.type is mapping -%}{{ enums.table(enum, notes) }}{% endif %}
{%- endfor -%}
{%- endfor -%}