rdoc 6.14.2 → 7.1.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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +196 -0
  3. data/History.rdoc +1 -1
  4. data/LEGAL.rdoc +6 -0
  5. data/README.md +195 -0
  6. data/RI.md +1 -1
  7. data/doc/markup_reference/markdown.md +558 -0
  8. data/doc/markup_reference/rdoc.rdoc +1169 -0
  9. data/lib/rdoc/code_object/any_method.rb +15 -7
  10. data/lib/rdoc/code_object/class_module.rb +62 -11
  11. data/lib/rdoc/code_object/constant.rb +9 -0
  12. data/lib/rdoc/code_object/context/section.rb +20 -1
  13. data/lib/rdoc/code_object/method_attr.rb +13 -1
  14. data/lib/rdoc/code_object/top_level.rb +31 -26
  15. data/lib/rdoc/comment.rb +190 -8
  16. data/lib/rdoc/cross_reference.rb +31 -22
  17. data/lib/rdoc/generator/aliki.rb +183 -0
  18. data/lib/rdoc/generator/darkfish.rb +8 -2
  19. data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
  20. data/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
  21. data/lib/rdoc/generator/template/aliki/_head.rhtml +158 -0
  22. data/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
  23. data/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
  24. data/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
  25. data/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
  26. data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +25 -0
  27. data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +25 -0
  28. data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
  29. data/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
  30. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
  31. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
  32. data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
  33. data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
  34. data/lib/rdoc/generator/template/aliki/class.rhtml +220 -0
  35. data/lib/rdoc/generator/template/aliki/css/rdoc.css +1963 -0
  36. data/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
  37. data/lib/rdoc/generator/template/aliki/js/aliki.js +505 -0
  38. data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
  39. data/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -0
  40. data/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
  41. data/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
  42. data/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
  43. data/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
  44. data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
  45. data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
  46. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +3 -3
  47. data/lib/rdoc/generator/template/darkfish/_head.rhtml +14 -19
  48. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +8 -8
  49. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +8 -8
  50. data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +7 -6
  51. data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +6 -6
  52. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +18 -18
  53. data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +2 -2
  54. data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +1 -0
  55. data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +3 -3
  56. data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +14 -14
  57. data/lib/rdoc/generator/template/darkfish/class.rhtml +70 -68
  58. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +19 -0
  59. data/lib/rdoc/generator/template/darkfish/index.rhtml +4 -3
  60. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +21 -1
  61. data/lib/rdoc/generator/template/darkfish/js/search.js +11 -1
  62. data/lib/rdoc/generator/template/darkfish/page.rhtml +2 -1
  63. data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +2 -1
  64. data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +19 -19
  65. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +19 -17
  66. data/lib/rdoc/generator/template/json_index/js/searcher.js +48 -6
  67. data/lib/rdoc/generator.rb +1 -0
  68. data/lib/rdoc/markdown.kpeg +29 -22
  69. data/lib/rdoc/markdown.rb +366 -549
  70. data/lib/rdoc/markup/attribute_manager.rb +28 -1
  71. data/lib/rdoc/markup/blank_line.rb +25 -23
  72. data/lib/rdoc/markup/element.rb +21 -0
  73. data/lib/rdoc/markup/hard_break.rb +30 -27
  74. data/lib/rdoc/markup/heading.rb +166 -77
  75. data/lib/rdoc/markup/pre_process.rb +34 -10
  76. data/lib/rdoc/markup/raw.rb +52 -55
  77. data/lib/rdoc/markup/table.rb +48 -40
  78. data/lib/rdoc/markup/to_ansi.rb +4 -0
  79. data/lib/rdoc/markup/to_bs.rb +4 -0
  80. data/lib/rdoc/markup/to_html.rb +193 -25
  81. data/lib/rdoc/markup/to_html_crossref.rb +77 -28
  82. data/lib/rdoc/markup/to_label.rb +11 -1
  83. data/lib/rdoc/markup/to_rdoc.rb +11 -3
  84. data/lib/rdoc/markup/verbatim.rb +1 -1
  85. data/lib/rdoc/markup.rb +3 -2
  86. data/lib/rdoc/options.rb +22 -11
  87. data/lib/rdoc/parser/c.rb +15 -46
  88. data/lib/rdoc/parser/changelog.rb +8 -0
  89. data/lib/rdoc/parser/prism_ruby.rb +121 -113
  90. data/lib/rdoc/parser/ruby.rb +8 -8
  91. data/lib/rdoc/parser/ruby_tools.rb +5 -7
  92. data/lib/rdoc/parser/simple.rb +4 -21
  93. data/lib/rdoc/rdoc.rb +1 -0
  94. data/lib/rdoc/ri/task.rb +2 -2
  95. data/lib/rdoc/rubygems_hook.rb +3 -3
  96. data/lib/rdoc/store.rb +2 -2
  97. data/lib/rdoc/task.rb +4 -4
  98. data/lib/rdoc/text.rb +16 -1
  99. data/lib/rdoc/token_stream.rb +17 -9
  100. data/lib/rdoc/tom_doc.rb +1 -1
  101. data/lib/rdoc/version.rb +1 -1
  102. data/rdoc.gemspec +6 -5
  103. metadata +53 -12
  104. data/CONTRIBUTING.rdoc +0 -219
  105. data/ExampleMarkdown.md +0 -39
  106. data/ExampleRDoc.rdoc +0 -210
  107. data/README.rdoc +0 -144
