Skip to content

Commit 99f7210

Browse files
committed
Add jump-to-top link
1 parent 897119b commit 99f7210

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript" charset="utf-8"></script>
1616

1717
</head>
18-
<body class="<%= klass.type %>">
18+
<body id="top" class="<%= klass.type %>">
1919

2020
<div id="metadata">
2121
<div id="home-metadata">
@@ -176,9 +176,12 @@
176176
</div><!-- description -->
177177

178178
<% klass.each_section do |section, constants, attributes| %>
179-
<div id="<%= section.aref %>">
179+
<div id="<%= section.aref %>" class="documentation-section">
180180
<% if section.title then %>
181-
<h2 class="section-header"><%= section.title %></h2>
181+
<h2 class="section-header">
182+
<%= section.title %>
183+
<a href="#top">&uarr; top</a>
184+
</h2>
182185
<% end %>
183186

184187
<% if section.comment then %>

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,23 @@ ul.link-list .type {
371371
color: #666;
372372
}
373373

374+
.documentation-section h2 {
375+
position: relative;
376+
}
377+
378+
.documentation-section h2 a {
379+
position: absolute;
380+
top: 8px;
381+
right: 10px;
382+
font-size: 12px;
383+
color: #9b9877;
384+
visibility: hidden;
385+
}
386+
387+
.documentation-section h2:hover a {
388+
visibility: visible;
389+
}
390+
374391
/* @group Method Details */
375392

376393
#documentation .method-source-code {

0 commit comments

Comments
 (0)