Skip to content

Commit cabeca2

Browse files
committed
Remove unnecessary class page sidebar partial extraction
1 parent 3e92cb7 commit cabeca2

File tree

6 files changed

+73
-73
lines changed

6 files changed

+73
-73
lines changed

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

Lines changed: 0 additions & 15 deletions
This file was deleted.

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

Lines changed: 0 additions & 15 deletions
This file was deleted.

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

Lines changed: 0 additions & 21 deletions
This file was deleted.

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

Lines changed: 0 additions & 6 deletions
This file was deleted.

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

Lines changed: 0 additions & 11 deletions
This file was deleted.

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

Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,79 @@
88
</div>
99

1010
<%= render '_sidebar_table_of_contents.rhtml' %>
11-
<%= render '_sidebar_sections.rhtml' %>
12-
<%= render '_sidebar_parent.rhtml' %>
13-
<%= render '_sidebar_includes.rhtml' %>
14-
<%= render '_sidebar_extends.rhtml' %>
15-
<%= render '_sidebar_methods.rhtml' %>
11+
12+
<%- unless klass.sections.length == 1 then %>
13+
<div id="sections-section" class="nav-section">
14+
<h3>Sections</h3>
15+
16+
<ul class="link-list" role="directory">
17+
<%- klass.sort_sections.each do |section| -%>
18+
<li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
19+
<%- end -%>
20+
</ul>
21+
</div>
22+
<%- end -%>
23+
24+
<%- if klass.type == 'class' && (ancestors = klass.super_classes).any? -%>
25+
<div id="parent-class-section" class="nav-section">
26+
<h3>Ancestors</h3>
27+
<%= generate_ancestor_list(ancestors, klass) %>
28+
</div>
29+
<%- end -%>
30+
31+
<%- unless klass.includes.empty? then %>
32+
<div id="includes-section" class="nav-section">
33+
<h3>Included Modules</h3>
34+
35+
<ul class="link-list">
36+
<%- klass.each_include do |inc| -%>
37+
<%- unless String === inc.module then -%>
38+
<li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
39+
<%- else -%>
40+
<li><span class="include"><%= inc.name %></span>
41+
<%- end -%>
42+
<%- end -%>
43+
</ul>
44+
</div>
45+
<%- end -%>
46+
47+
<%- unless klass.extends.empty? then %>
48+
<div id="extends-section" class="nav-section">
49+
<h3>Extended With Modules</h3>
50+
51+
<ul class="link-list">
52+
<%- klass.each_extend do |ext| -%>
53+
<%- unless String === ext.module then -%>
54+
<li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
55+
<%- else -%>
56+
<li><span class="extend"><%= ext.name %></span>
57+
<%- end -%>
58+
<%- end -%>
59+
</ul>
60+
</div>
61+
<%- end -%>
62+
63+
<% if (class_methods = klass.class_method_list.sort).any? %>
64+
<div class="nav-section">
65+
<h3>Class Methods</h3>
66+
<ul class="link-list" role="directory">
67+
<%- class_methods.each do |meth| -%>
68+
<li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= h meth.name -%></a></li>
69+
<%- end -%>
70+
</ul>
71+
</div>
72+
<% end %>
73+
74+
<% if (instance_methods = klass.instance_methods.sort).any? %>
75+
<div class="nav-section">
76+
<h3>Instance Methods</h3>
77+
<ul class="link-list" role="directory">
78+
<%- instance_methods.each do |meth| -%>
79+
<li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= h meth.name -%></a></li>
80+
<%- end -%>
81+
</ul>
82+
</div>
83+
<% end %>
1684

1785
<%= render '_footer.rhtml' %>
1886
</nav>

0 commit comments

Comments
 (0)