50 lines
2.2 KiB
Django/Jinja
50 lines
2.2 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 -%}
|
|
{%- import 'examples_macros.j2' as examples -%}
|
|
{%- 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 -%}
|
|
|
|
<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
|
<!-- see templates/registry/markdown/attribute_namespace.md.j2 -->
|
|
|
|
# {{ attrs.humanize(attrs.sentence_case(ctx.id)) | 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) }}
|
|
|
|
{% if group.brief.endswith("\n") -%}
|
|
{{ group.brief }}
|
|
{% else -%}
|
|
{{ group.brief }}
|
|
{{"\n"}}
|
|
{%- endif -%}
|
|
| Attribute | Type | Description | Examples | Stability |
|
|
|---|---|---|---|---|
|
|
{%- for attribute in group.attributes | sort(attribute="name") %}{% set attr_anchor = attribute.name | kebab_case %}
|
|
| <a id="{{ attr_anchor }}" href="#{{ attr_anchor }}">`{{ attrs.name(attribute) }}`</a> | {{ attrs.type(attribute) }} | {{ attribute.brief | trim }}{{ notes.add({"note": attribute.note, "name": attrs.name(attribute)}) }} | {{ examples.format(attribute) | trim }} | {{ stability.badge(attribute.stability, attribute.deprecated, attribute.brief) | trim }} |
|
|
{%- endfor %}
|
|
{{ notes.render() }}
|
|
{%- for enum in group.attributes | sort(attribute="name") %}
|
|
{%- if enum.type is mapping -%}{{ enums.table(enum, notes) }}{% endif %}
|
|
{%- endfor -%}
|
|
{%- endfor -%}
|