[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
This commit is contained in:
Alexis Bernard 2024-11-13 17:13:15 +01:00 committed by git
parent 6deeec5d45
commit 202a377d21

View File

@ -1,12 +1,21 @@
<%- unless klass.method_list.empty? then %> <% if (class_methods = klass.class_method_list.sort).any? %>
<!-- Method Quickref --> <div class="nav-section">
<div id="method-list-section" class="nav-section"> <h3>Class Methods</h3>
<h3>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"> <% if (instance_methods = klass.instance_methods.sort).any? %>
<%- klass.each_method do |meth| -%> <div class="nav-section">
<li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name -%></a> <h3>Instance Methods</h3>
<%- end -%> <ul class="link-list" role="directory">
</ul> <%- instance_methods.each do |meth| -%>
</div> <li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= h meth.name -%></a></li>
<%- end -%> <%- end -%>
</ul>
</div>
<% end %>