build(aio): improve API docs layout and styling

This commit is contained in:
Peter Bacon Darwin 2017-07-13 13:36:51 +01:00 committed by Igor Minar
parent 04f3a4a7a5
commit a301dba68f
11 changed files with 56 additions and 18 deletions

View File

@ -2,13 +2,13 @@
{% import "lib/paramList.html" as params -%} {% import "lib/paramList.html" as params -%}
{% extends 'export-base.template.html' -%} {% extends 'export-base.template.html' -%}
{% block overview %}{% include "includes/class-overview.html" %}{% endblock %}
{% block details %} {% block details %}
{% include "includes/class-overview.html" %}
{% block additional %}{% endblock %} {% block additional %}{% endblock %}
{% include "includes/description.html" %} {% include "includes/description.html" %}
{% include "includes/annotations.html" %}
{$ memberHelpers.renderMemberDetails(doc.statics, 'static-members', 'static-member', 'Static Members') $} {$ memberHelpers.renderMemberDetails(doc.statics, 'static-members', 'static-member', 'Static Members') $}
{% include "includes/constructor.html" %} {% include "includes/constructor.html" %}
{$ memberHelpers.renderMemberDetails(doc.members, 'instance-members', 'instance-member', 'Members') $} {$ memberHelpers.renderMemberDetails(doc.members, 'instance-members', 'instance-member', 'Members') $}
{% include "includes/annotations.html" %}
{% endblock %} {% endblock %}

View File

@ -2,8 +2,8 @@
{% import "lib/paramList.html" as params -%} {% import "lib/paramList.html" as params -%}
{% extends 'export-base.template.html' %} {% extends 'export-base.template.html' %}
{% block overview %}{% include "includes/decorator-overview.html" %}{% endblock %}
{% block details %} {% block details %}
{% include "includes/decorator-overview.html" %}
{% include "includes/description.html" %} {% include "includes/description.html" %}
{$ memberHelper.renderMemberDetails(doc.members, 'metadata-members', 'metadata-member', 'Metadata Properties') $} {$ memberHelper.renderMemberDetails(doc.members, 'metadata-members', 'metadata-member', 'Metadata Properties') $}
{% endblock %} {% endblock %}

View File

@ -2,6 +2,7 @@
{% import "lib/paramList.html" as params -%} {% import "lib/paramList.html" as params -%}
{% extends 'class.template.html' -%} {% extends 'class.template.html' -%}
{% block overview %}{% include "includes/directive-overview.html" %}{% endblock %}
{% block additional -%} {% block additional -%}
{% include "includes/selectors.html" %} {% include "includes/selectors.html" %}
{$ directiveHelper.renderBindings(doc.inputs, 'inputs', 'input', 'Inputs') $} {$ directiveHelper.renderBindings(doc.inputs, 'inputs', 'input', 'Inputs') $}

View File

@ -5,6 +5,7 @@
{% include "includes/what-it-does.html" %} {% include "includes/what-it-does.html" %}
{% include "includes/security-notes.html" %} {% include "includes/security-notes.html" %}
{% include "includes/deprecation.html" %} {% include "includes/deprecation.html" %}
{% block overview %}{% endblock %}
{% include "includes/how-to-use.html" %} {% include "includes/how-to-use.html" %}
{% block details %}{% endblock %} {% block details %}{% endblock %}
{% endblock %} {% endblock %}

View File

@ -1,11 +1,14 @@
{% import "lib/paramList.html" as params -%} {% import "lib/paramList.html" as params -%}
{% extends 'export-base.template.html' -%} {% extends 'export-base.template.html' -%}
{% block details %} {% block overview %}
<code-example language="ts" hideCopy="true" class="no-box api-heading"> <code-example language="ts" hideCopy="true" class="no-box api-heading">
function {$ doc.name $}{$ params.paramList(doc.parameters) $} function {$ doc.name $}{$ params.paramList(doc.parameters) $}
{%- if doc.type %}: {$ doc.type | escape $}{% endif %}; {%- if doc.type %}: {$ doc.type | escape $}{% endif %};
</code-example> </code-example>
{% endblock %}
{% block details %}
{% include "includes/description.html" %} {% include "includes/description.html" %}
{% if doc.overloads.length %} {% if doc.overloads.length %}
<h2>Overloads</h2>{% for overload in doc.overloads %} <h2>Overloads</h2>{% for overload in doc.overloads %}

View File

@ -2,7 +2,7 @@
<section class="annotations"> <section class="annotations">
<h2>Annotations</h2> <h2>Annotations</h2>
{%- for decorator in doc.decorators %} {%- for decorator in doc.decorators %}
<code-example hideCopy="true">@{$ decorator.name $}{$ params.paramList(decorator.arguments) $}</code-example> <code-example hideCopy="true" class="no-box api-heading">@{$ decorator.name $}{$ params.paramList(decorator.arguments) $}</code-example>
{% if not decorator.notYetDocumented %}{$ decorator.description | marked $}{% endif %} {% if not decorator.notYetDocumented %}{$ decorator.description | marked $}{% endif %}
{% endfor %} {% endfor %}
</section> </section>

