rdoc 7.1.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +3 -4
  3. data/LICENSE.rdoc +4 -0
  4. data/README.md +43 -2
  5. data/doc/markup_reference/markdown.md +104 -3
  6. data/lib/rdoc/code_object/alias.rb +2 -8
  7. data/lib/rdoc/code_object/any_method.rb +11 -6
  8. data/lib/rdoc/code_object/attr.rb +12 -6
  9. data/lib/rdoc/code_object/class_module.rb +62 -32
  10. data/lib/rdoc/code_object/constant.rb +29 -3
  11. data/lib/rdoc/code_object/context/section.rb +30 -43
  12. data/lib/rdoc/code_object/context.rb +53 -37
  13. data/lib/rdoc/code_object/method_attr.rb +9 -15
  14. data/lib/rdoc/code_object/mixin.rb +3 -0
  15. data/lib/rdoc/code_object/top_level.rb +11 -3
  16. data/lib/rdoc/code_object.rb +2 -4
  17. data/lib/rdoc/comment.rb +1 -66
  18. data/lib/rdoc/cross_reference.rb +8 -30
  19. data/lib/rdoc/encoding.rb +3 -3
  20. data/lib/rdoc/generator/aliki.rb +17 -0
  21. data/lib/rdoc/generator/darkfish.rb +12 -6
  22. data/lib/rdoc/generator/json_index.rb +2 -2
  23. data/lib/rdoc/generator/markup.rb +56 -31
  24. data/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
  25. data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +1 -1
  26. data/lib/rdoc/generator/template/aliki/_head.rhtml +6 -1
  27. data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +8 -6
  28. data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +8 -6
  29. data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +1 -1
  30. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +2 -2
  31. data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +1 -1
  32. data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +1 -1
  33. data/lib/rdoc/generator/template/aliki/class.rhtml +61 -51
  34. data/lib/rdoc/generator/template/aliki/css/rdoc.css +365 -147
  35. data/lib/rdoc/generator/template/aliki/index.rhtml +1 -1
  36. data/lib/rdoc/generator/template/aliki/js/aliki.js +28 -20
  37. data/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
  38. data/lib/rdoc/generator/template/aliki/js/search_controller.js +1 -1
  39. data/lib/rdoc/generator/template/aliki/page.rhtml +1 -1
  40. data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +1 -1
  41. data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +2 -2
  42. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +8 -6
  43. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +8 -6
  44. data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +1 -1
  45. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +1 -1
  46. data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +1 -1
  47. data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +5 -5
  48. data/lib/rdoc/generator/template/darkfish/class.rhtml +18 -21
  49. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +0 -1
  50. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +3 -3
  51. data/lib/rdoc/i18n/text.rb +3 -3
  52. data/lib/rdoc/markdown.kpeg +36 -17
  53. data/lib/rdoc/markdown.rb +324 -125
  54. data/lib/rdoc/markup/document.rb +2 -2
  55. data/lib/rdoc/markup/formatter.rb +128 -115
  56. data/lib/rdoc/markup/heading.rb +3 -6
  57. data/lib/rdoc/markup/indented_paragraph.rb +1 -1
  58. data/lib/rdoc/markup/inline_parser.rb +312 -0
  59. data/lib/rdoc/markup/list.rb +2 -2
  60. data/lib/rdoc/markup/list_item.rb +2 -2
  61. data/lib/rdoc/markup/parser.rb +1 -1
  62. data/lib/rdoc/markup/pre_process.rb +0 -25
  63. data/lib/rdoc/markup/to_ansi.rb +52 -5
  64. data/lib/rdoc/markup/to_bs.rb +23 -43
  65. data/lib/rdoc/markup/to_html.rb +279 -226
  66. data/lib/rdoc/markup/to_html_crossref.rb +122 -136
  67. data/lib/rdoc/markup/to_html_snippet.rb +65 -65
  68. data/lib/rdoc/markup/to_joined_paragraph.rb +0 -5
  69. data/lib/rdoc/markup/to_label.rb +22 -23
  70. data/lib/rdoc/markup/to_markdown.rb +62 -38
  71. data/lib/rdoc/markup/to_rdoc.rb +88 -28
  72. data/lib/rdoc/markup/to_table_of_contents.rb +1 -1
  73. data/lib/rdoc/markup/to_test.rb +9 -1
  74. data/lib/rdoc/markup/to_tt_only.rb +10 -23
  75. data/lib/rdoc/markup/verbatim.rb +1 -1
  76. data/lib/rdoc/markup.rb +8 -30
  77. data/lib/rdoc/options.rb +36 -51
  78. data/lib/rdoc/parser/c.rb +7 -6
  79. data/lib/rdoc/parser/changelog.rb +21 -0
  80. data/lib/rdoc/parser/rbs.rb +275 -0
  81. data/lib/rdoc/parser/ruby.rb +955 -2067
  82. data/lib/rdoc/parser/ruby_colorizer.rb +253 -0
  83. data/lib/rdoc/parser.rb +3 -2
  84. data/lib/rdoc/rbs_helper.rb +186 -0
  85. data/lib/rdoc/rdoc.rb +196 -24
  86. data/lib/rdoc/ri/driver.rb +8 -2
  87. data/lib/rdoc/ri/paths.rb +1 -1
  88. data/lib/rdoc/{servlet.rb → ri/servlet.rb} +5 -5
  89. data/lib/rdoc/ri.rb +4 -3
  90. data/lib/rdoc/rubygems_hook.rb +11 -11
  91. data/lib/rdoc/server.rb +460 -0
  92. data/lib/rdoc/stats.rb +147 -124
  93. data/lib/rdoc/store.rb +212 -4
  94. data/lib/rdoc/task.rb +16 -15
  95. data/lib/rdoc/text.rb +24 -117
  96. data/lib/rdoc/token_stream.rb +11 -33
  97. data/lib/rdoc/version.rb +1 -1
  98. data/lib/rdoc.rb +35 -7
  99. data/lib/rubygems_plugin.rb +2 -11
  100. data/rdoc-logo.svg +43 -0
  101. data/rdoc.gemspec +6 -4
  102. metadata +37 -23
  103. data/lib/rdoc/code_object/anon_class.rb +0 -10
  104. data/lib/rdoc/code_object/ghost_method.rb +0 -6
  105. data/lib/rdoc/code_object/meta_method.rb +0 -6
  106. data/lib/rdoc/markup/attr_changer.rb +0 -22
  107. data/lib/rdoc/markup/attr_span.rb +0 -35
  108. data/lib/rdoc/markup/attribute_manager.rb +0 -432
  109. data/lib/rdoc/markup/attributes.rb +0 -70
  110. data/lib/rdoc/markup/regexp_handling.rb +0 -40
  111. data/lib/rdoc/parser/prism_ruby.rb +0 -1100
  112. data/lib/rdoc/parser/ripper_state_lex.rb +0 -302
  113. data/lib/rdoc/parser/ruby_tools.rb +0 -163
