Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f05f548

Browse files
committed
chore(doc-gen): improve headings for events and examples
The "Events" heading now gets an id (which makes them show in the table of contents, and their "Parameters" use a heading with a lower priority (previously it was the same as "Events" itself). The "@example" tag now generates the heading "Example" if there's only one, or "Examples" if there are multiple.
1 parent 8166dd4 commit f05f548

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: docs/config/templates/ngdoc/api/api.template.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h2 id="dependencies">Dependencies</h2>
5252

5353
{% block examples %}
5454
{%- if doc.examples %}
55-
<h2 id="example">Examples</h2>
55+
<h2 id="examples">{$ "Examples" if doc.examples | length > 1 else "Example" $}</h2>
5656
{%- for example in doc.examples -%}
5757
{$ example | marked $}
5858
{%- endfor -%}

Diff for: docs/config/templates/ngdoc/lib/events.template.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
{% import "lib/deprecated.html" as x -%}
33

44
{%- if doc.events %}
5-
<h2>Events</h2>
5+
<h2 id="events">Events</h2>
66
<ul class="events">
77
{%- for event in doc.events %}
88
<li id="{$ event.name $}">
9-
<h3>{$ event.name $}</h3>
9+
<h3 id="event-{$ event.name $}">{$ event.name $}</h3>
1010
<div>{$ event.description | marked $}</div>
1111

1212
{$ x.deprecatedBlock(event) $}
@@ -27,7 +27,7 @@ <h4>Target:</h4>
2727
{% endif -%}
2828
{%- if event.params %}
2929
<section class="api-section">
30-
<h3>Parameters</h3>
30+
<h4>Parameters</h4>
3131
{$ lib.paramTable(event.params) $}
3232
</section>
3333
{%- endif -%}

Diff for: docs/config/templates/ngdoc/lib/methods.template.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h4>Returns</h4>
2727
{% endif %}
2828

2929
{%- if method.examples %}
30-
<h4 id="{$ doc.name $}.{$ method.name $}-examples">Examples</h4>
30+
<h4 id="{$ doc.name $}.{$ method.name $}-examples">{$ "Examples" if method.examples | length > 1 else "Example" $}</h4>
3131
{%- for example in method.examples -%}
3232
{$ example | marked $}
3333
{%- endfor -%}

0 commit comments

Comments
 (0)