Skip to content

Commit

Permalink
docs: add deprecation notes to documentation pages (#6379)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmair committed May 7, 2021
1 parent 68210d7 commit 53ef494
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions docs_app/src/styles/2-modules/_api-pages.scss
Expand Up @@ -106,3 +106,8 @@
color: $pink;
}
}


.deprecated-api-item {
text-decoration: line-through;
}
19 changes: 12 additions & 7 deletions docs_app/tools/transforms/templates/api/lib/memberHelpers.html
Expand Up @@ -11,15 +11,15 @@

{%- macro renderMembers(doc) -%}
{%- for member in doc.staticProperties %}{% if not member.internal %}
<a class="code-anchor" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
<a class="code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
{% for member in doc.staticMethods %}{% if not member.internal %}
<a class="code-anchor" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
<a class="code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
{% if doc.constructorDoc and not doc.constructorDoc.internal %}
<a class="code-anchor" href="{$ doc.path $}#{$ doc.constructorDoc.anchor | urlencode $}">{$ renderMemberSyntax(doc.constructorDoc, 1) $}</a>{% endif -%}
<a class="code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href="{$ doc.path $}#{$ doc.constructorDoc.anchor | urlencode $}">{$ renderMemberSyntax(doc.constructorDoc, 1) $}</a>{% endif -%}
{% for member in doc.properties %}{% if not member.internal %}
<a class="code-anchor" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
<a class="code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
{% for member in doc.methods %}{% if not member.internal %}
<a class="code-anchor" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
<a class="code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}

{%- for ancestor in doc.extendsClauses %}{% if ancestor.doc %}

Expand All @@ -39,12 +39,17 @@

{%- macro renderOverloadInfo(overload, cssClass, method) -%}

<code-example language="ts" hideCopy="true" class="no-box api-heading">{$ renderMemberSyntax(overload) $}</code-example>
<code-example language="ts" hideCopy="true" class="no-box api-heading{% if overload.deprecated %} deprecated-api-item{% endif %}">{$ renderMemberSyntax(overload) $}</code-example>

{% if overload.shortDescription and (overload.shortDescription != method.shortDescription) %}
<div class="short-description">
{$ overload.shortDescription | marked $}
</div>{% endif %}
{% if overload.deprecated !== undefined %}
<div class="deprecated">
<h4>Deprecation Notes</h4>
{$ overload.deprecated | marked $}
</div>{% endif %}

<h4 class="no-anchor">Parameters</h4>
{$ params.renderParameters(overload.parameterDocs, cssClass + '-parameters', cssClass + '-parameter') $}
Expand Down Expand Up @@ -147,7 +152,7 @@ <h2>{$ headingText $}</h2>
<tbody>
{% for property in nonInternalProperties %}
<tr class="{$ propertyClass $}">
<td><a id="{$ property.anchor $}"></a>{$ property.name $}</td>
<td><a id="{$ property.anchor $}"></a><code class="{% if property.deprecated %} deprecated-api-item{% endif %}">{$ property.name $}</code></td>
<td><label class="property-type-label"><code>{$ property.type | escape $}</code></label></td>
<td>
{%- if (property.isGetAccessor or property.isReadonly) and not property.isSetAccessor %}<span class='read-only-property'>Read-only.</span>{% endif %}
Expand Down

0 comments on commit 53ef494

Please sign in to comment.