@@ -4,6 +4,7 @@
4
4
  <input id="search-field" role="combobox" aria-label="Search"
5
5
  aria-autocomplete="list" aria-controls="search-results"
6
6
  type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
7
+ autocomplete="off"
7
8
  title="Type to search, Up and Down to navigate, Enter to load">
8
9
  </div>
9
10
 
@@ -3,9 +3,9 @@
3
3
  <h3>Sections</h3>
4
4
 
5
5
  <ul class="link-list" role="directory">
6
- <%- klass.sort_sections.each do |section| -%>
6
+ <%- klass.sort_sections.each do |section| %>
7
7
  <li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
8
- <%- end -%>
8
+ <%- end %>
9
9
  </ul>
10
10
  </div>
11
- <%- end -%>
11
+ <%- end %>
@@ -9,31 +9,31 @@
9
9
  <div class="nav-section">
10
10
  <h3>Table of Contents</h3>
11
11
 
12
- <%- display_link = proc do |heading| -%>
12
+ <%- display_link = proc do |heading| %>
13
13
  <a href="#<%= heading.label current %>"><%= heading.plain_html %></a>
14
- <%- end -%>
14
+ <%- end %>
15
15
 
16
- <%- list_siblings = proc do -%>
17
- <%- level = table.first&.level -%>
18
- <%- while table.first && table.first.level >= level -%>
19
- <%- heading = table.shift -%>
20
- <%- if table.first.nil? || table.first.level <= heading.level -%>
21
- <li><% display_link.call heading -%>
22
- <%- else -%>
16
+ <%- list_siblings = proc do %>
17
+ <%- level = table.first&.level %>
18
+ <%- while table.first && table.first.level >= level %>
19
+ <%- heading = table.shift %>
20
+ <%- if table.first.nil? || table.first.level <= heading.level %>
21
+ <li><% display_link.call heading %></li>
22
+ <%- else %>
23
23
  <li>
24
24
  <details open>
25
- <summary><%- display_link.call heading -%></summary>
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
30
  </li>
31
- <%- end -%>
32
- <%- end -%>
33
- <%- end -%>
31
+ <%- end %>
32
+ <%- end %>
33
+ <%- end %>
34
34
 
35
35
  <ul class="link-list" role="directory">
36
36
  <% list_siblings.call %>
37
37
  </ul>
38
38
  </div>
39
- <%- end -%>
39
+ <%- end %>
@@ -17,10 +17,10 @@
17
17
  <%= render '_footer.rhtml' %>
18
18
  </nav>
19
19
 
20
- <main role="main" aria-labelledby="<%=h klass.aref %>">
20
+ <main role="main" aria-labelledby="<%= h klass.aref %>">
21
21
  <%# If nesting level is 1, breadcrumb list is not needed %>
22
22
  <% if breadcrumb.size > 1 %>
23
- <ol role="navigation" aria-label="breadcrumb" class="breadcrumb">
23
+ <ol role="navigation" aria-label="Breadcrumb navigation" class="breadcrumb">
24
24
  <% breadcrumb.each do |namespace| %>
25
25
  <li>
26
26
  <% if namespace[:self] %>
@@ -33,7 +33,8 @@
33
33
  </ol>
34
34
  <% end %>
35
35
 
36
- <h1 id="<%=h klass.aref %>" class="anchor-link <%= klass.type %>">
36
+ <span id="<%= h klass.legacy_aref %>" class="legacy-anchor"></span>
37
+ <h1 id="<%= h klass.aref %>" class="anchor-link <%= klass.type %>">
37
38
  <%= klass.type %> <%= klass.full_name %>
38
39
  </h1>
39
40
 
@@ -41,9 +42,10 @@
41
42
  <%= klass.description %>
42
43
  </section>
43
44
 
44
- <%- klass.each_section do |section, constants, attributes| -%>
45
+ <%- klass.each_section do |section, constants, attributes| %>
46
+ <span id="<%= section.legacy_aref %>" class="legacy-anchor"></span>
45
47
  <section id="<%= section.aref %>" class="documentation-section anchor-link">
46
- <%- if section.title then -%>
48
+ <%- if section.title then %>
47
49
  <header class="documentation-section-title">
48
50
  <h2>
49
51
  <%= section.title %>
@@ -52,45 +54,46 @@
52
54
  <a href="#top">&uarr; top</a>
53
55
  </span>
54
56
  </header>
55
- <%- end -%>
57
+ <%- end %>
56
58
 
57
- <%- if section.comment then -%>
59
+ <%- if section.comment then %>
58
60
  <div>
59
61
  <%= section.description %>
60
62
  </div>
61
- <%- end -%>
63
+ <%- end %>
62
64
 
63
- <%- unless constants.empty? then -%>
65
+ <%- unless constants.empty? then %>
64
66
  <section class="constants-list">
65
67
  <header>
66
68
  <h3>Constants</h3>
67
69
  </header>
68
70
  <dl>
69
- <%- constants.each do |const| -%>
70
- <dt id="<%= const.name %>"><%= const.name %>
71
- <%- if const.comment then -%>
71
+ <%- constants.each do |const| %>
72
+ <dt id="<%= const.name %>"><%= const.name %></dt>
73
+ <%- if const.comment then %>
72
74
  <dd>
73
- <%- if const.mixin_from then -%>
75
+ <%- if const.mixin_from then %>
74
76
  <div class="mixin-from">
75
- Included from <a href="<%= klass.aref_to(const.mixin_from.path)%>"><%= const.mixin_from.full_name %></a>
77
+ Included from <a href="<%= klass.aref_to(const.mixin_from.path) %>"><%= const.mixin_from.full_name %></a>
76
78
  </div>
77
- <%- end -%>
79
+ <%- end %>
78
80
  <%= const.description.strip %>
79
- <%- else -%>
80
- <dd class="missing-docs">(Not documented)
81
- <%- end -%>
82
- <%- end -%>
81
+ </dd>
82
+ <%- else %>
83
+ <dd class="missing-docs">(Not documented)</dd>
84
+ <%- end %>
85
+ <%- end %>
83
86
  </dl>
84
87
  </section>
85
- <%- end -%>
88
+ <%- end %>
86
89
 
87
- <%- unless attributes.empty? then -%>
88
- <section class="attribute-method-details" class="method-section">
90
+ <%- unless attributes.empty? then %>
91
+ <section class="attribute-method-details method-section">
89
92
  <header>
90
93
  <h3>Attributes</h3>
91
94
  </header>
92
95
 
93
- <%- attributes.each do |attrib| -%>
96
+ <%- attributes.each do |attrib| %>
94
97
  <div id="<%= attrib.aref %>" class="method-detail anchor-link">
95
98
  <div class="method-heading attribute-method-heading">
96
99
  <a href="#<%= attrib.aref %>" title="Link to this attribute">
@@ -100,36 +103,36 @@
100
103
  </div>
101
104
 
102
105
  <div class="method-description">
