Skip to content

Commit 7f4516a

Browse files
devversiontinayuangao
authored andcommitted
build(docs): markdown for api descriptions (#4689)
* Parses Class, Property and Method descriptions using a markdown filter from Dgeni. Closes #3924
1 parent 085b459 commit 7f4516a

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

tools/dgeni/templates/class.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h4 class="docs-api-h4 docs-api-class-name">
22
<code>{$ class.name $}</code>
33
</h4>
4-
<p class="docs-api-class-description">{$ class.description $}</p>
4+
<p class="docs-api-class-description">{$ class.description | marked | safe $}</p>
55

66
{%- if class.directiveSelectors -%}
77
<div class="docs-api-directive-selectors">

tools/dgeni/templates/method.template.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
</tr>
1111
</thead>
1212
<tr class="docs-api-method-description-row">
13-
<td colspan="2" class="docs-api-method-description-cell">{$ method.description $}</td>
13+
<td colspan="2" class="docs-api-method-description-cell">
14+
{$ method.description | marked | safe $}
15+
</td>
1416
</tr>
1517

1618
{%- if method.params.length -%}
@@ -31,7 +33,9 @@
3133
<code class="docs-api-method-parameter-type">{$ parameter.type $}</code>
3234
</td>
3335
<td class="docs-api-method-parameter-description-cell">
34-
<p class="docs-api-method-parameter-description">{$ parameter.description $}</p>
36+
<p class="docs-api-method-parameter-description">
37+
{$ parameter.description | marked | safe $}
38+
</p>
3539
</td>
3640
</tr>
3741
{% endfor %}
@@ -48,7 +52,9 @@
4852
<code class="docs-api-method-returns-type">{$ method.returnType $}</code>
4953
</td>
5054
<td class="docs-api-method-returns-description-cell">
51-
<p class="docs-api-method-returns-description">{$ method.returns.description $}</p>
55+
<p class="docs-api-method-returns-description">
56+
{$ method.returns.description | marked | safe $}
57+
</p>
5258
</td>
5359
</tr>
5460
{%- endif -%}

tools/dgeni/templates/property.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
</p>
2828
<code class="docs-api-property-type">{$ property.type $}</code>
2929
</td>
30-
<td class="docs-api-property-description">{$ property.description $}</td>
30+
<td class="docs-api-property-description">{$ property.description | marked | safe $}</td>
3131
</tr>

0 commit comments

Comments
 (0)