Skip to content

Commit 4ccc93e

Browse files
unasukest0012
authored andcommitted
Show breadcrumb on top of a class document
1 parent e03a3ea commit 4ccc93e

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@
1717
<%= render '_footer.rhtml' %>
1818
</nav>
1919

20+
<nav role="navigation" aria-label="breadcrumb" class="breadcrumb">
21+
<ol>
22+
<% breadcrumb.each do |namespace| %>
23+
<li>
24+
<% if namespace[:self] %>
25+
<span><%= namespace[:name] %></span>
26+
<% else %>
27+
<a href="<%= namespace[:path] %>"><%= namespace[:name] %></a><span>::</span>
28+
<% end %>
29+
</li>
30+
<% end %>
31+
</ol>
32+
</nav>
33+
2034
<main role="main" aria-labelledby="<%=h klass.aref %>">
2135
<h1 id="<%=h klass.aref %>" class="anchor-link <%= klass.type %>">
2236
<%= klass.type %> <%= klass.full_name %>

lib/rdoc/generator/template/darkfish/css/rdoc.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,28 @@ nav h3,
199199
font-size: 1em;
200200
}
201201

202+
nav.breadcrumb {
203+
display: block;
204+
float: unset;
205+
width: unset;
206+
height: unset;
207+
border: none;
208+
position: unset;
209+
top: unset;
210+
padding-top: 10px;
211+
padding-left: 20px;
212+
margin-bottom: 1em;
213+
}
214+
215+
nav.breadcrumb ol {
216+
display: inline-block;
217+
}
218+
219+
nav.breadcrumb li {
220+
display: inline-block;
221+
font-size: 125%;
222+
}
223+
202224
nav ul,
203225
nav dl,
204226
nav p {

0 commit comments

Comments
 (0)