103
- <%- if attrib.mixin_from then -%>
106
+ <%- if attrib.mixin_from then %>
104
107
  <div class="mixin-from">
105
- <%= attrib.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(attrib.mixin_from.path)%>"><%= attrib.mixin_from.full_name %></a>
108
+ <%= attrib.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(attrib.mixin_from.path) %>"><%= attrib.mixin_from.full_name %></a>
106
109
  </div>
107
- <%- end -%>
108
- <%- if attrib.comment then -%>
110
+ <%- end %>
111
+ <%- if attrib.comment then %>
109
112
  <%= attrib.description.strip %>
110
- <%- else -%>
111
- <p class="missing-docs">(Not documented)
112
- <%- end -%>
113
+ <%- else %>
114
+ <p class="missing-docs">(Not documented)</p>
115
+ <%- end %>
113
116
  </div>
114
117
  </div>
115
- <%- end -%>
118
+ <%- end %>
116
119
  </section>
117
- <%- end -%>
120
+ <%- end %>
118
121
 
119
- <%- klass.methods_by_type(section).each do |type, visibilities|
120
- next if visibilities.empty?
121
- visibilities.each do |visibility, methods|
122
- next if methods.empty? %>
122
+ <%- klass.methods_by_type(section).each do |type, visibilities| %>
123
+ <%- next if visibilities.empty? %>
124
+ <%- visibilities.each do |visibility, methods| %>
125
+ <%- next if methods.empty? %>
123
126
  <section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section anchor-link">
124
127
  <header>
125
128
  <h3><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
126
129
  </header>
127
130
 
128
- <%- methods.each do |method| -%>
131
+ <%- methods.each do |method| %>
129
132
  <div id="<%= method.aref %>" class="method-detail anchor-link <%= method.is_alias_for ? "method-alias" : '' %>">
130
133
  <div class="method-header">
131
- <%- if (call_seq = method.call_seq) then -%>
132
- <%- call_seq.strip.split("\n").each_with_index do |call_seq, i| -%>
134
+ <%- if (call_seq = method.call_seq) then %>
135
+ <%- call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
133
136
  <div class="method-heading">
134
137
  <a href="#<%= method.aref %>" title="Link to this method">
135
138
  <span class="method-callseq">
@@ -139,49 +142,47 @@
139
142
  </span>
140
143
  </a>
141
144
  </div>
142
- <%- end -%>
143
- <%- elsif method.has_call_seq? then -%>
145
+ <%- end %>
146
+ <%- elsif method.has_call_seq? then %>
144
147
  <div class="method-heading">
145
148
  <a href="#<%= method.aref %>" title="Link to this method">
146
149
  <span class="method-name"><%= h method.name %></span>
147
150
  </a>
148
151
  </div>
149
- <%- else -%>
152
+ <%- else %>
150
153
  <div class="method-heading">
151
154
  <a href="#<%= method.aref %>" title="Link to this method">
152
155
  <span class="method-name"><%= h method.name %></span>
153
156
  <span class="method-args"><%= h method.param_seq %></span>
154
157
  </a>
155
158
  </div>
156
- <%- end -%>
159
+ <%- end %>
157
160
  </div>
158
161
 
159
- <%- if method.token_stream -%>
162
+ <%- if method.token_stream %>
160
163
  <div class="method-controls">
161
164
  <details class="method-source-toggle">
162
165
  <summary>Source</summary>
163
166
  </details>
164
167
  </div>
165
- <%- end -%>
166
-
167
- <%- unless method.skip_description? then -%>
168
- <div class="method-description">
169
- <%- if method.token_stream then -%>
170
168
  <div class="method-source-code" id="<%= method.html_name %>-source">
171
169
  <pre><%= method.markup_code %></pre>
172
170
  </div>
173
- <%- end -%>
174
- <%- if method.mixin_from then -%>
171
+ <%- end %>
172
+
173
+ <%- unless method.skip_description? then %>
174
+ <div class="method-description">
175
+ <%- if method.mixin_from then %>
175
176
  <div class="mixin-from">
176
- <%= method.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(method.mixin_from.path)%>"><%= method.mixin_from.full_name %></a>
177
+ <%= method.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(method.mixin_from.path) %>"><%= method.mixin_from.full_name %></a>
177
178
  </div>
