From cb84b1d1c63eab160ba3a014f2ae4e05bb277b83 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Wed, 8 Aug 2018 15:15:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B1=89=E5=8C=96=20API=20=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/api/base.template.html | 8 +++--- .../templates/api/class.template.html | 10 +++---- .../templates/api/decorator.template.html | 2 +- .../templates/api/directive.template.html | 4 +-- .../templates/api/enum.template.html | 4 +-- .../templates/api/function.template.html | 4 +-- .../templates/api/includes/annotations.html | 2 +- .../api/includes/class-overview.html | 2 +- .../api/includes/decorator-overview.html | 6 ++--- .../templates/api/includes/deprecation.html | 4 +-- .../templates/api/includes/description.html | 4 +-- .../templates/api/includes/export-as.html | 2 +- .../templates/api/includes/info-bar.html | 6 ++--- .../api/includes/interface-overview.html | 6 ++--- .../templates/api/includes/metadata.html | 2 +- .../templates/api/includes/pipe-overview.html | 4 +-- .../api/includes/security-notes.html | 4 +-- .../templates/api/includes/see-also.html | 2 +- .../templates/api/includes/selectors.html | 2 +- .../templates/api/includes/usageNotes.html | 2 +- .../templates/api/interface.template.html | 4 +-- .../templates/api/lib/directiveHelpers.html | 4 +-- .../templates/api/lib/githubLinks.html | 6 ++--- .../templates/api/lib/memberHelpers.html | 26 +++++++++---------- .../templates/api/package.template.html | 22 ++++++++-------- .../templates/overview-dump.template.html | 6 ++--- 26 files changed, 74 insertions(+), 74 deletions(-) diff --git a/aio/tools/transforms/templates/api/base.template.html b/aio/tools/transforms/templates/api/base.template.html index 72b6fe9a7a..2a02c871bb 100644 --- a/aio/tools/transforms/templates/api/base.template.html +++ b/aio/tools/transforms/templates/api/base.template.html @@ -19,10 +19,10 @@

{$ doc.name $}

- {% if doc.deprecated !== undefined %}{% endif %} - {% if doc.experimental !== undefined %}{% endif %} - {% if doc.stable !== undefined %}{% endif %} - {% if doc.pipeOptions.pure === 'false' %}{% endif %} + {% if doc.deprecated !== undefined %}{% endif %} + {% if doc.experimental !== undefined %}{% endif %} + {% if doc.stable !== undefined %}{% endif %} + {% if doc.pipeOptions.pure === 'false' %}{% endif %}
diff --git a/aio/tools/transforms/templates/api/class.template.html b/aio/tools/transforms/templates/api/class.template.html index 45cd8ad08d..d797b0f0ee 100644 --- a/aio/tools/transforms/templates/api/class.template.html +++ b/aio/tools/transforms/templates/api/class.template.html @@ -9,15 +9,15 @@ {% block details %} {% block additional %}{% endblock %} {% include "includes/description.html" %} - {$ memberHelpers.renderProperties(doc.staticProperties, 'static-properties', 'static-property', 'Static properties') $} - {$ memberHelpers.renderMethodDetails(versionInfo, doc.staticMethods, 'static-methods', 'static-method', 'Static methods') $} + {$ memberHelpers.renderProperties(doc.staticProperties, 'static-properties', 'static-property', '静态属性') $} + {$ memberHelpers.renderMethodDetails(versionInfo, doc.staticMethods, 'static-methods', 'static-method', '静态方法') $} {% if doc.constructorDoc %} -

Constructor

+

构造函数

