Skip to content

Commit fa45354

Browse files
committed
Integrate Darkfish change: Make methods and attributes linkable
1 parent 42f1b2f commit fa45354

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

lib/rdoc/generator/template/rorvswild/class.rhtml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@
4747
<%- attributes.each do |attrib| -%>
4848
<div id="<%= attrib.aref %>" class="method-detail">
4949
<div class="method-heading attribute-method-heading">
50-
<span class="method-name"><%= h attrib.name %></span>
51-
<span class="attribute-access-type">[<%= attrib.rw %>]</span>
50+
<a href="#<%= attrib.aref %>" title="Link to this attribute">
51+
<span class="method-name"><%= h attrib.name %></span>
52+
<span class="attribute-access-type">[<%= attrib.rw %>]</span>
53+
</a>
5254
</div>
5355

5456
<div class="method-description">
@@ -78,21 +80,27 @@
7880
<%- if (call_seq = method.call_seq) then -%>
7981
<%- call_seq.strip.split("\n").each_with_index do |call_seq, i| -%>
8082
<div class="method-heading">
81-
<span class="method-callseq">
82-
<%= h(call_seq.strip.
83+
<a href="#<%= method.aref %>" title="Link to this method">
84+
<span class="method-callseq">
85+
<%= h(call_seq.strip.
8386
gsub( /^\w+\./m, '')).
8487
gsub(/(.*)[-=]&gt;/, '\1&rarr;') %>
85-
</span>
88+
</span>
89+
</a>
8690
</div>
8791
<%- end -%>
8892
<%- elsif method.has_call_seq? then -%>
8993
<div class="method-heading">
90-
<span class="method-name"><%= h method.name %></span>
94+
<a href="#<%= method.aref %>" title="Link to this method">
95+
<span class="method-name"><%= h method.name %></span>
96+
</a>
9197
</div>
9298
<%- else -%>
9399
<div class="method-heading">
94-
<span class="method-name"><%= h method.name %></span>
95-
<span class="method-args"><%= h method.param_seq %></span>
100+
<a href="#<%= method.aref %>" title="Link to this method">
101+
<span class="method-name"><%= h method.name %></span>
102+
<span class="method-args"><%= h method.param_seq %></span>
103+
</a>
96104
</div>
97105
<%- end -%>
98106
</div>

0 commit comments

Comments
 (0)