Skip to content

Commit

Permalink
Update darkfish theme, delete rorvswild theme folder
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinem committed Oct 7, 2024
1 parent 277967b commit 2e4f920
Show file tree
Hide file tree
Showing 61 changed files with 956 additions and 2,736 deletions.
9 changes: 4 additions & 5 deletions lib/rdoc/generator/template/darkfish/_footer.rhtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> <%= RDoc::VERSION %>.
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>
<footer role="contentinfo">
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> <%= RDoc::VERSION %>. <a href="https://validator.w3.org/check/referer">Validate</a>.
<p><a href="http://rorvswild.com/theme">RoRvsWild theme</a> based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a>.
</footer>
33 changes: 24 additions & 9 deletions lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="classindex-section" class="nav-section">
<div class="nav-section">
<h3>Class and Module Index</h3>

<%-
Expand All @@ -9,22 +9,37 @@
end
link = proc do |index_klass, display = index_klass.display?|
if display
-%><code><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.name %></a></code><%-
-%><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.name %></a><%-
else
-%><code><%= index_klass.name %></code><%-
-%><%= index_klass.name %><%-
end
end

def has_active_descendant?(klass, current, all_classes)
return false unless defined?(current)
return true if klass == current
children = all_classes[klass.full_name]
return false unless children
children.any? { |child| has_active_descendant?(child, current, all_classes) }
end

if top = all_classes[nil]
solo = top.one? {|klass| klass.display?}
traverse = proc do |klasses| -%>
<ul class="link-list">
traverse = proc do |klasses|
has_active_descendant = false
-%>
<ul class="link-list" id="class-and-module-index">
<%- klasses.each do |index_klass| -%>
<%- if children = all_classes[index_klass.full_name] -%>
<li><details<% if solo; solo = false %> open<% end %>><summary><% link.call(index_klass) %></summary>
<%- traverse.call(children) -%>
</ul></details>
<li class="<%= "active" if defined?(current) && (index_klass == current) %>">
<details<% if solo || (defined?(current) && has_active_descendant?(index_klass, current, all_classes)); solo = false %> open<% end %>>
<summary><% link.call(index_klass) %></summary>
<%- traverse.call(children) -%>
</ul>
</details>
<%- elsif index_klass.display? -%>
<li><% link.call(index_klass, true) %>
<li class="<%= "active" if defined?(current) && (index_klass == current) %>">
<% link.call(index_klass, true) %>
<%- end -%>
<%- end -%>
<%- end -%>
Expand Down
24 changes: 12 additions & 12 deletions lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<%- unless klass.extends.empty? then %>
<div id="extends-section" class="nav-section">
<h3>Extended With Modules</h3>
<div class="nav-section">
<h3>Extended With Modules</h3>

<ul class="link-list">
<%- klass.each_extend do |ext| -%>
<%- unless String === ext.module then -%>
<li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
<%- else -%>
<li><span class="extend"><%= ext.name %></span>
<%- end -%>
<%- end -%>
</ul>
</div>
<ul class="link-list">
<%- klass.each_extend do |ext| -%>
<%- unless String === ext.module then -%>
<li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
<%- else -%>
<li><span class="extend"><%= ext.name %></span>
<%- end -%>
<%- end -%>
</ul>
</div>
<%- end -%>
7 changes: 3 additions & 4 deletions lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<div id="file-list-section" class="nav-section">
<h3>Defined In</h3>

<ul>
<%- klass.in_files.each do |tl| -%>
<li><%= h tl.relative_name %>
<%- end -%>
<%- klass.in_files.each do |tl| -%>
<li><%= h tl.relative_name %>
<%- end -%>
</ul>
</div>
24 changes: 12 additions & 12 deletions lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<%- unless klass.includes.empty? then %>
<div id="includes-section" class="nav-section">
<h3>Included Modules</h3>
<div class="nav-section">
<h3>Included Modules</h3>

<ul class="link-list">
<%- klass.each_include do |inc| -%>
<%- unless String === inc.module then -%>
<li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
<%- else -%>
<li><span class="include"><%= inc.name %></span>
<%- end -%>
<%- end -%>
</ul>
</div>
<ul class="link-list">
<%- klass.each_include do |inc| -%>
<%- unless String === inc.module then -%>
<li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
<%- else -%>
<li><span class="include"><%= inc.name %></span>
<%- end -%>
<%- end -%>
</ul>
</div>
<%- end -%>
31 changes: 20 additions & 11 deletions lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml
Original file line number Diff line number Diff line change
@@ -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 %>
11 changes: 0 additions & 11 deletions lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml

This file was deleted.

