build(docs-infra): improve directive selector rendering (#25768)

If the documentation contains a `@selectors` tag then the content of that
is used to describe the selectors of a directive.

Otherwise the selector string is split and each selector is listed as
a list item in an unordered list.

PR Close #25768
This commit is contained in:
Pete Bacon Darwin 2018-09-19 14:28:23 +01:00 committed by Alex Rickabaugh
parent f22deb2e2d
commit 46729c76a0
3 changed files with 22 additions and 15 deletions

View File

@ -116,6 +116,15 @@
.ngmodule-list {
list-style: none;
padding: 0;
.selector-list {
ul {
padding: 0;
li {
list-style: none;
margin-bottom: 12px;
}
}
}
}

View File

@ -0,0 +1,3 @@
module.exports = function() {
return {name: 'selectors'};
};

View File

@ -1,19 +1,14 @@
{%- if doc.selector %}
<section class="selectors">
<section class="selector-list">
<h2>Selectors</h2>
<table class="is-full-width list-table selector-table">
<thead>
<tr>
<th>Selector</th>
</tr>
</thead>
<tbody>
{% if doc.selectors %}
{$ doc.selectors | marked $}
{% else %}
<ul>
{%- for selector in doc.selectorArray %}
<tr class="selector">
<td><code>{$ selector $}</code></td>
</tr>
<li><code>{$ selector $}</code></li>
{% endfor %}
</tbody>
</table>
</ul>
{% endif %}
</section>
{% endif %}