build(docs-infra): clean up API package template (#25453)

PR Close #25453
This commit is contained in:
Pete Bacon Darwin 2018-08-13 10:56:24 +01:00 committed by Ben Lesh
parent bf441e8b9e
commit 2f85b1691a

View File

@ -1,6 +1,6 @@
{% extends 'base.template.html' -%} {% extends 'base.template.html' -%}
{% macro listItems(items, title) %} {% macro listItems(items, title, overridePath) %}
{% if items.length %} {% if items.length %}
<section class="export-list"> <section class="export-list">
<h3>{$ title $}</h3> <h3>{$ title $}</h3>
@ -8,7 +8,7 @@
{% for item in items %} {% for item in items %}
<tr> <tr>
<td><code class="code-anchor"> <td><code class="code-anchor">
<a href="{$ item.path $}">{$ item.name $}</a></code></td> <a href="{$ overridePath or item.path $}">{$ item.name $}</a></code></td>
<td>{% if item.shortDescription %}{$ item.shortDescription | marked $}{% endif %}</td> <td>{% if item.shortDescription %}{$ item.shortDescription | marked $}{% endif %}</td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -24,12 +24,13 @@
{% include "includes/see-also.html" %} {% include "includes/see-also.html" %}
{% if doc.isPrimaryPackage %}
<h2>Entry points</h2> <h2>Entry points</h2>
{$ listItems([doc.packageInfo.primary], 'Primary') $} {$ listItems([doc.packageInfo.primary], 'Primary', '#primary-entry-point-exports') $}
{$ listItems(doc.packageInfo.secondary, 'Secondary') $} {$ listItems(doc.packageInfo.secondary, 'Secondary') $}
{% endif %}
<h2>{% if doc.isPrimaryPackage %}Primary entry{% else %}Entry{% endif %} point exports</h2>
<h2>Exports</h2>
{$ listItems(doc.classes, 'Classes') $} {$ listItems(doc.classes, 'Classes') $}
{$ listItems(doc.decorators, 'Decorators') $} {$ listItems(doc.decorators, 'Decorators') $}
{$ listItems(doc.functions, 'Functions') $} {$ listItems(doc.functions, 'Functions') $}