-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fb0e50
commit a7331c8
Showing
3 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 38 additions & 7 deletions
45
lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,42 @@ | ||
<%- if klass.type == 'class' then %> | ||
<%- if klass.type == 'class' && (ancestors = klass.super_classes).any? then %> | ||
<div id="parent-class-section" class="nav-section"> | ||
<h3>Parent</h3> | ||
<h3>Ancestors</h3> | ||
<% if ancestors.size > 1 %> | ||
<% parent = ancestors.shift %> | ||
<ul> | ||
<li> | ||
<details> | ||
<summary> | ||
<% if parent.is_a?(RDoc::NormalClass) %> | ||
<a href="<%= klass.aref_to parent.path -%>"><%= parent.full_name -%></a> | ||
<% else %> | ||
<%= parent -%> | ||
<% end %> | ||
</summary> | ||
|
||
<%- if klass.superclass and not String === klass.superclass then -%> | ||
<p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a> | ||
<%- else -%> | ||
<p class="link"><%= klass.superclass %> | ||
<%- end -%> | ||
<% for ancestor in ancestors %> | ||
<ul> | ||
<li> | ||
<% if ancestor.is_a?(RDoc::NormalClass) %> | ||
<a href="<%= klass.aref_to ancestor.path -%>"><%= ancestor.full_name -%></a> | ||
<% else %> | ||
<%= ancestor -%> | ||
<% end %> | ||
<% end %> | ||
<% for ancestor in ancestors # Sorry, templates cannot be recursive %> | ||
</li> | ||
</ul> | ||
<% end %> | ||
</details> | ||
</li> | ||
</ul> | ||
<% else %> | ||
<%- if klass.superclass and not String === klass.superclass then -%> | ||
<p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a> | ||
<%- else -%> | ||
<p class="link"><%= klass.superclass %> | ||
<%- end -%> | ||
<% end %> | ||
</div> | ||
<%- end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters