Skip to content

Commit b842b32

Browse files
authored
chore: add css classes to api docs templates (#2328)
1 parent f702a1e commit b842b32

File tree

6 files changed

+63
-47
lines changed

6 files changed

+63
-47
lines changed

tools/dgeni/templates/class.template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<h4>{$ class.name $}</h4>
2-
<p> {$ class.description $} </p>
1+
<h3 class="docs-api-h3 docs-api-class-name">{$ class.name $}</h3>
2+
<p class="docs-api-class-description">{$ class.description $}</p>
33

44
{$ propertyList(class.properties) $}
55

tools/dgeni/templates/componentGroup.template.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
{% include 'class.template.html' %}
3333
{% endmacro %}
3434

35-
<h1>{$ doc.name $}</h1>
36-
<h2>
35+
<h1 class="docs-api-h1">{$ doc.name $}</h1>
36+
<h2 class="docs-api-h2">
3737
Module: <code>{$ doc.ngModule.name $}</code>
3838
</h2>
3939

4040

4141
{%- if doc.services.length -%}
42-
<h2>Services</h2>
42+
<h2 class="docs-api-h2">Services</h2>
4343
{% for service in doc.services %}
4444
{$ class(service) $}
4545
{% endfor %}

tools/dgeni/templates/method-list.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{%- if methodList.length -%}
2-
<h5> Methods </h5>
2+
<h4 class="docs-api-h4 docs-api-method-header">Methods</h4>
33
{% for m in methodList %}
44
{$ method(m) $}
55
{% endfor %}
Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,50 @@
1-
<table>
2-
<tr>
3-
<th colspan="2">{$ method.name $}</th>
4-
</tr>
5-
<tr>
6-
<td colspan="2"> {$ method.description $}</td>
1+
<table class="docs-api-method-table">
2+
<thead>
3+
<tr class="docs-api-method-name-row">
4+
<th colspan="2" class="docs-api-method-name-cell">{$ method.name $}</th>
5+
</tr>
6+
</thead>
7+
<tr class="docs-api-method-description-row">
8+
<td colspan="2" class="docs-api-method-description-cell">{$ method.description $}</td>
79
</tr>
810

911
{%- if method.params.length -%}
10-
<tr>
11-
<th colspan="2"> Parameters</th>
12-
</tr>
12+
<thead>
13+
<tr class="docs-api-method-parameters-header-row">
14+
<th colspan="2" class="docs-api-method-parameters-header-cell">Parameters</th>
15+
</tr>
16+
</thead>
1317
{% for parameter in method.params %}
14-
<tr>
15-
<td>
16-
<p>
18+
<tr class="docs-api-method-parameter-row">
19+
<td class="docs-api-method-parameter-cell">
20+
<p class="docs-api-method-parameter-name">
1721
{$ parameter.name $}
1822
{%- if parameter.isOptional -%}
19-
<span>?</span>
23+
<span class="docs-api-method-parameter-optional-marker">?</span>
2024
{%- endif -%}
2125
</p>
22-
<p>{$ parameter.type $}</p>
26+
<code class="docs-api-method-parameter-type">{$ parameter.type $}</code>
2327
</td>
24-
<td>
25-
{$ parameter.description $}
28+
<td class="docs-api-method-parameter-description-cell">
29+
<p class="docs-api-method-parameter-description">{$ parameter.description $}</p>
2630
</td>
2731
</tr>
2832
{% endfor %}
2933
{%- endif -%}
3034

3135
{%- if method.showReturns -%}
36+
<thead>
37+
<tr class="docs-api-method-returns-header-row">
38+
<th colspan="2" class="docs-api-method-returns-header-cell">Returns</th>
39+
</tr>
40+
</thead>
3241
<tr>
33-
<th colspan="2"> Returns</th>
34-
</tr>
35-
<tr>
36-
<td>{$ method.returnType $}</td>
37-
<td>{$ method.returns.description $}</td>
42+
<td class="docs-api-method-returns-type-cell">
43+
<code class="docs-api-method-returns-type">{$ method.returnType $}</code>
44+
</td>
45+
<td class="docs-api-method-returns-description-cell">
46+
<p class="docs-api-method-returns-description">{$ method.returns.description $}</p>
47+
</td>
3848
</tr>
3949
{%- endif -%}
4050
</table>

tools/dgeni/templates/property-list.template.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{%- if propertyList.length -%}
2-
<h5> Properties </h5>
3-
<table>
4-
<tr>
5-
<th>Name</th>
6-
<th>Description</th>
2+
<h4 class="docs-api-h4 docs-api-method-header">Properties</h4>
3+
<table class="docs-api-properties-table">
4+
<tr class="docs-api-properties-header-row">
5+
<th class="docs-api-properties-th">Name</th>
6+
<th class="docs-api-properties-th">Description</th>
77
</tr>
88
{% for p in propertyList %}
99
{$ property(p) $}
Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1-
<tr>
2-
<td>
1+
<tr class="docs-api-properties-row">
2+
<td class="docs-api-properties-name-cell">
33
{%- if property.isDirectiveInput -%}
4-
{%- if property.directiveInputAlias -%}
5-
<p>@Input({$ property.directiveInputAlias $})</p>
6-
{% else %}
7-
<p>@Input()</p>
8-
{%- endif -%}
4+
<div class="docs-api-input-marker">
5+
{%- if property.directiveInputAlias -%}
6+
@Input(<span class="docs-api-input-alias">{$ property.directiveInputAlias $}</span>)
7+
{% else %}
8+
@Input()
9+
{%- endif -%}
10+
</div>
911
{%- endif -%}
1012
{%- if property.isDirectiveOutput -%}
11-
{%- if property.directiveOutputAlias -%}
12-
<p>@Output({$ property.directiveOutputAlias $})</p>
13-
{% else %}
14-
<p>@Output()</p>
15-
{%- endif -%}
13+
<div class="docs-api-output-marker">
14+
{%- if property.directiveOutputAlias -%}
15+
@Output(<span class="docs-api-output-alias">{$ property.directiveOutputAlias $}</span>)
16+
{% else %}
17+
@Output()
18+
{%- endif -%}
19+
</div>
1620
{%- endif -%}
1721

18-
<p>{$ property.name $}</p>
19-
<p><code>{$ property.type $}</code></p>
22+
<p class="docs-api-property-name">
23+
{$ property.name $}
24+
</p>
25+
<code class="docs-api-property-type">{$ property.type $}</code>
2026
</td>
21-
<td> {$ property.description $}</td>
27+
<td class="docs-api-property-description">{$ property.description $}</td>
2228
</tr>

0 commit comments

Comments
 (0)