Skip to content

Commit

Permalink
left navigation partial
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinem committed Sep 11, 2024
1 parent 189da82 commit 2b2ae20
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 247 deletions.
8 changes: 8 additions & 0 deletions lib/rdoc/generator/template/rorvswild/_navigation.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<nav id="navigation" role="navigation">
<div id="project-navigation">
<%= render '_sidebar_search.rhtml' %>
</div>
<%= render '_sidebar_classes.rhtml' %>
<%= render '_sidebar_pages.rhtml' %>
<%= render '_footer.rhtml' %>
</nav>
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<%-
unless defined?(current)
return
end

<%-
comment = if current.respond_to? :comment_location then
current.comment_location
else
Expand All @@ -14,29 +10,29 @@
<div class="nav-section">
<h3>On this page</h3>

<%- display_link = proc do |heading| -%>
<a href="#<%= heading.label current %>"><%= heading.plain_html %></a>
<%- end -%>
<%- display_link = proc do |heading| -%>
<a href="#<%= heading.label current %>"><%= heading.plain_html %></a>
<%- end -%>
<%- list_siblings = proc do -%>
<%- level = table.first&.level -%>
<%- while table.first && table.first.level >= level -%>
<%- heading = table.shift -%>
<%- if table.first.nil? || table.first.level <= heading.level -%>
<li><% display_link.call heading -%>
<%- else -%>
<li>
<details open>
<summary><%- display_link.call heading -%></summary>
<ul class="link-list" role="directory">
<% list_siblings.call %>
</ul>
</details>
</li>
<%- end -%>
<%- list_siblings = proc do -%>
<%- level = table.first&.level -%>
<%- while table.first && table.first.level >= level -%>
<%- heading = table.shift -%>
<%- if table.first.nil? || table.first.level <= heading.level -%>
<li><% display_link.call heading -%>
<%- else -%>
<li>
<details open>
<summary><%- display_link.call heading -%></summary>
<ul class="link-list" role="directory">
<% list_siblings.call %>
</ul>
</details>
</li>
<%- end -%>
<%- end -%>

<%- end -%>

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

0 comments on commit 2b2ae20

Please sign in to comment.