178
- <%- end -%>
179
- <%- if method.comment then -%>
179
+ <%- end %>
180
+ <%- if method.comment then %>
180
181
  <%= method.description.strip %>
181
- <%- else -%>
182
- <p class="missing-docs">(Not documented)
183
- <%- end -%>
184
- <%- if method.calls_super then -%>
182
+ <%- else %>
183
+ <p class="missing-docs">(Not documented)</p>
184
+ <%- end %>
185
+ <%- if method.calls_super then %>
185
186
  <div class="method-calls-super">
186
187
  Calls superclass method
187
188
  <%=
@@ -189,11 +190,11 @@
189
190
  method.formatter.link(method.superclass_method.full_name, method.superclass_method.full_name) : nil
190
191
  %>
191
192
  </div>
192
- <%- end -%>
193
+ <%- end %>
193
194
  </div>
194
- <%- end -%>
195
+ <%- end %>
195
196
 
196
- <%- unless method.aliases.empty? then -%>
197
+ <%- unless method.aliases.empty? then %>
197
198
  <div class="aliases">
198
199
  Also aliased as: <%= method.aliases.map do |aka|
199
200
  if aka.parent then # HACK lib/rexml/encodings
@@ -203,19 +204,20 @@
203
204
  end
204
205
  end.join ", " %>
205
206
  </div>
206
- <%- end -%>
207
+ <%- end %>
207
208
 
208
- <%- if method.is_alias_for then -%>
209
+ <%- if method.is_alias_for then %>
209
210
  <div class="aliases">
210
211
  Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
211
212
  </div>
212
- <%- end -%>
213
+ <%- end %>
213
214
  </div>
214
215
 
215
- <%- end -%>
216
+ <%- end %>
216
217
  </section>
217
- <%- end
218
- end %>
218
+ <%- end %>
219
+ <%- end %>
219
220
  </section>
220
- <%- end -%>
221
+ <%- end %>
221
222
  </main>
223
+ </body>
@@ -92,6 +92,25 @@ main .anchor-link:target {
92
92
  scroll-margin-top: 1rem;
93
93
  }
94
94
 
95
+ /* Legacy anchor for backward compatibility with old label- prefix links */
96
+ .legacy-anchor {
97
+ display: block;
98
+ position: relative;
99
+ visibility: hidden;
100
+ scroll-margin-top: 1rem;
101
+ }
102
+
103
+ /* When a legacy anchor is targeted, highlight the next heading sibling */
104
+ .legacy-anchor:target + h1,
105
+ .legacy-anchor:target + h2,
106
+ .legacy-anchor:target + h3,
107
+ .legacy-anchor:target + h4,
108
+ .legacy-anchor:target + h5,
109
+ .legacy-anchor:target + h6 {
110
+ margin-left: -10px;
111
+ border-left: 10px solid var(--border-color);
112
+ }
113
+
95
114
  /* 4. Links */
96
115
  a {
97
116
  color: var(--link-color);
@@ -17,7 +17,8 @@
17
17
  <main role="main">
18
18
  <%- if @main_page %>
19
19
  <%= @main_page.description %>
20
- <%- else -%>
21
- <p>This is the API documentation for <%= h @title %>.
22
- <%- end -%>
20
+ <%- else %>
21
+ <p>This is the API documentation for <%= h @title %>.</p>
22
+ <%- end %>
23
23
  </main>
24
+ </body>
@@ -72,10 +72,30 @@ function hookSearch() {
72
72
  }
73
73
 
74
74
  search.select = function(result) {
75
- window.location.href = result.firstChild.firstChild.href;
75
+ var href = result.firstChild.firstChild.href;
76
+ var query = this.input.value;
77
+ if (query) {
78
+ var url = new URL(href, window.location.origin);
79
+ url.searchParams.set('q', query);
80
+ url.searchParams.set('nav', '0');
81
+ href = url.toString();
82
+ }
83
+ window.location.href = href;
76
84
  }
77
85
 
78
86
  search.scrollIntoView = search.scrollInWindow;
87
+
88
+ // Check for ?q= URL parameter and trigger search automatically
89
+ if (typeof URLSearchParams !== 'undefined') {
90
+ var urlParams = new URLSearchParams(window.location.search);
91
+ var queryParam = urlParams.get('q');
92
+ if (queryParam) {
93
+ var navParam = urlParams.get('nav');
94
+ var autoSelect = navParam !== '0';
95
+ input.value = queryParam;
96
+ search.search(queryParam, autoSelect);
97
+ }
98
+ }
79
99
  };