10 changes: 6 additions & 4 deletions lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<%- simple_files = @files.select { |f| f.text? } %>
<%- if defined?(current) -%>

<%- if defined?(current) && current.respond_to?(:page_name) -%>
<%- dir = current.full_name[%r{\A[^/]+(?=/)}] || current.page_name -%>
<%- end -%>

<%- unless simple_files.empty? then -%>
<div id="fileindex-section" class="nav-section">
<div class="nav-section">
<h3>Pages</h3>

<ul class="link-list">
Expand All @@ -12,7 +14,7 @@
<%- end.each do |n, files| -%>
<%- f = files.shift -%>
<%- if files.empty? -%>
<li><a href="<%= rel_prefix %>/<%= h f.path %>"><%= h f.page_name %></a>
<li class="<%= 'active' if defined?(dir) && (dir == f.page_name) %>"><a href="<%= rel_prefix %>/<%= h f.path %>"><%= h f.page_name %></a>
<%- next -%>
<%- end -%>
<li><details<% if dir == n %> open<% end %>><summary><%
Expand All @@ -23,7 +25,7 @@
end %></summary>
<ul class="link-list">
<%- files.each do |f| -%>
<li><a href="<%= rel_prefix %>/<%= h f.path %>"><%= h f.page_name %></a>
<li class="<%= 'active' if defined?(dir) && (dir == f.page_name) %>"><a href="<%= rel_prefix %>/<%= h f.path %>"><%= h f.page_name %></a>
<%- end -%>
</ul></details>
<%- end -%>
Expand Down
48 changes: 39 additions & 9 deletions lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,41 @@
<%- if klass.type == 'class' then %>
<div id="parent-class-section" class="nav-section">
<h3>Parent</h3>
<%- if klass.type == 'class' && (ancestors = klass.super_classes).any? then -%>
<div class="nav-section">
<h3>Ancestors</h3>
<ul class="link-list" role="directory">
<%- ancestors.each_with_index do |ancestor, index| -%>
<%- if ancestor.is_a?(String) -%>
<li>
<%- if index == 0 && ancestors.size > 1 -%>
<details>
<summary><%= ancestor -%></summary>
<ul class="link-list" role="directory">
<%- else -%>
<span><%= ancestor -%></span>
<ul class="link-list" role="directory">
<%- end -%>
<%- elsif ancestor.is_a?(RDoc::NormalClass) -%>
<li>
<%- if index == 0 && ancestors.size > 1 -%>
<details>
<summary><a href="<%= klass.aref_to ancestor.path -%>"><%= ancestor.full_name -%></a></summary>
<ul class="link-list" role="directory">
<%- else -%>
<a href="<%= klass.aref_to ancestor.path -%>"><%= ancestor.full_name -%></a>
<ul class="link-list" role="directory">
<%- end -%>
<%- end -%>
<%- end -%>

<%- 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 -%>
</div>
<%- ancestors.each_with_index do |ancestor, index| -%>
<%- if index == 0 && ancestors.size > 1 -%>
</ul>
</details>
</li>
<%- else -%>
</ul>
</li>
<%- end -%>
<%- end -%>
</ul>
</div>
<%- end -%>
14 changes: 0 additions & 14 deletions lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml

This file was deleted.

16 changes: 8 additions & 8 deletions lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<%- unless klass.sections.length == 1 then %>
<div id="sections-section" class="nav-section">
<h3>Sections</h3>
<div class="nav-section">
<h3>Sections</h3>

<ul class="link-list" role="directory">
<%- klass.sort_sections.each do |section| -%>
<li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
<%- end -%>
</ul>
</div>
<ul class="link-list" role="directory">
<%- klass.sort_sections.each do |section| -%>
<li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
<%- end -%>
</ul>
</div>
<%- end -%>
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<%- comment = if current.respond_to? :comment_location then
<%-
comment = if current.respond_to? :comment_location then
current.comment_location
else
current.comment
end
table = current.parse(comment).table_of_contents.dup

if table.length > 1 then %>
<div class="nav-section">
<h3>Table of Contents</h3>
<div class="nav-section">
<h3>On this page</h3>

<%- display_link = proc do |heading| -%>
<a href="#<%= heading.label current %>"><%= heading.plain_html %></a>
Expand All @@ -31,9 +32,9 @@
<%- end -%>
<%- end -%>
<%- end -%>

<ul class="link-list" role="directory">
<% list_siblings.call %>
</ul>
</div>
<ul class="link-list" role="directory">
<% list_siblings.call %>
</ul>
</div>
<%- end -%>
Loading

0 comments on commit 2e4f920

Please sign in to comment.