Pete Bacon Darwin 59bcd45930 build(docs-infra): ensure private exported subclasses are not rendered (#40404)
Previously, only the first layer of sub-classes were filtered to remove
private exports. But on recursing down further levels these were not
filtered out.

PR Close #40404
2021-01-13 14:03:04 -08:00

22 lines
969 B
HTML

{% macro renderDescendantList(descendants, descendantType, recursed, docTypeMatcher) %}
{% if descendants.length %}
<ul>
{% for descendant in descendants %}
<li>
<code>{$ descendant.name $}</code>
{$ renderDescendantList(descendant.descendants | filterByPropertyValue('docType', docTypeMatcher) | filterByPropertyValue('privateExport', undefined), docType, recursed, docTypeMatcher) $}
</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro -%}
{%- macro renderDescendants(doc, descendantType, title='', recursed=true, docTypeMatcher=descendantType) %}
{% set descendants = doc.descendants | filterByPropertyValue('docType', docTypeMatcher) | filterByPropertyValue('privateExport', undefined) %}
{% if descendants.length %}
<div class="descendants {$ descendantType $}">
{% if title %}<h2>{$ title $}</h2>{% endif %}
{$ renderDescendantList(descendants, descendantType, recursed, docTypeMatcher) $}
</div>
{% endif %}
{% endmacro %}