{#-
API Description Component

Renders the main API description and overview information.
Handles cases where description is missing or malformed.
-#}

{% from 'macros/safe_macros.md.jinja2' import safe_section %}

{% call safe_section("api_description") %}
{% if element.description %}
{{ element.description }}
{% else %}
*No API description provided.*
{% endif %}

{% if element.metadata.summary %}
## Summary

{{ element.metadata.summary }}
{% endif %}

{% if element.metadata.terms_of_service %}
**Terms of Service:** {{ element.metadata.terms_of_service }}
{% endif %}

{% if element.metadata.contact %}
**Contact:**
{% if element.metadata.contact.email %}
- Email: {{ element.metadata.contact.email }}
{% endif %}
{% if element.metadata.contact.url %}
- URL: {{ element.metadata.contact.url }}
{% endif %}
{% endif %}

{% if element.metadata.license %}
**License:** {{ element.metadata.license.name }}{% if element.metadata.license.url %} - [{{ element.metadata.license.url }}]({{ element.metadata.license.url }}){% endif %}
{% endif %}
{% endcall %}
