Skip to content

Commit 7966543

Browse files
authored
Fix method source code not created if a method's description is skipped (#1488)
This PR resolves #1335.
1 parent 1ac9898 commit 7966543

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,13 @@
156156
<summary>Source</summary>
157157
</details>
158158
</div>
159+
<div class="method-source-code" id="<%= method.html_name %>-source">
160+
<pre class="<%= method.source_language %>" data-language="<%= method.source_language %>"><%= method.markup_code %></pre>
161+
</div>
159162
<%- end %>
160163

161164
<%- unless method.skip_description? then %>
162165
<div class="method-description">
163-
<%- if method.token_stream then %>
164-
<div class="method-source-code" id="<%= method.html_name %>-source">
165-
<pre class="<%= method.source_language %>" data-language="<%= method.source_language %>"><%= method.markup_code %></pre>
166-
</div>
167-
<%- end %>
168166
<%- if method.mixin_from then %>
169167
<div class="mixin-from">
170168
<%= method.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(method.mixin_from.path) %>"><%= method.mixin_from.full_name %></a>

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,13 @@
163163
<summary>Source</summary>
164164
</details>
165165
</div>
166+
<div class="method-source-code" id="<%= method.html_name %>-source">
167+
<pre><%= method.markup_code %></pre>
168+
</div>
166169
<%- end %>
167170

168171
<%- unless method.skip_description? then %>
169172
<div class="method-description">
170-
<%- if method.token_stream then %>
171-
<div class="method-source-code" id="<%= method.html_name %>-source">
172-
<pre><%= method.markup_code %></pre>
173-
</div>
174-
<%- end %>
175173
<%- if method.mixin_from then %>
176174
<div class="mixin-from">
177175
<%= method.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(method.mixin_from.path) %>"><%= method.mixin_from.full_name %></a>

0 commit comments

Comments
 (0)