Skip to content

Commit 633e589

Browse files
committed
Remove outdated go-to-top link feature
1 parent 5abb2e6 commit 633e589

File tree

7 files changed

+17
-32
lines changed

7 files changed

+17
-32
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<body id="top" role="document" class="<%= klass.type %> has-toc">
1+
<body role="document" class="<%= klass.type %> has-toc">
22
<%= render '_header.rhtml' %>
33
<%= render '_sidebar_toggle.rhtml' %>
44

@@ -43,9 +43,6 @@
4343
<h2>
4444
<%= section.title %>
4545
</h2>
46-
<span class="section-click-top">
47-
<a href="#top">&uarr; top</a>
48-
</span>
4946
</header>
5047
<%- end %>
5148

lib/rdoc/generator/template/aliki/index.rhtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<body id="top" role="document" class="file has-toc">
1+
<body role="document" class="file has-toc">
22
<%= render '_header.rhtml' %>
33
<%= render '_sidebar_toggle.rhtml' %>
44

lib/rdoc/generator/template/aliki/js/aliki.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ function generateToc() {
191191
const link = document.createElement('a');
192192
link.href = `#${heading.id}`;
193193
link.className = 'toc-link';
194-
link.textContent = heading.textContent.replace(/.*$/, '').trim(); // Remove pilcrow and "top" links
194+
link.textContent = heading.textContent.replace(/.*$/, '').trim(); // Remove pilcrow link
195195
link.setAttribute('data-target', heading.id);
196196

197197
li.appendChild(link);

lib/rdoc/generator/template/aliki/page.rhtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<body id="top" role="document" class="file has-toc">
1+
<body role="document" class="file has-toc">
22
<%= render '_header.rhtml' %>
33
<%= render '_sidebar_toggle.rhtml' %>
44

lib/rdoc/markup/to_html.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,7 @@ def accept_heading(heading)
314314
end
315315
@res << to_html(heading.text)
316316
unless @options.pipe then
317-
@res << "<span><a href=\"##{label}\">&para;</a>"
318-
@res << " <a href=\"#top\">&uarr;</a></span>"
317+
@res << "<span><a href=\"##{label}\">&para;</a></span>"
319318
end
320319
@res << "</h#{level}>\n"
321320
end

test/rdoc/generator/markup_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def test_cvs_url
3838
def test_description
3939
@comment = '= Hello'
4040

41-
links = '<span><a href="#label-Hello">&para;</a> ' +
42-
'<a href="#top">&uarr;</a></span>'
41+
links = '<span><a href="#label-Hello">&para;</a></span>'
4342

4443
assert_equal "\n<h1 id=\"label-Hello\">Hello#{links}</h1>\n", description
4544
end

test/rdoc/markup/to_html_test.rb

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,53 +24,46 @@ def accept_document
2424
end
2525

2626
def accept_heading
27-
links = '<span><a href="#label-Hello">&para;</a> ' +
28-
'<a href="#top">&uarr;</a></span>'
27+
links = '<span><a href="#label-Hello">&para;</a></span>'
2928
expected = "\n<h5 id=\"label-Hello\">Hello#{links}</h5>\n"
3029

3130
assert_equal expected, @to.res.join
3231
end
3332

3433
def accept_heading_1
35-
links = '<span><a href="#label-Hello">&para;</a> ' +
36-
'<a href="#top">&uarr;</a></span>'
34+
links = '<span><a href="#label-Hello">&para;</a></span>'
3735

3836
assert_equal "\n<h1 id=\"label-Hello\">Hello#{links}</h1>\n", @to.res.join
3937
end
4038

4139
def accept_heading_2
42-
links = '<span><a href="#label-Hello">&para;</a> ' +
43-
'<a href="#top">&uarr;</a></span>'
40+
links = '<span><a href="#label-Hello">&para;</a></span>'
4441

4542
assert_equal "\n<h2 id=\"label-Hello\">Hello#{links}</h2>\n", @to.res.join
4643
end
4744

4845
def accept_heading_3
49-
links = '<span><a href="#label-Hello">&para;</a> ' +
50-
'<a href="#top">&uarr;</a></span>'
46+
links = '<span><a href="#label-Hello">&para;</a></span>'
5147

5248
assert_equal "\n<h3 id=\"label-Hello\">Hello#{links}</h3>\n", @to.res.join
5349
end
5450

5551
def accept_heading_4
56-
links = '<span><a href="#label-Hello">&para;</a> ' +
57-
'<a href="#top">&uarr;</a></span>'
52+
links = '<span><a href="#label-Hello">&para;</a></span>'
5853

5954
assert_equal "\n<h4 id=\"label-Hello\">Hello#{links}</h4>\n", @to.res.join
6055
end
6156

6257
def accept_heading_b
63-
links = '<span><a href="#label-Hello">&para;</a> ' +
64-
'<a href="#top">&uarr;</a></span>'
58+
links = '<span><a href="#label-Hello">&para;</a></span>'
6559
inner = "<strong>Hello</strong>"
6660

6761
assert_equal "\n<h1 id=\"label-Hello\">#{inner}#{links}</h1>\n",
6862
@to.res.join
6963
end
7064

7165
def accept_heading_suppressed_crossref
72-
links = '<span><a href="#label-Hello">&para;</a> ' +
73-
'<a href="#top">&uarr;</a></span>'
66+
links = '<span><a href="#label-Hello">&para;</a></span>'
7467

7568
assert_equal "\n<h1 id=\"label-Hello\">Hello#{links}</h1>\n", @to.res.join
7669
end
@@ -348,8 +341,7 @@ def test_accept_heading_7
348341

349342
@to.accept_heading @RM::Heading.new(7, 'Hello')
350343

351-
links = '<span><a href="#label-Hello">&para;</a> ' +
352-
'<a href="#top">&uarr;</a></span>'
344+
links = '<span><a href="#label-Hello">&para;</a></span>'
353345

354346
assert_equal "\n<h6 id=\"label-Hello\">Hello#{links}</h6>\n", @to.res.join
355347
end
@@ -360,8 +352,7 @@ def test_accept_heading_aref_class
360352

361353
@to.accept_heading head(1, 'Hello')
362354

363-
links = '<span><a href="#class-Foo-label-Hello">&para;</a> ' +
364-
'<a href="#top">&uarr;</a></span>'
355+
links = '<span><a href="#class-Foo-label-Hello">&para;</a></span>'
365356

366357
assert_equal "\n<h1 id=\"class-Foo-label-Hello\">Hello#{links}</h1>\n",
367358
@to.res.join
@@ -373,8 +364,7 @@ def test_accept_heading_aref_method
373364

374365
@to.accept_heading @RM::Heading.new(1, 'Hello')
375366

376-
links = '<span><a href="#method-i-foo-label-Hello">&para;</a> ' +
377-
'<a href="#top">&uarr;</a></span>'
367+
links = '<span><a href="#method-i-foo-label-Hello">&para;</a></span>'
378368

379369
assert_equal "\n<h1 id=\"method-i-foo-label-Hello\">Hello#{links}</h1>\n",
380370
@to.res.join
@@ -437,7 +427,7 @@ def test_accept_heading_output_decoration
437427

438428
@to.accept_heading @RM::Heading.new(1, 'Hello')
439429

440-
assert_equal "\n<h1>Hello<span><a href=\"#label-Hello\">&para;</a> <a href=\"#top\">&uarr;</a></span></h1>\n", @to.res.join
430+
assert_equal "\n<h1>Hello<span><a href=\"#label-Hello\">&para;</a></span></h1>\n", @to.res.join
441431
end
442432

443433
def test_accept_heading_output_decoration_with_pipe

0 commit comments

Comments
 (0)