{$ memberHelpers.renderMethodDetail(versionInfo, doc.constructorDoc, 'constructor') $}{% endif %} - {$ memberHelpers.renderProperties(doc.properties, 'instance-properties', 'instance-property', 'Properties') $} + {$ memberHelpers.renderProperties(doc.properties, 'instance-properties', 'instance-property', '属性') $} - {$ memberHelpers.renderMethodDetails(versionInfo, doc.methods, 'instance-methods', 'instance-method', 'Methods') $} + {$ memberHelpers.renderMethodDetails(versionInfo, doc.methods, 'instance-methods', 'instance-method', '方法') $} {% block annotations %}{% include "includes/annotations.html" %}{% endblock %} {% endblock %} diff --git a/aio/tools/transforms/templates/api/decorator.template.html b/aio/tools/transforms/templates/api/decorator.template.html index dca547549f..11fb49add7 100644 --- a/aio/tools/transforms/templates/api/decorator.template.html +++ b/aio/tools/transforms/templates/api/decorator.template.html @@ -8,7 +8,7 @@ {% include "includes/description.html" %}
-

Options

+

选项

{% for option in doc.members %} diff --git a/aio/tools/transforms/templates/api/directive.template.html b/aio/tools/transforms/templates/api/directive.template.html index 79c9fc8752..739c752f97 100644 --- a/aio/tools/transforms/templates/api/directive.template.html +++ b/aio/tools/transforms/templates/api/directive.template.html @@ -5,8 +5,8 @@ {% block overview %}{% include "includes/directive-overview.html" %}{% endblock %} {% block additional -%} {% include "includes/selectors.html" %} - {$ directiveHelper.renderBindings(doc.inputs, 'inputs', 'input', 'Inputs') $} - {$ directiveHelper.renderBindings(doc.outputs, 'outputs', 'output', 'Outputs') $} + {$ directiveHelper.renderBindings(doc.inputs, 'inputs', 'input', '输入参数') $} + {$ directiveHelper.renderBindings(doc.outputs, 'outputs', 'output', '输出参数') $} {% include "includes/export-as.html" %} {% endblock %} diff --git a/aio/tools/transforms/templates/api/enum.template.html b/aio/tools/transforms/templates/api/enum.template.html index 0f07f88cbc..e4b13d8d01 100644 --- a/aio/tools/transforms/templates/api/enum.template.html +++ b/aio/tools/transforms/templates/api/enum.template.html @@ -10,5 +10,5 @@ enum {$ doc.name $} {{$ memberHelpers.renderMembers(doc) $} {% include "includes/description.html" %} -{$ memberHelpers.renderProperties(doc.properties, 'members', 'member', 'Members', ['Member', 'Value']) $} -{% endblock %} \ No newline at end of file +{$ memberHelpers.renderProperties(doc.properties, 'members', 'member', '成员列表', ['成员', '值']) $} +{% endblock %} diff --git a/aio/tools/transforms/templates/api/function.template.html b/aio/tools/transforms/templates/api/function.template.html index c5707f1f2a..8234d80c4e 100644 --- a/aio/tools/transforms/templates/api/function.template.html +++ b/aio/tools/transforms/templates/api/function.template.html @@ -18,7 +18,7 @@ {% include "includes/description.html" %} {% if doc.overloads.length >= 3 %}
-

Overloads

+

重载形式

{% for overload in doc.overloads %} @@ -30,4 +30,4 @@
{% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/aio/tools/transforms/templates/api/includes/annotations.html b/aio/tools/transforms/templates/api/includes/annotations.html index 0f5ad42332..8527a6d1a8 100644 --- a/aio/tools/transforms/templates/api/includes/annotations.html +++ b/aio/tools/transforms/templates/api/includes/annotations.html @@ -1,6 +1,6 @@ {%- if doc.decorators.length %}
-

Annotations

+

注解

{%- for decorator in doc.decorators %} @{$ decorator.name $}({$ decorator.arguments $}) {% if not decorator.notYetDocumented %}{$ decorator.description | marked $}{% endif %} diff --git a/aio/tools/transforms/templates/api/includes/class-overview.html b/aio/tools/transforms/templates/api/includes/class-overview.html index d9064a17bf..1bf2aeb441 100644 --- a/aio/tools/transforms/templates/api/includes/class-overview.html +++ b/aio/tools/transforms/templates/api/includes/class-overview.html @@ -5,5 +5,5 @@ {% if doc.isAbstract %}abstract {% endif%}{$ doc.docType $} {$ doc.name $}{$ doc.typeParams | escape $}{$ memberHelper.renderHeritage(doc) $} {{$ memberHelper.renderMembers(doc) $} } -{$ descendants.renderDescendants(doc, 'class', 'Subclasses') $} +{$ descendants.renderDescendants(doc, 'class', '子类') $}
diff --git a/aio/tools/transforms/templates/api/includes/decorator-overview.html b/aio/tools/transforms/templates/api/includes/decorator-overview.html index 657a4933d1..2fb84066f4 100644 --- a/aio/tools/transforms/templates/api/includes/decorator-overview.html +++ b/aio/tools/transforms/templates/api/includes/decorator-overview.html @@ -3,7 +3,7 @@ {% macro renderOptionsTable(doc) %} - + {%- for option in doc.members %} @@ -20,7 +20,7 @@
OptionDescription
选项说明
{% for ancestor in doc.extendsClauses %}{% if ancestor.doc %} -

Inherited from {$ ancestor.doc.name $} decorator

+

继承自 {$ ancestor.doc.name $} 装饰器

{$ renderOptionsTable(ancestor.doc) $} {% endif %}{% endfor %} {% endmacro %} @@ -28,6 +28,6 @@ {% if doc.members.length %}
{$ renderOptionsTable(doc) $} - {$ descendants.renderDescendants(doc, 'decorator', 'Subclasses') $} + {$ descendants.renderDescendants(doc, 'decorator', '子类') $}
{% endif %} diff --git a/aio/tools/transforms/templates/api/includes/deprecation.html b/aio/tools/transforms/templates/api/includes/deprecation.html index 8286ab4148..e5274db7be 100644 --- a/aio/tools/transforms/templates/api/includes/deprecation.html +++ b/aio/tools/transforms/templates/api/includes/deprecation.html @@ -1,6 +1,6 @@ {% if doc.deprecated %}
-

Deprecation notes

+

弃用说明

{$ doc.deprecated | marked $}
-{% endif %} \ No newline at end of file +{% endif %} diff --git a/aio/tools/transforms/templates/api/includes/description.html b/aio/tools/transforms/templates/api/includes/description.html index d5545c06e7..79bfd4edc7 100644 --- a/aio/tools/transforms/templates/api/includes/description.html +++ b/aio/tools/transforms/templates/api/includes/description.html @@ -1,6 +1,6 @@ {% if doc.description %}
-

Description

+

说明

{$ doc.description | trimBlankLines | marked $}
-{% endif %} \ No newline at end of file +{% endif %} diff --git a/aio/tools/transforms/templates/api/includes/export-as.html b/aio/tools/transforms/templates/api/includes/export-as.html index a3fed860db..ea769ce1e9 100644 --- a/aio/tools/transforms/templates/api/includes/export-as.html +++ b/aio/tools/transforms/templates/api/includes/export-as.html @@ -1,6 +1,6 @@ {%- if doc.exportAs %}
-

Exported as

+

导出为

{$ doc.exportAs $}
diff --git a/aio/tools/transforms/templates/api/includes/info-bar.html b/aio/tools/transforms/templates/api/includes/info-bar.html index 5a30c525ba..868405622e 100644 --- a/aio/tools/transforms/templates/api/includes/info-bar.html +++ b/aio/tools/transforms/templates/api/includes/info-bar.html @@ -6,15 +6,15 @@ - + - + - + {% if doc.ngModule %} diff --git a/aio/tools/transforms/templates/api/includes/interface-overview.html b/aio/tools/transforms/templates/api/includes/interface-overview.html index 7b2b8d6b06..31381f71db 100644 --- a/aio/tools/transforms/templates/api/includes/interface-overview.html +++ b/aio/tools/transforms/templates/api/includes/interface-overview.html @@ -5,6 +5,6 @@ interface {$ doc.name $}{$ doc.typeParams | escape $}{$ memberHelper.renderHeritage(doc) $} {{$ memberHelper.renderMembers(doc) $} } -{$ descendants.renderDescendants(doc, 'interface', 'Child interfaces') $} -{$ descendants.renderDescendants(doc, 'class', 'Class implementations') $} - \ No newline at end of file +{$ descendants.renderDescendants(doc, 'interface', '子接口') $} +{$ descendants.renderDescendants(doc, 'class', '实现类') $} + diff --git a/aio/tools/transforms/templates/api/includes/metadata.html b/aio/tools/transforms/templates/api/includes/metadata.html index 9aa301e44d..e37e9a0e48 100644 --- a/aio/tools/transforms/templates/api/includes/metadata.html +++ b/aio/tools/transforms/templates/api/includes/metadata.html @@ -1,6 +1,6 @@ {% if doc.members.length %} diff --git a/aio/tools/transforms/templates/api/includes/security-notes.html b/aio/tools/transforms/templates/api/includes/security-notes.html index ff13159b9d..6a8ba71c5c 100644 --- a/aio/tools/transforms/templates/api/includes/security-notes.html +++ b/aio/tools/transforms/templates/api/includes/security-notes.html @@ -1,6 +1,6 @@ {% if doc.security %}
-

Security risk

+

安全风险

{$ doc.security | marked $}
-{% endif %} \ No newline at end of file +{% endif %} diff --git a/aio/tools/transforms/templates/api/includes/see-also.html b/aio/tools/transforms/templates/api/includes/see-also.html index 5d37c3340f..2cb42b764e 100644 --- a/aio/tools/transforms/templates/api/includes/see-also.html +++ b/aio/tools/transforms/templates/api/includes/see-also.html @@ -1,6 +1,6 @@ {%- if doc.see.length %}
-

See also

+

参见

    {% for see in doc.see %}
  • {$ see | marked $}
  • {% endfor %} diff --git a/aio/tools/transforms/templates/api/includes/selectors.html b/aio/tools/transforms/templates/api/includes/selectors.html index 0e14513b37..70c7f66b24 100644 --- a/aio/tools/transforms/templates/api/includes/selectors.html +++ b/aio/tools/transforms/templates/api/includes/selectors.html @@ -1,6 +1,6 @@ {%- if doc.selector %}
    -

    Selectors

    +

    选择器

    {%- for selector in doc.selector.split(',') %} {$ selector $}{% endfor %} diff --git a/aio/tools/transforms/templates/api/includes/usageNotes.html b/aio/tools/transforms/templates/api/includes/usageNotes.html index 7b5b0b20ea..8495c5a62c 100644 --- a/aio/tools/transforms/templates/api/includes/usageNotes.html +++ b/aio/tools/transforms/templates/api/includes/usageNotes.html @@ -1,6 +1,6 @@ {% if doc.usageNotes %}
    -

    Usage notes

    +

    使用说明

    {$ doc.usageNotes | marked $}
    {% endif %} diff --git a/aio/tools/transforms/templates/api/interface.template.html b/aio/tools/transforms/templates/api/interface.template.html index 79fb8c5c12..0406969834 100644 --- a/aio/tools/transforms/templates/api/interface.template.html +++ b/aio/tools/transforms/templates/api/interface.template.html @@ -6,6 +6,6 @@ {% block overview %}{% include "includes/interface-overview.html" %}{% endblock %} {% block details %} {% include "includes/description.html" %} - {$ memberHelper.renderProperties(doc.properties, 'instance-properties', 'instance-property', 'Properties') $} - {$ memberHelper.renderMethodDetails(versionInfo, doc.methods, 'instance-methods', 'instance-method', 'Methods') $} + {$ memberHelper.renderProperties(doc.properties, 'instance-properties', 'instance-property', '属性') $} + {$ memberHelper.renderMethodDetails(versionInfo, doc.methods, 'instance-methods', 'instance-method', '方法') $} {% endblock %} diff --git a/aio/tools/transforms/templates/api/lib/directiveHelpers.html b/aio/tools/transforms/templates/api/lib/directiveHelpers.html index 937f02b891..ea5f79b251 100644 --- a/aio/tools/transforms/templates/api/lib/directiveHelpers.html +++ b/aio/tools/transforms/templates/api/lib/directiveHelpers.html @@ -4,10 +4,10 @@

    {$ title $}

    {% for binding in bindings %}
    - {$ binding.bindingName $} bound to {$ binding.memberDoc.containerDoc.name $}.{$ binding.propertyName $} + {$ binding.bindingName $} 绑定到 {$ binding.memberDoc.containerDoc.name $}.{$ binding.propertyName $} {#{$ binding.memberDoc.description | trimBlankLines | marked $}#}
    {% endfor %}
    {% endif %} -{%- endmacro %} \ No newline at end of file +{%- endmacro %} diff --git a/aio/tools/transforms/templates/api/lib/githubLinks.html b/aio/tools/transforms/templates/api/lib/githubLinks.html index f99b37543b..1088a7d1cf 100644 --- a/aio/tools/transforms/templates/api/lib/githubLinks.html +++ b/aio/tools/transforms/templates/api/lib/githubLinks.html @@ -13,7 +13,7 @@ https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInf {% macro githubLinks(doc, versionInfo) -%} -{%- endmacro -%} \ No newline at end of file +{%- endmacro -%} diff --git a/aio/tools/transforms/templates/api/lib/memberHelpers.html b/aio/tools/transforms/templates/api/lib/memberHelpers.html index 0a8fca6a07..79431b2af8 100644 --- a/aio/tools/transforms/templates/api/lib/memberHelpers.html +++ b/aio/tools/transforms/templates/api/lib/memberHelpers.html @@ -24,7 +24,7 @@ {%- for ancestor in doc.extendsClauses %}{% if ancestor.doc %} - // inherited from {$ ancestor.doc.id $}{$ renderMembers(ancestor.doc) $}{% endif %}{% endfor -%} + // 继承自 {$ ancestor.doc.id $}{$ renderMembers(ancestor.doc) $}{% endif %}{% endfor -%} {%- endmacro -%} {%- macro renderMemberSyntax(member, truncateLines) -%} @@ -47,19 +47,19 @@ {$ renderMemberSyntax(overload) $} -

    Parameters

    +

    参数

    {$ params.renderParameters(overload.parameterDocs, cssClass + '-parameters', cssClass + '-parameter') $} {% if overload.type or overload.returns.type %} -

    Returns

    +

    返回值

    {% marked %}`{$ (overload.type or overload.returns.type) $}`{% if overload.returns %}: {$ overload.returns.description $}{% endif %}{% endmarked %} {% endif %} {% if overload.throws.length %} -

    Throws

    +

    异常

    {% for error in overload.throws %} -{% marked %}`{$ (error.typeList or 'Error') $}` {$ error.description $}{% endmarked %} +{% marked %}`{$ (error.typeList or '错误') $}` {$ error.description $}{% endmarked %} {% endfor %} {% endif %} @@ -76,8 +76,8 @@ {% if method.name !== 'constructor' %}
npm Packagenpm 包 @angular/{$ doc.moduleDoc.id.split('/')[0] $}
Module模块 import { {$ doc.name $} } from '@angular/{$ doc.moduleDoc.id $}';
Source源码 {$ github.githubViewLink(doc, versionInfo) $}
-

{$ method.overloads.length $} overloads...

+

{$ method.overloads.length $} 的重载形式...

{% for overload in method.overloads %} {$ renderOverloadInfo(overload, cssClass + '-overload', method) $} @@ -161,9 +161,9 @@ - - {% if hasTypes %}{% endif %} - + + {% if hasTypes %}{% endif %} + @@ -172,10 +172,10 @@ {% if hasTypes %}{% endif %} {% endfor %} diff --git a/aio/tools/transforms/templates/api/package.template.html b/aio/tools/transforms/templates/api/package.template.html index 3583ee6a0b..0754476ba4 100644 --- a/aio/tools/transforms/templates/api/package.template.html +++ b/aio/tools/transforms/templates/api/package.template.html @@ -24,17 +24,17 @@ {% include "includes/see-also.html" %} -

Entry points

- {$ listItems([doc.packageInfo.primary], 'Primary') $} - {$ listItems(doc.packageInfo.secondary, 'Secondary') $} +

入口点

+ {$ listItems([doc.packageInfo.primary], '主要') $} + {$ listItems(doc.packageInfo.secondary, '次要') $} -

Exports

- {$ listItems(doc.classes, 'Classes') $} - {$ listItems(doc.decorators, 'Decorators') $} - {$ listItems(doc.functions, 'Functions') $} - {$ listItems(doc.structures, 'Structures') $} - {$ listItems(doc.directives, 'Directives') $} - {$ listItems(doc.pipes, 'Pipes') $} - {$ listItems(doc.types, 'Types') $} +

导出列表

+ {$ listItems(doc.classes, '类') $} + {$ listItems(doc.decorators, '装饰器') $} + {$ listItems(doc.functions, '函数') $} + {$ listItems(doc.structures, '结构') $} + {$ listItems(doc.directives, '指令') $} + {$ listItems(doc.pipes, '管道') $} + {$ listItems(doc.types, '类型') $} {%- endblock %} diff --git a/aio/tools/transforms/templates/overview-dump.template.html b/aio/tools/transforms/templates/overview-dump.template.html index 14039af667..ee30c40b4d 100644 --- a/aio/tools/transforms/templates/overview-dump.template.html +++ b/aio/tools/transforms/templates/overview-dump.template.html @@ -1,9 +1,9 @@ {% import "api/lib/githubLinks.html" as github -%} {% import "api/lib/memberHelpers.html" as members -%} -{% macro goToCode(doc) %}{% endmacro %} +{% macro goToCode(doc) %}{% endmacro %} {% macro label(test, class, text) %}{% if test %}{% endif %}{% endmacro %} {% macro renderLabels(doc) -%} - {$ label(doc.notYetDocumented, 'no-doc', 'UNDOCUMENTED') $} + {$ label(doc.notYetDocumented, 'no-doc', '尚无文档') $} {%- for tag in doc.tags.tags %}{$ label(tag.tagDef.deprecated, 'deprecated', '@' + tag.tagDef.name + ' deprecated') $}{% endfor %} {% endmacro %} {% macro renderMember(member) -%} @@ -79,7 +79,7 @@ -

Documentation Status Report

+

文档状态报告

{% for module in doc.modules %}
{$ headings[0] or 'Property' $}{$ headings[1] or 'Type' $}{$ headings[2] or 'Description' $}{$ headings[0] or '属性名' $}{$ headings[1] or '类型' $}{$ headings[2] or '说明' $}
{$ property.name $} - {%- if (property.isGetAccessor or property.isReadonly) and not property.isSetAccessor %}Read-only.{% endif %} + {%- if (property.isGetAccessor or property.isReadonly) and not property.isSetAccessor %}只读{% endif %} {% if property.shortDescription %}{$ property.shortDescription | marked $}{% endif %} {$ (property.description or property.constructorParamDoc.description) | marked $} - {% if property.constructorParamDoc %} Declared in constructor.{% endif %} + {% if property.constructorParamDoc %} 声明于构造函数中{% endif %}