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:
parent
63b178ec3d
commit
2f79aab084
@ -116,6 +116,15 @@
|
|||||||
.ngmodule-list {
|
.ngmodule-list {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
|
.selector-list {
|
||||||
|
ul {
|
||||||
|
padding: 0;
|
||||||
|
li {
|
||||||
|
list-style: none;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
aio/tools/transforms/angular-api-package/tag-defs/selectors.js
vendored
Normal file
3
aio/tools/transforms/angular-api-package/tag-defs/selectors.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module.exports = function() {
|
||||||
|
return {name: 'selectors'};
|
||||||
|
};
|
@ -1,19 +1,14 @@
|
|||||||
{%- if doc.selector %}
|
{%- if doc.selector %}
|
||||||
<section class="selectors">
|
<section class="selector-list">
|
||||||
<h2>Selectors</h2>
|
<h2>Selectors</h2>
|
||||||
<table class="is-full-width list-table selector-table">
|
{% if doc.selectors %}
|
||||||
<thead>
|
{$ doc.selectors | marked $}
|
||||||
<tr>
|
{% else %}
|
||||||
<th>Selector</th>
|
<ul>
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{%- for selector in doc.selectorArray %}
|
{%- for selector in doc.selectorArray %}
|
||||||
<tr class="selector">
|
<li><code>{$ selector $}</code></li>
|
||||||
<td><code>{$ selector $}</code></td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</ul>
|
||||||
</table>
|
{% endif %}
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user