@@ -3,7 +3,7 @@
3
3
  <%= render '_header.rhtml' %>
4
4
  <%= render '_sidebar_toggle.rhtml' %>
5
5
 
6
- <nav id="navigation" role="navigation" hidden>
6
+ <nav id="sidebar-navigation" role="navigation" hidden>
7
7
  <%= render '_sidebar_pages.rhtml' %>
8
8
  <%= render '_sidebar_classes.rhtml' %>
9
9
  </nav>
@@ -70,8 +70,6 @@ function createSearchInstance(input, result) {
70
70
  window.location.href = result.firstChild.firstChild.href;
71
71
  }
72
72
 
73
- search.scrollIntoView = search.scrollInWindow;
74
-
75
73
  return search;
76
74
  }
77
75
 
@@ -96,6 +94,14 @@ function hookSearch() {
96
94
  }
97
95
  });
98
96
 
97
+ // Hide search results on Escape key on desktop too
98
+ document.addEventListener('keydown', (e) => {
99
+ if (e.key === 'Escape' && input.matches(":focus")) {
100
+ search.hide();
101
+ input.blur();
102
+ }
103
+ });
104
+
99
105
  // Show search results when focusing on input (if there's a query)
100
106
  input.addEventListener('focus', () => {
101
107
  if (input.value.trim()) {
@@ -131,32 +137,32 @@ function hookFocus() {
131
137
  /* ===== Mobile Navigation ===== */
132
138
 
133
139
  function hookSidebar() {
134
- const navigation = document.querySelector('#navigation');
135
- const navigationToggle = document.querySelector('#navigation-toggle');
140
+ const sidebarNavigation = document.querySelector('#sidebar-navigation');
141
+ const sidebarNavigationToggle = document.querySelector('#sidebar-navigation-toggle');
136
142
 
137
- if (!navigation || !navigationToggle) return;
143
+ if (!sidebarNavigation || !sidebarNavigationToggle) return;
138
144
 
139
145
  const closeNav = () => {
140
- navigation.hidden = true;
141
- navigationToggle.ariaExpanded = 'false';
142
- document.body.classList.remove('nav-open');
146
+ sidebarNavigation.hidden = true;
147
+ sidebarNavigationToggle.ariaExpanded = 'false';
148
+ document.body.classList.remove('sidebar-navigation-open');
143
149
  };
144
150
 
145
151
  const openNav = () => {
146
- navigation.hidden = false;
147
- navigationToggle.ariaExpanded = 'true';
148
- document.body.classList.add('nav-open');
152
+ sidebarNavigation.hidden = false;
153
+ sidebarNavigationToggle.ariaExpanded = 'true';
154
+ document.body.classList.add('sidebar-navigation-open');
149
155
  };
150
156
 
151
157
  const toggleNav = () => {
152
- if (navigation.hidden) {
158
+ if (sidebarNavigation.hidden) {
153
159
  openNav();
154
160
  } else {
155
161
  closeNav();
156
162
  }
157
163
  };
158
164
 
159
- navigationToggle.addEventListener('click', (e) => {
165
+ sidebarNavigationToggle.addEventListener('click', (e) => {
160
166
  e.stopPropagation();
161
167
  toggleNav();
162
168
  });
@@ -168,18 +174,20 @@ function hookSidebar() {
168
174
  // This is better than the opposite approach of hiding it with JavaScript
169
175
  // because it avoids flickering the sidebar when the page is loaded, especially on mobile devices
170
176
  if (isSmallViewport) {
177
+ closeNav();
178
+
171
179
  // Close nav when clicking links inside it
172
180
  document.addEventListener('click', (e) => {
173
- if (e.target.closest('#navigation a')) {
181
+ if (e.target.closest('#sidebar-navigation a')) {
174
182
  closeNav();
175
183
  }
176
184
  });
177
185
 
178
186
  // Close nav when clicking backdrop
179
187
  document.addEventListener('click', (e) => {
180
- if (!navigation.hidden &&
181
- !e.target.closest('#navigation') &&
182
- !e.target.closest('#navigation-toggle')) {
188
+ if (!sidebarNavigation.hidden &&
189
+ !e.target.closest('#sidebar-navigation') &&
190
+ !e.target.closest('#sidebar-navigation-toggle')) {
183
191
  closeNav();
184
192
  }
185
193
  });
@@ -227,7 +235,7 @@ function generateToc() {
227
235
  tocNav.appendChild(tocList);
228
236
  } else {
229
237
  // Hide TOC if no headings found
230
- const tocContainer = document.querySelector('.table-of-contents');
238
+ const tocContainer = document.querySelector('#table-of-contents');
231
239
  if (tocContainer) {
232
240
  tocContainer.style.display = 'none';
233
241
  }
@@ -429,8 +437,8 @@ function wrapCodeBlocksWithCopyButton() {
429
437
  // not directly in rhtml templates
430
438
  // - Modifying the formatter would require extending RDoc's core internals
431
439
 
432
- // Find all pre elements that are not already wrapped
433
- const preElements = document.querySelectorAll('main pre:not(.code-block-wrapper pre)');
440
+ // Target code examples and source code; skip type signature blocks
441
+ const preElements = document.querySelectorAll('main pre:not(.method-type-signature)');
434
442
 
435
443
  preElements.forEach((pre) => {
436
444
  // Skip if already wrapped
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Client-side shell syntax highlighter for RDoc
3
+ * Highlights: $ prompts, commands, options, strings, env vars, comments
4
+ */
5
+
6
+ (function() {
7
+ 'use strict';
8
+
9
+ function escapeHtml(text) {
10
+ return text
11
+ .replace(/&/g, '&amp;')
12
+ .replace(/</g, '&lt;')
13
+ .replace(/>/g, '&gt;')
14
+ .replace(/"/g, '&quot;')
15
+ .replace(/'/g, '&#39;');
16
+ }
17
+
18
+ function wrap(className, text) {
19
+ return '<span class="' + className + '">' + escapeHtml(text) + '</span>';
20
+ }
21
+
22
+ function highlightLine(line) {
23
+ if (line.trim() === '') return escapeHtml(line);
24
+
25
+ var result = '';
26
+ var i = 0;
27
+ var len = line.length;
28
+
29
+ // Preserve leading whitespace
30
+ while (i < len && (line[i] === ' ' || line[i] === '\t')) {
31
+ result += escapeHtml(line[i++]);
32
+ }
33
+
34
+ // Check for $ prompt ($ followed by space or end of line)
35
+ if (line[i] === '$' && (line[i + 1] === ' ' || line[i + 1] === undefined)) {
36
+ result += wrap('sh-prompt', '$');
37
+ i++;
38
+ }
39
+
40
+ // Check for # comment at start
41
+ if (line[i] === '#') {
42
+ return result + wrap('sh-comment', line.slice(i));
43
+ }
44
+
45
+ var seenCommand = false;
46
+ var afterSpace = true;
47
+
48
+ while (i < len) {
49
+ var ch = line[i];
50
+
51
+ // Whitespace
52
+ if (ch === ' ' || ch === '\t') {
53
+ result += escapeHtml(ch);
54
+ i++;
55
+ afterSpace = true;
56
+ continue;
57
+ }
58
+
59
+ // Comment after whitespace
60
+ if (ch === '#' && afterSpace) {
61
+ result += wrap('sh-comment', line.slice(i));
62
+ break;
63
+ }
64
+
65
+ // Double-quoted string
66
+ if (ch === '"') {
67
+ var end = i + 1;
68
+ while (end < len && line[end] !== '"') {
69
+ if (line[end] === '\\' && end + 1 < len) end += 2;
70
+ else end++;
71
+ }
72
+ if (end < len) end++;
73
+ result += wrap('sh-string', line.slice(i, end));
74
+ i = end;
75
+ afterSpace = false;
76
+ continue;
77
+ }
78
+
79
+ // Single-quoted string
80
+ if (ch === "'") {
81
+ var end = i + 1;
82
+ while (end < len && line[end] !== "'") end++;
83
+ if (end < len) end++;
84
+ result += wrap('sh-string', line.slice(i, end));
85
+ i = end;
86
+ afterSpace = false;
87
+ continue;
88
+ }
89
+
90
+ // Environment variable (ALLCAPS=)
91
+ if (afterSpace && /[A-Z]/.test(ch)) {
92
+ var match = line.slice(i).match(/^[A-Z][A-Z0-9_]*=/);
93
+ if (match) {
94
+ result += wrap('sh-envvar', match[0]);
95
+ i += match[0].length;
96
+ // Read unquoted value
97
+ var valEnd = i;
98
+ while (valEnd < len && line[valEnd] !== ' ' && line[valEnd] !== '\t' && line[valEnd] !== '"' && line[valEnd] !== "'") valEnd++;
99
+ if (valEnd > i) {
100
+ result += escapeHtml(line.slice(i, valEnd));
101
+ i = valEnd;
102
+ }
103
+ afterSpace = false;
104
+ continue;
105
+ }
106
+ }
107
+
108
+ // Option (must be after whitespace)
109
+ if (ch === '-' && afterSpace) {
110
+ var match = line.slice(i).match(/^--?[a-zA-Z0-9_-]+(=[^"'\s]*)?/);
111
+ if (match) {
112
+ result += wrap('sh-option', match[0]);
113
+ i += match[0].length;
114
+ afterSpace = false;
115
+ continue;
116
+ }
117
+ }
118
+
119
+ // Command (first word: regular, ./path, ../path, ~/path, /abs/path, @scope/pkg)
120
+ if (!seenCommand && afterSpace) {
121
+ var isCmd = /[a-zA-Z0-9@~\/]/.test(ch) ||
122
+ (ch === '.' && (line[i + 1] === '/' || (line[i + 1] === '.' && line[i + 2] === '/')));
123
+ if (isCmd) {
124
+ var end = i;
125
+ while (end < len && line[end] !== ' ' && line[end] !== '\t') end++;
126
+ result += wrap('sh-command', line.slice(i, end));
127
+ i = end;
128
+ seenCommand = true;
129
+ afterSpace = false;
130
+ continue;
131
+ }
132
+ }
133
+
134
+ // Everything else
135
+ result += escapeHtml(ch);
136
+ i++;
137
+ afterSpace = false;
138
+ }
139
+
140
+ return result;
141
+ }
142
+
143
+ function highlightShell(code) {
144
+ return code.split('\n').map(highlightLine).join('\n');
145
+ }
146
+
147
+ function initHighlighting() {
148
+ var selectors = [
149
+ 'pre.bash', 'pre.sh', 'pre.shell', 'pre.console',
150
+ 'pre[data-language="bash"]', 'pre[data-language="sh"]',
151
+ 'pre[data-language="shell"]', 'pre[data-language="console"]'
152
+ ];
153
+
154
+ var blocks = document.querySelectorAll(selectors.join(', '));
155
+ blocks.forEach(function(block) {
156
+ if (block.getAttribute('data-highlighted') === 'true') return;
157
+ block.innerHTML = highlightShell(block.textContent);
158
+ block.setAttribute('data-highlighted', 'true');
159
+ });
160
+ }
161
+
162
+ if (document.readyState === 'loading') {
163
+ document.addEventListener('DOMContentLoaded', initHighlighting);
164
+ } else {
165
+ initHighlighting();
166
+ }
167
+ })();
@@ -96,7 +96,7 @@ SearchController.prototype = Object.assign({}, SearchNavigation, new function()
96
96
  this.current.classList.remove('search-selected');
97
97
  next.classList.add('search-selected');
98
98
  this.input.setAttribute('aria-activedescendant', next.getAttribute('id'));
99
- this.scrollIntoView(next, this.view);
99
+ this.scrollInElement(next, this.result);
100
100
  this.current = next;
101
101
  this.input.value = next.firstChild.firstChild.text;
102
102
  this.input.select();
@@ -3,7 +3,7 @@
3
3
  <%= render '_header.rhtml' %>
4
4
  <%= render '_sidebar_toggle.rhtml' %>
5
5
 
6
- <nav id="navigation" role="navigation" hidden>
6
+ <nav id="sidebar-navigation" role="navigation" hidden>
7
7
  <%= render '_sidebar_pages.rhtml' %>
8
8
  <%= render '_sidebar_classes.rhtml' %>
9
9
  </nav>
@@ -1,7 +1,7 @@
1
1
  <body role="document">
2
2
  <%= render '_sidebar_toggle.rhtml' %>
3
3
 
4
- <nav id="navigation" role="navigation" hidden>
4
+ <nav id="sidebar-navigation" role="navigation" hidden>
5
5
  <%= render '_sidebar_pages.rhtml' %>
6
6
  <%= render '_sidebar_classes.rhtml' %>
7
7
  </nav>
@@ -1,7 +1,7 @@
1
1
  <body role="document">
2
2
  <%= render '_sidebar_toggle.rhtml' %>
3
3
 
4
- <nav id="navigation" role="navigation" hidden>
4
+ <nav id="sidebar-navigation" role="navigation" hidden>
5
5
  <div id="project-navigation">
6
6
  <div id="home-section" class="nav-section">
7
7
  <h2>
@@ -42,7 +42,7 @@
42
42
 
43
43
  <%- gems = installed.select { |_, _, _, type,| type == :gem } %>
44
44
  <%- missing = gems.reject { |_, _, exists,| exists } %>
45
- <%- unless missing.empty? then %>
45
+ <%- unless missing.empty? %>
46
46
  <h2>Missing Gem Documentation</h2>
47
47
 
48
48
  <p>You are missing documentation for some of your installed gems.
@@ -1,14 +1,16 @@
1
- <%- unless klass.extends.empty? then %>
1
+ <%- unless klass.extends.empty? %>
2
2
  <div id="extends-section" class="nav-section">
3
3
  <h3>Extended With Modules</h3>
4
4
 
5
5
  <ul class="link-list">
6
6
  <%- klass.extends.each do |ext| %>
7
- <%- unless String === ext.module then %>
8
- <li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a></li>
9
- <%- else %>
10
- <li><span class="extend"><%= ext.name %></span></li>
11
- <%- end %>
7
+ <li>
8
+ <%- unless String === ext.module %>
9
+ <a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
10
+ <%- else %>
11
+ <span class="extend"><%= ext.name %></span>
12
+ <%- end %>
13
+ </li>
12
14
  <%- end %>
13
15
  </ul>
14
16
  </div>
@@ -1,14 +1,16 @@
1
- <%- unless klass.includes.empty? then %>
1
+ <%- unless klass.includes.empty? %>
2
2
  <div id="includes-section" class="nav-section">
3
3
  <h3>Included Modules</h3>
4
4
 
5
5
  <ul class="link-list">
6
6
  <%- klass.includes.each do |inc| %>
7
- <%- unless String === inc.module then %>
8
- <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a></li>
9
- <%- else %>
10
- <li><span class="include"><%= inc.name %></span></li>
11
- <%- end %>
7
+ <li>
8
+ <%- unless String === inc.module %>
9
+ <a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
10
+ <%- else %>
11
+ <span class="include"><%= inc.name %></span>
12
+ <%- end %>
13
+ </li>
12
14
  <%- end %>
13
15
  </ul>
14
16
  </div>
@@ -5,7 +5,7 @@
5
5
  <%- installed.each do |name, href, exists, type, _| %>
6
6
  <%- next if type == :extra %>
7
7
  <li class="folder">
8
- <%- if exists then %>
8
+ <%- if exists %>
9
9
  <a href="<%= href %>"><%= h name %></a>
10
10
  <%- else %>
11
11
  <%= h name %>
@@ -2,7 +2,7 @@
2
2
  <%- if defined?(current) %>
3
3
  <%- dir = current.full_name[%r{\A[^/]+(?=/)}] || current.page_name %>
4
4
  <%- end %>
5
- <%- unless simple_files.empty? then %>
5
+ <%- unless simple_files.empty? %>
6
6
  <div id="fileindex-section" class="nav-section">
7
7
  <h3>Pages</h3>
8
8
 
@@ -1,4 +1,4 @@
1
- <%- unless klass.sections.length == 1 then %>
1
+ <%- unless klass.sections.length == 1 %>
2
2
  <div id="sections-section" class="nav-section">
3
3
  <h3>Sections</h3>
4
4
 
@@ -1,11 +1,11 @@
1
- <%- comment = if current.respond_to? :comment_location then
1
+ <%- comment = if current.respond_to? :comment_location
2
2
  current.comment_location
3
3
  else
4
4
  current.comment
5
5
  end
6
6
  table = current.parse(comment).table_of_contents.dup
7
7
 
8
- if table.length > 1 then %>
8
+ if table.length > 1 %>
9
9
  <div class="nav-section">
10
10
  <h3>Table of Contents</h3>
11
11
 
@@ -17,18 +17,18 @@
17
17
  <%- level = table.first&.level %>
18
18
  <%- while table.first && table.first.level >= level %>
19
19
  <%- heading = table.shift %>
20
+ <li>
20
21
  <%- if table.first.nil? || table.first.level <= heading.level %>
21
- <li><% display_link.call heading %></li>
22
+ <% display_link.call heading %>
22
23
  <%- else %>
23
- <li>
24
24
  <details open>
25
25
  <summary><%- display_link.call heading %></summary>
26
26
  <ul class="link-list" role="directory">
27
27
  <% list_siblings.call %>
28
28
  </ul>
29
29
  </details>
30
- </li>
31
30
  <%- end %>
31
+ </li>
32
32
  <%- end %>
33
33
  <%- end %>
34
34
 
@@ -26,7 +26,7 @@
26
26
  <% if namespace[:self] %>
27
27
  <span><%= namespace[:name] %></span>
28
28
  <% else %>
29
- <a href="<%= namespace[:path] %>"><%= namespace[:name] %></a><span>::</span>
29
+ <a href="<%= namespace[:path] %>"><%= namespace[:name] %></a><span class="separator">::</span>
30
30
  <% end %>
31
31
  </li>
32
32
  <% end %>
@@ -45,7 +45,7 @@
45
45
  <%- klass.each_section do |section, constants, attributes| %>
46
46
  <span id="<%= section.legacy_aref %>" class="legacy-anchor"></span>
47
47
  <section id="<%= section.aref %>" class="documentation-section anchor-link">
48
- <%- if section.title then %>
48
+ <%- if section.title %>
49
49
  <header class="documentation-section-title">
50
50
  <h2>
51
51
  <%= section.title %>
@@ -56,13 +56,13 @@
56
56
  </header>
57
57
  <%- end %>
58
58
 
59
- <%- if section.comment then %>
59
+ <%- if section.comment %>
60
60
  <div>
61
61
  <%= section.description %>
62
62
  </div>
63
63
  <%- end %>
64
64
 
65
- <%- unless constants.empty? then %>
65
+ <%- unless constants.empty? %>
66
66
  <section class="constants-list">
67
67
  <header>
68
68
  <h3>Constants</h3>
@@ -70,9 +70,9 @@
70
70
  <dl>
71
71
  <%- constants.each do |const| %>
72
72
  <dt id="<%= const.name %>"><%= const.name %></dt>
73
- <%- if const.comment then %>
73
+ <%- if const.comment %>
74
74
  <dd>
75
- <%- if const.mixin_from then %>
75
+ <%- if const.mixin_from %>
76
76
  <div class="mixin-from">
77
77
  Included from <a href="<%= klass.aref_to(const.mixin_from.path) %>"><%= const.mixin_from.full_name %></a>
78
78
  </div>
@@ -87,7 +87,7 @@
87
87
  </section>
88
88
  <%- end %>
89
89
 
90
- <%- unless attributes.empty? then %>
90
+ <%- unless attributes.empty? %>
91
91
  <section class="attribute-method-details method-section">
92
92
  <header>
93
93
  <h3>Attributes</h3>
@@ -103,12 +103,12 @@
103
103
  </div>
104
104
 
105
105
  <div class="method-description">
106
- <%- if attrib.mixin_from then %>
106
+ <%- if attrib.mixin_from %>
107
107
  <div class="mixin-from">
108
108
  <%= attrib.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(attrib.mixin_from.path) %>"><%= attrib.mixin_from.full_name %></a>
109
109
  </div>
110
110
  <%- end %>
111
- <%- if attrib.comment then %>
111
+ <%- if attrib.comment %>
112
112
  <%= attrib.description.strip %>
113
113
  <%- else %>
114
114
  <p class="missing-docs">(Not documented)</p>
@@ -131,7 +131,7 @@
131
131
  <%- methods.each do |method| %>
132
132
  <div id="<%= method.aref %>" class="method-detail anchor-link <%= method.is_alias_for ? "method-alias" : '' %>">
133
133
  <div class="method-header">
134
- <%- if (call_seq = method.call_seq) then %>
134
+ <%- if (call_seq = method.call_seq) %>
135
135
  <%- call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
136
136
  <div class="method-heading">
137
137
  <a href="#<%= method.aref %>" title="Link to this method">
@@ -143,7 +143,7 @@
143
143
  </a>
144
144
  </div>
145
145
  <%- end %>
146
- <%- elsif method.has_call_seq? then %>
146
+ <%- elsif method.has_call_seq? %>
147
147
  <div class="method-heading">
148
148
  <a href="#<%= method.aref %>" title="Link to this method">
149
149
  <span class="method-name"><%= h method.name %></span>
@@ -170,31 +170,28 @@
170
170
  </div>
171
171
  <%- end %>
172
172
 
173
- <%- unless method.skip_description? then %>
173
+ <%- unless method.skip_description? %>
174
174
  <div class="method-description">
175
- <%- if method.mixin_from then %>
175
+ <%- if method.mixin_from %>
176
176
  <div class="mixin-from">
177
177
  <%= method.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(method.mixin_from.path) %>"><%= method.mixin_from.full_name %></a>
178
178
  </div>
179
179
  <%- end %>
180
- <%- if method.comment then %>
180
+ <%- if method.comment %>
181
181
  <%= method.description.strip %>
182
182
  <%- else %>
183
183
  <p class="missing-docs">(Not documented)</p>
184
184
  <%- end %>
185
- <%- if method.calls_super then %>
185
+ <%- if method.calls_super %>
186
186
  <div class="method-calls-super">
187
187
  Calls superclass method
188
- <%=
189
- method.superclass_method ?
190
- method.formatter.link(method.superclass_method.full_name, method.superclass_method.full_name) : nil
191
- %>
188
+ <%= method.superclass_method_link %>
192
189
  </div>
193
190
  <%- end %>
194
191
  </div>
195
192
  <%- end %>
196
193
 
197
- <%- unless method.aliases.empty? then %>
194
+ <%- unless method.aliases.empty? %>
198
195
  <div class="aliases">
199
196
  Also aliased as: <%= method.aliases.map do |aka|
200
197
  if aka.parent then # HACK lib/rexml/encodings
@@ -206,7 +203,7 @@
206
203
  </div>
207
204
  <%- end %>
208
205
 
209
- <%- if method.is_alias_for then %>
206
+ <%- if method.is_alias_for %>
210
207
  <div class="aliases">
211
208
  Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
212
209
  </div>
@@ -449,7 +449,6 @@ main h6 {
449
449
  .ruby-ivar { color: #B57614; } /* Brown */
450
450
  .ruby-operator { color: #427B58; } /* Dark Teal */
451
451
  .ruby-identifier { color: #076678; } /* Deep Teal */
452
- .ruby-node { color: #8F3F71; } /* Plum */
453
452
  .ruby-comment { color: #928374; font-style: italic; } /* Gray */
454
453
  .ruby-regexp { color: #8F3F71; } /* Plum */
455
454
  .ruby-value { color: #AF3A03; } /* Dark Orange */
@@ -14,7 +14,7 @@
14
14
  <h1 class="class"><%= h @title %></h1>
15
15
 
16
16
  <%- simple_files = @files.select { |f| f.text? } %>
17
- <%- unless simple_files.empty? then %>
17
+ <%- unless simple_files.empty? %>
18
18
  <h2 id="pages">Pages</h2>
19
19
  <ul>
20
20
  <%- simple_files.sort.each do |file| %>
@@ -23,7 +23,7 @@
23
23
  <%
24
24
  # HACK table_of_contents should not exist on Document
25
25
  table = file.parse(file.comment).table_of_contents
26
- unless table.empty? then %>
26
+ unless table.empty? %>
27
27
  <ul>
28
28
  <%- table.each do |heading| %>
29
29
  <li><a href="<%= h file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a></li>
@@ -44,7 +44,7 @@
44
44
  table.concat klass.parse(klass.comment_location).table_of_contents
45
45
  table.concat klass.section_contents
46
46
 
47
- unless table.empty? then %>
47
+ unless table.empty? %>
48
48
  <ul>
49
49
  <%- table.each do |item| %>
50
50
  <%- label = item.respond_to?(:label) ? item.label(klass) : item.aref %>
@@ -89,9 +89,9 @@ class RDoc::I18n::Text
89
89
  case raw
90
90
  when RDoc::Comment
91
91
  raw.text.each_line(&block)
92
- when Array
93
- raw.each do |comment, location|
94
- each_line(comment, &block)
92
+ when Hash
93
+ raw.each_value do |comments|
94
+ comments.each { |comment| each_line(comment, &block) }
95
95
  end
96
96
  else
97
97
  raw.each_line(&block)