summaryrefslogtreecommitdiff
path: root/lib/rdoc/generator
diff options
context:
space:
mode:
authorAlexis Bernard <[email protected]>2024-11-13 17:13:15 +0100
committergit <[email protected]>2024-11-13 16:13:21 +0000
commit202a377d215483fa6e4c52b210574720096d1593 (patch)
treec93e83d58ee9b8005fb0800abdcc6d4df0cbf95a /lib/rdoc/generator
parent6deeec5d459ecff5ec4628523b14ac7379fd942e (diff)
[ruby/rdoc] Split list of class and instance methods in two
(https://github.com/ruby/rdoc/pull/1206) Looking for a method is easier because eyes don't have to skip dashes or double colon. https://github.com/ruby/rdoc/commit/6852567640
Diffstat (limited to 'lib/rdoc/generator')
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml31
1 files changed, 20 insertions, 11 deletions
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml
index 5b4c295bed..d09216a0f6 100644
--- a/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml
@@ -1,12 +1,21 @@
-<%- unless klass.method_list.empty? then %>
-<!-- Method Quickref -->
-<div id="method-list-section" class="nav-section">
- <h3>Methods</h3>
+<% if (class_methods = klass.class_method_list.sort).any? %>
+ <div class="nav-section">
+ <h3>Class Methods</h3>
+ <ul class="link-list" role="directory">
+ <%- class_methods.each do |meth| -%>
+ <li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= h meth.name -%></a></li>
+ <%- end -%>
+ </ul>
+ </div>
+<% end %>
- <ul class="link-list" role="directory">
- <%- klass.each_method do |meth| -%>
- <li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name -%></a>
- <%- end -%>
- </ul>
-</div>
-<%- end -%>
+<% if (instance_methods = klass.instance_methods.sort).any? %>
+ <div class="nav-section">
+ <h3>Instance Methods</h3>
+ <ul class="link-list" role="directory">
+ <%- instance_methods.each do |meth| -%>
+ <li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= h meth.name -%></a></li>
+ <%- end -%>
+ </ul>
+ </div>
+<% end %>