build(aio): render param descriptions for function exports (#22534)

Closes #22501

PR Close #22534
This commit is contained in:
Pete Bacon Darwin 2018-03-01 20:19:18 +00:00 committed by Alex Eagle
parent 12be311618
commit 1d2bdcb4d0
1 changed files with 23 additions and 14 deletions

View File

@ -1,24 +1,33 @@
{% import "lib/memberHelpers.html" as memberHelpers -%}
{% import "lib/paramList.html" as params -%}
{% extends 'export-base.template.html' -%}
{% block overview %}
<code-example language="ts" hideCopy="true" class="no-box api-heading">
function {$ doc.name $}{$ doc.typeParameters | escape $}{$ params.paramList(doc.parameters) $}
{%- if doc.type %}: {$ doc.type | escape $}{% endif %};
</code-example>
{% if doc.overloads.length > 0 and doc.overloads < 3 -%}
{% for overload in doc.overloads -%}
{$ memberHelpers.renderOverloadInfo(overload, 'function-overload', doc) $}
{% if not loop.last %}<hr class="hr-margin fullwidth">{% endif %}
{% endfor -%}
{% else %}
{$ memberHelpers.renderOverloadInfo(doc, 'function-overload', doc) $}
{% endif %}
{% endblock %}
{% block details %}
{% include "includes/description.html" %}
{% if doc.overloads.length %}
<h2>Overloads</h2>{% for overload in doc.overloads %}
<code-example language="ts" hideCopy="true" class="no-box api-heading">
function {$ overload.name $}{$ doc.typeParameters | escape $}{$ params.paramList(overload.parameters) $}
{%- if overload.type %}: {$ overload.type | escape $}{% endif %};
</code-example>
<section class="description">
{$ overload.description | trimBlankLines | marked $}
</section>
{% endfor %}
{% if doc.overloads.length >= 3 %}
<section class="overloads">
<h2>Overloads</h2>
<table>
{% for overload in doc.overloads %}
<tr>
<td>
{$ memberHelpers.renderOverloadInfo(overload, 'function-overload', doc) $}
</td>
</tr>
{% endfor %}
</table>
</section>
{% endif %}
{% endblock %}