Skip to content

Commit fbd6851

Browse files
chore(doc-gen): add ids to members to allow direct linking
You can now write a link to a member of a class by appending the member name to the class name joined by a hash sign: ``` {@link ControlGroupDirective#addDirective `addDirective`} ``` By default the link will contain the text of the class rather than the member so you must add it as an inline code text snippet in the link tag. Closes angular#1432
1 parent d6dae0c commit fbd6851

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

docs/app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h3><a href="{{section.path}}">{{section.name}}</a></h3>
4747

4848

4949
<md-content class="md-padding">
50-
<ng-include src="nav.currentPage.partial"></ng-include>
50+
<ng-include autoscroll src="nav.currentPage.partial"></ng-include>
5151
</md-content>
5252

5353
</section>

docs/dgeni-package/templates/class.template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h2>Members</h2>
1212

1313
{%- if doc.constructorDoc %}
1414
<section class="member constructor">
15-
<h1 class="name">{$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.params) $}</h1>
15+
<h1 id="constructor" class="name">{$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.params) $}</h1>
1616
{% marked %}
1717
{$ doc.constructorDoc.description $}
1818
{% endmarked %}
@@ -21,7 +21,7 @@ <h1 class="name">{$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.pa
2121

2222
{%- for member in doc.members %}{% if not member.private %}
2323
<section class="member">
24-
<h1 class="name">{$ member.name $}{$ paramList(member.params) $}</h1>
24+
<h1 id="{$ member.name $}" class="name">{$ member.name $}{$ paramList(member.params) $}</h1>
2525
{% marked %}
2626
{$ member.description $}
2727
{% endmarked %}

0 commit comments

Comments
 (0)