fix: 修改 API 模板,以免模板中的内容和文档中的内容被错误识别为一对

This commit is contained in:
Zhicheng WANG 2021-01-30 20:03:20 +08:00
parent 97f58fdef2
commit ade723a83d
7 changed files with 10 additions and 10 deletions

View File

@ -3,7 +3,7 @@
{% block body %}
<section class="short-description">
{$ doc.shortDescription | marked $}
{% if doc.description %}<p><a href="#description">查看"说明"...</a></p>{% endif %}
{% if doc.description %}<p no-translate><a href="#description">查看"说明"...</a></p>{% endif %}
</section>
{% include "includes/security-notes.html" %}
{% include "includes/deprecation.html" %}

View File

@ -1,6 +1,6 @@
{% if doc.security %}
<section "security">
<h2 id="security-risk">安全风险</h2>
<div><h2 id="security-risk">安全风险</h2></div>
{$ doc.security | marked $}
</section>
{% endif %}

View File

@ -211,9 +211,9 @@
</td>
<td>
{%- if (property.isGetAccessor or property.isReadonly) and not property.isSetAccessor %}<span class='read-only-property'>只读</span>{% endif %}
{%- if property.isSetAccessor and not property.isGetAccessor %}<span class='write-only-property'>Write-only.</span>{% endif %}
{% if property.constructorParamDoc %} <span class='from-constructor'>Declared in constructor.</span>{% endif %}
{% if property.shortDescription %}{$ property.shortDescription | marked $}{% endif %}
{%- if property.isSetAccessor and not property.isGetAccessor %}<span class='write-only-property'>只写</span>{% endif %}
{% if property.constructorParamDoc %} <span class='from-constructor'>声明在构造函数中</span>{% endif %}
{% if property.shortDescription %}<div no-translate>{$ property.shortDescription | marked $}</div>{% endif %}
{$ (property.description or property.constructorParamDoc.description) | marked $}
{%- if property.see.length %}
<p>参见:</p>

View File

@ -27,7 +27,7 @@
{% if (parameter.shortDescription | trim) or (parameter.description | trim) %}{$ parameter.shortDescription + '\n\n' + parameter.description $}
{% endif %}
{% if parameter.isOptional or parameter.defaultValue !== undefined %}可选. 默认值是 `{$ parameter.defaultValue === undefined and 'undefined' or parameter.defaultValue $}`.{% endif %}
{% if parameter.isOptional or parameter.defaultValue !== undefined %}<div no-translate>可选. 默认值是 `{$ parameter.defaultValue === undefined and 'undefined' or parameter.defaultValue $}`.</div>{% endif %}
{% endmarked %}
</td>
</tr>{% endfor %}

View File

@ -43,7 +43,7 @@
</a>
</td>
<td>
{% if item.deprecated !== undefined %}{$ ('**已弃用:** ' + item.deprecated) | marked $}{% endif %}
{% if item.deprecated !== undefined %}<div no-translate>{$ ('**已弃用:** ' + item.deprecated) | marked $}</div>{% endif %}
{$ item.shortDescription | marked $}
</td>
</tr>

View File

@ -10,7 +10,7 @@
<tr>
<td><code class="code-anchor{% if item.deprecated %} deprecated-api-item{% endif %}"><a href="{$ overridePath or item.path $}"{%- if item.deprecated != undefined %} class="deprecated-api-item"{% endif %}>{$ item.name $}</a></code></td>
<td>
{% if item.deprecated !== undefined %}{$ ('**已废弃:** ' + item.deprecated) | marked $}{% endif %}
{% if item.deprecated !== undefined %}<div no-translate>{$ ('**已废弃:** ' + item.deprecated) | marked $}</div>{% endif %}
{% if item.shortDescription %}{$ item.shortDescription | marked $}{% endif %}
</td>
</tr>

View File

@ -64,8 +64,8 @@
{% endif %}
{% endif %}
{$ option.description | marked $}
{% if option.default !== undefined %}<p><span class="cli-default">默认值:</span> <code class="no-auto-link">{$ option.default $}</code></p>{% endif %}
{% if option.aliases.length %}<p><span class="cli-aliases">别名:</span> {% for alias in option.aliases %}{$ renderOptionName(alias) $}{% if not loop.last %}, {% endif %}{% endfor %}</p>{% endif %}
{% if option.default !== undefined %}<p no-translate><span class="cli-default">默认值:</span> <code class="no-auto-link">{$ option.default $}</code></p>{% endif %}
{% if option.aliases.length %}<p no-translate><span class="cli-aliases">别名:</span> {% for alias in option.aliases %}{$ renderOptionName(alias) $}{% if not loop.last %}, {% endif %}{% endfor %}</p>{% endif %}
</td>
</tr>
{% endfor %}