80
100
 
81
101
  function hookFocus() {
@@ -34,6 +34,8 @@ Search.prototype = Object.assign({}, Navigation, new function() {
34
34
  }
35
35
 
36
36
  this.search = function(value, selectFirstMatch) {
37
+ this.selectFirstMatch = selectFirstMatch;
38
+
37
39
  value = value.trim().toLowerCase();
38
40
  if (value) {
39
41
  this.setNavigationActive(true);
@@ -76,7 +78,15 @@ Search.prototype = Object.assign({}, Navigation, new function() {
76
78
  //TODO: ECMAScript
77
79
  //if (jQuery.browser.msie) this.$element[0].className += '';
78
80
 
79
- if (isLast) this.result.setAttribute('aria-busy', 'false');
81
+ if (this.selectFirstMatch && this.current) {
82
+ this.selectFirstMatch = false;
83
+ this.select(this.current);
84
+ }
85
+
86
+ if (isLast) {
87
+ this.selectFirstMatch = false;
88
+ this.result.setAttribute('aria-busy', 'false');
89
+ }
80
90
  }
81
91
 
82
92
  this.move = function(isDown) {
@@ -13,6 +13,7 @@
13
13
  <%= render '_footer.rhtml' %>
14
14
  </nav>
15
15
 
16
- <main role="main" aria-label="Page <%=h file.full_name%>">
16
+ <main role="main" aria-label="Page <%= h file.full_name %>">
17
17
  <%= file.description %>
18
18
  </main>
19
+ </body>
@@ -16,5 +16,6 @@
16
16
  <main role="main">
17
17
  <h1>Not Found</h1>
18
18
 
19
- <p><%= message %>
19
+ <p><%= message %></p>
20
20
  </main>
21
+ </body>
@@ -20,46 +20,46 @@
20
20
  <h1>Local RDoc Documentation</h1>
21
21
 
22
22
  <p>Here you can browse local documentation from the ruby standard library and
23
- your installed gems.
23
+ your installed gems.</p>
24
24
 
25
- <%- extra_dirs = installed.select { |_, _, _, type,| type == :extra } -%>
26
- <%- unless extra_dirs.empty? -%>
25
+ <%- extra_dirs = installed.select { |_, _, _, type,| type == :extra } %>
26
+ <%- unless extra_dirs.empty? %>
27
27
  <h2>Extra Documentation Directories</h2>
28
28
 
29
29
  <p>The following additional documentation directories are available:</p>
30
30
 
31
31
  <ol>
32
- <%- extra_dirs.each do |name, href, exists, _, path| -%>
32
+ <%- extra_dirs.each do |name, href, exists, _, path| %>
33
33
  <li>
34
- <%- if exists -%>
34
+ <%- if exists %>
35
35
  <a href="<%= href %>"><%= h name %></a> (<%= h path %>)
36
- <%- else -%>
36
+ <%- else %>
37
37
  <%= h name %> (<%= h path %>; <i>not available</i>)
38
- <%- end -%>
38
+ <%- end %>
39
39
  </li>
40
- <%- end -%>
40
+ <%- end %>
41
41
  </ol>
42
- <%- end -%>
42
+ <%- end %>
43
43
 
44
- <%- gems = installed.select { |_, _, _, type,| type == :gem } -%>
45
- <%- missing = gems.reject { |_, _, exists,| exists } -%>
46
- <%- unless missing.empty? then -%>
44
+ <%- gems = installed.select { |_, _, _, type,| type == :gem } %>
45
+ <%- missing = gems.reject { |_, _, exists,| exists } %>
46
+ <%- unless missing.empty? %>
47
47
  <h2>Missing Gem Documentation</h2>
48
48
 
49
49
  <p>You are missing documentation for some of your installed gems.
50
50
  You can install missing documentation for gems by running
51
51
  <kbd>gem rdoc --all</kbd>. After installing the missing documentation you
52
52
  only need to reload this page. The newly created documentation will
53
- automatically appear.
53
+ automatically appear.</p>
54
54
 
55
55
  <p>You can also install documentation for a specific gem by running one of
56
- the following commands.
56
+ the following commands.</p>
57
57
 
58
58
  <ul>
59
- <%- names = missing.map { |name,| name.sub(/-([^-]*)$/, '') }.uniq -%>
60
- <%- names.each do |name| -%>
61
- <li><kbd>gem rdoc <%=h name %></kbd>
62
- <%- end -%>
59
+ <%- missing.map { |name,| name.sub(/-([^-]*)$/, '') }.uniq.each do |name| %>
60
+ <li><kbd>gem rdoc <%= h name %></kbd></li>
61
+ <%- end %>
63
62
  </ul>
64
- <%- end -%>
63
+ <%- end %>
65
64
  </main>
65
+ </body>
@@ -13,11 +13,11 @@
13
13
  <main role="main">
14
14
  <h1 class="class"><%= h @title %></h1>
15
15
 
16
- <%- simple_files = @files.select { |f| f.text? } -%>
17
- <%- unless simple_files.empty? then -%>
16
+ <%- simple_files = @files.select { |f| f.text? } %>
17
+ <%- unless simple_files.empty? then %>
18
18
  <h2 id="pages">Pages</h2>
19
19
  <ul>
20
- <%- simple_files.sort.each do |file| -%>
20
+ <%- simple_files.sort.each do |file| %>
21
21
  <li class="file">
22
22
  <a href="<%= h file.path %>"><%= h file.page_name %></a>
23
23
  <%
@@ -25,19 +25,19 @@
25
25
  table = file.parse(file.comment).table_of_contents
26
26
  unless table.empty? then %>
27
27
  <ul>
28
- <%- table.each do |heading| -%>
29
- <li><a href="<%= h file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a>
30
- <%- end -%>
28
+ <%- table.each do |heading| %>
29
+ <li><a href="<%= h file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a></li>
30
+ <%- end %>
31
31
  </ul>
32
- <%- end -%>
32
+ <%- end %>
33
33
  </li>
34
- <%- end -%>
34
+ <%- end %>
35
35
  </ul>
36
- <%- end -%>
36
+ <%- end %>
37
37
 
38
38
  <h2 id="classes">Classes and Modules</h2>
39
39
  <ul>
40
- <%- @modsort.each do |klass| -%>
40
+ <%- @modsort.each do |klass| %>
41
41
  <li class="<%= klass.type %>">
42
42
  <a href="<%= klass.path %>"><%= klass.full_name %></a>
43
43
  <%- table = []
@@ -46,14 +46,14 @@
46
46
 
47
47
  unless table.empty? then %>
48
48
  <ul>
49
- <%- table.each do |item| -%>
50
- <%- label = item.respond_to?(:label) ? item.label(klass) : item.aref -%>
51
- <li><a href="<%= klass.path %>#<%= label %>"><%= item.plain_html %></a>
52
- <%- end -%>
49
+ <%- table.each do |item| %>
50
+ <%- label = item.respond_to?(:label) ? item.label(klass) : item.aref %>
51
+ <li><a href="<%= klass.path %>#<%= label %>"><%= item.plain_html %></a></li>
52
+ <%- end %>
53
53
  </ul>
54
- <%- end -%>
54
+ <%- end %>
55
55
  </li>
56
- <%- end -%>
56
+ <%- end %>
57
57
  </ul>
58
58
 
59
59
  <h2 id="methods">Methods</h2>
@@ -65,6 +65,8 @@
65
65
  <a href="<%= method.path %>"><%= h method.pretty_name %></a>
66
66
  &mdash;
67
67
  <span class="container"><%= method.parent.full_name %></span>
68
- <%- end -%>
68
+ </li>
69
+ <%- end %>
69
70
  </ul>
70
71
  </main>
72
+ </body>