View File

@ -0,0 +1,14 @@
{% import "lib/memberHelpers.html" as memberHelper -%}
<section class="{$ doc.docType $}-overview">
<h2>Overview</h2>
<code-example language="ts" hideCopy="true">{% for decorator in doc.decorators %}
<a href="#annotations">@{$ decorator.name $}{$ params.paramList(decorator.arguments) $}</a>{% endfor %}
class {$ doc.name $}{$ doc.typeParams | escape $}{$ memberHelper.renderHeritage(doc) $} {
{%- if doc.statics.length %}{% for member in doc.statics %}{% if not member.internal %}
<a class="code-anchor" href="#{$ member.anchor $}">{$ memberHelper.renderMember(member, 1) $}</a>{% endif %}{% endfor %}{% endif %}
{%- if doc.members.length %}{% for member in doc.members %}{% if not member.internal %}
<a class="code-anchor" href="#{$ member.anchor $}">{$ memberHelper.renderMember(member, 1) $}</a>{% endif %}{% endfor %}{% endif %}
}
</code-example>
</section>

View File

@ -1,14 +1,27 @@
{% import "lib/githubLinks.html" as github -%} {% import "lib/githubLinks.html" as github -%}
<!-- INFO BAR --> <!-- INFO BAR -->
<div class="info-banner api-info-bar"> <section class="info-bar">
<span class="info-bar-item">
npm package: <code>@angular/{$ doc.moduleDoc.id $}</code>
</span>
{% if doc.ngModule %} <table class="is-full-width">
<span class="info-bar-item"> <tbody>
NgModule: {@link {$ doc.ngModule $}} <tr>
</span> <th>npm Package</th>
{% endif %} <td><a href="https://www.npmjs.com/package/@angular/{$ doc.moduleDoc.id.split('/')[0] $}">@angular/{$ doc.moduleDoc.id.split('/')[0] $}</a></td>
</div> </tr>
<tr>
<th>Module</th>
<td><code>import { {$ doc.name $} } from <a href="{$ doc.moduleDoc.path $}">@angular/{$ doc.moduleDoc.id $}</a>;</code></td>
</tr>
<tr>
<th>Source</th>
<td>{$ github.githubViewLink(doc, versionInfo) $}</td>
</tr>
{% if doc.ngModule %}
<tr>
<th>NgModule</th>
<td>{@link {$ doc.ngModule $}}</td>
</tr>
{% endif %}
</tbody>
</table>

View File

@ -2,8 +2,8 @@
{% import "lib/memberHelpers.html" as memberHelper -%} {% import "lib/memberHelpers.html" as memberHelper -%}
{% extends 'export-base.template.html' -%} {% extends 'export-base.template.html' -%}
{% block overview %}{% include "includes/interface-overview.html" %}{% endblock %}
{% block details %} {% block details %}
{% include "includes/interface-overview.html" %}
{% include "includes/description.html" %} {% include "includes/description.html" %}
{$ memberHelper.renderMemberDetails(doc.members, 'instance-members', 'instance-member', 'Members') $} {$ memberHelper.renderMemberDetails(doc.members, 'instance-members', 'instance-member', 'Members') $}
{% endblock %} {% endblock %}

View File

@ -1,8 +1,11 @@
{% extends 'export-base.template.html' %} {% extends 'export-base.template.html' %}
{% block details %} {% block overview %}
<code-example language="ts" hideCopy="true"> <code-example language="ts" hideCopy="true">
type {$ doc.name $}{% if doc.typeDefinition %} = {$ doc.typeDefinition | escape $}{% endif %}; type {$ doc.name $}{% if doc.typeDefinition %} = {$ doc.typeDefinition | escape $}{% endif %};
</code-example> </code-example>
{% endblock %}
{% block details %}
{% include "includes/description.html" %} {% include "includes/description.html" %}
{% endblock %} {% endblock %}

View File

@ -1,8 +1,11 @@
{% extends 'export-base.template.html' %} {% extends 'export-base.template.html' %}
{% block details %} {% block overview %}
<code-example language="ts" hideCopy="true" class="no-box api-heading"> <code-example language="ts" hideCopy="true" class="no-box api-heading">
const {$ doc.name $}: {$ doc.symbolTypeName or 'any' $}; const {$ doc.name $}: {$ doc.symbolTypeName or 'any' $};
</code-example> </code-example>
{% endblock %}
{% block details %}
{% include "includes/description.html" %} {% include "includes/description.html" %}
{% endblock %} {% endblock %}