Skip to content

Commit 6ea31eb

Browse files
committed
Move method source block to the top
Currently, if a method description is long (e.g. `Array.new`), users need to click the method toggle button next to the method title, and then scroll down to the source code expanded below the description. This commit changes the behavior so that the source code is expanded immediately below the method title.
1 parent ed00d1c commit 6ea31eb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@
130130

131131
<%- unless method.skip_description? then -%>
132132
<div class="method-description">
133+
<%- if method.token_stream then -%>
134+
<div class="method-source-code" id="<%= method.html_name %>-source">
135+
<pre><%= method.markup_code %></pre>
136+
</div>
137+
<%- end -%>
133138
<%- if method.comment then -%>
134139
<%= method.description.strip %>
135140
<%- else -%>
@@ -144,12 +149,6 @@
144149
%>
145150
</div>
146151
<%- end -%>
147-
148-
<%- if method.token_stream then -%>
149-
<div class="method-source-code" id="<%= method.html_name %>-source">
150-
<pre><%= method.markup_code %></pre>
151-
</div>
152-
<%- end -%>
153152
</div>
154153
<%- end -%>
155154

0 commit comments

Comments
 (0)