build(docs-infra): display long overload parameter types as `object` (#24976)

In some overloads, the parameter type can be a large anonymous
object type.
This change displays such types as `object`. It is then up to the
documentation author to put more information about the type in the
method usage notes.

PR Close #24976
This commit is contained in:
Pete Bacon Darwin 2018-08-13 08:13:03 +01:00 committed by Kara Erickson
parent 61cd5f7c0f
commit 03417df54e
2 changed files with 5 additions and 7 deletions

View File

@ -54,7 +54,7 @@
</div>{% endif %}
<h6 class="no-anchor">Parameters</h6>
{$ params.renderParameters(overload.parameterDocs, cssClass + '-parameters', cssClass + '-parameter') $}
{$ params.renderParameters(overload.parameterDocs, cssClass + '-parameters', cssClass + '-parameter', true) $}
{% if overload.type or overload.returns.type %}
<h6 class="no-anchor">Returns</h6>
@ -157,7 +157,7 @@
{% if method.description -%}
<tr>
<td class="description">
{$ method.description | marked({ h3: 'h4' }) $}
{$ method.description | marked({ h3: 'h5' }) $}
</td>
</tr>
{%- endif %}
@ -165,7 +165,8 @@
{% if method.usageNotes -%}
<tr>
<td class="usage-notes">
{$ method.usageNotes | marked({ h3: 'h4' }) $}
<h4 id="{$ method.anchor $}-usage-notes">Usage Notes</h4>
{$ method.usageNotes | marked({ h3: 'h5' }) $}
</td>
</tr>
{%- endif %}

View File

@ -21,10 +21,7 @@
<a id="{$ parameter.anchor $}"></a>
<code>{$ parameter.name $}</code>
</td>
<td class="param-type">
<a><span><code>{$ parameter.type $}</code></span></a>
</td>
{% if showType %}<td class="param-type"><code>{$ parameter.type $}</code></td>{% endif %}
{% if showType %}<td class="param-type"><code>{% if r/^\{/.test(parameter.type) and r/\}$/.test(parameter.type) and parameter.type.length > 20 %}object{% else %}{$ parameter.type $}{% endif %}</code></td>{% endif %}
<td class="param-description">
{% marked %}
{% if (parameter.shortDescription | trim) or (parameter.description | trim) %}{$ parameter.shortDescription + '\n\n' + parameter.description $}