rdoc 6.5.0 → 6.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.rdoc +1 -1
  3. data/README.rdoc +2 -2
  4. data/TODO.rdoc +1 -1
  5. data/lib/rdoc/alias.rb +0 -1
  6. data/lib/rdoc/anon_class.rb +0 -1
  7. data/lib/rdoc/any_method.rb +15 -0
  8. data/lib/rdoc/attr.rb +0 -1
  9. data/lib/rdoc/class_module.rb +0 -1
  10. data/lib/rdoc/comment.rb +20 -41
  11. data/lib/rdoc/constant.rb +0 -1
  12. data/lib/rdoc/context/section.rb +0 -1
  13. data/lib/rdoc/context.rb +1 -1
  14. data/lib/rdoc/cross_reference.rb +3 -1
  15. data/lib/rdoc/encoding.rb +1 -17
  16. data/lib/rdoc/erb_partial.rb +0 -1
  17. data/lib/rdoc/erbio.rb +2 -7
  18. data/lib/rdoc/extend.rb +0 -1
  19. data/lib/rdoc/generator/darkfish.rb +2 -6
  20. data/lib/rdoc/generator/json_index.rb +2 -2
  21. data/lib/rdoc/generator/markup.rb +0 -1
  22. data/lib/rdoc/generator/pot.rb +1 -0
  23. data/lib/rdoc/generator/ri.rb +0 -1
  24. data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +1 -1
  25. data/lib/rdoc/generator/template/darkfish/class.rhtml +6 -0
  26. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +38 -13
  27. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +13 -0
  28. data/lib/rdoc/generator/template/darkfish/js/search.js +3 -3
  29. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +5 -4
  30. data/lib/rdoc/generator/template/json_index/js/navigation.js +8 -8
  31. data/lib/rdoc/ghost_method.rb +0 -1
  32. data/lib/rdoc/include.rb +0 -1
  33. data/lib/rdoc/markdown/entities.rb +0 -1
  34. data/lib/rdoc/markdown/literals.kpeg +0 -2
  35. data/lib/rdoc/markdown/literals.rb +66 -44
  36. data/lib/rdoc/markdown.kpeg +3 -3
  37. data/lib/rdoc/markdown.rb +7 -5
  38. data/lib/rdoc/markup/attr_changer.rb +0 -1
  39. data/lib/rdoc/markup/attr_span.rb +0 -1
  40. data/lib/rdoc/markup/attribute_manager.rb +14 -12
  41. data/lib/rdoc/markup/attributes.rb +0 -1
  42. data/lib/rdoc/markup/blank_line.rb +0 -1
  43. data/lib/rdoc/markup/block_quote.rb +0 -1
  44. data/lib/rdoc/markup/document.rb +0 -1
  45. data/lib/rdoc/markup/formatter.rb +1 -2
  46. data/lib/rdoc/markup/hard_break.rb +0 -1
  47. data/lib/rdoc/markup/heading.rb +0 -1
  48. data/lib/rdoc/markup/include.rb +0 -1
  49. data/lib/rdoc/markup/indented_paragraph.rb +0 -1
  50. data/lib/rdoc/markup/list.rb +0 -1
  51. data/lib/rdoc/markup/list_item.rb +0 -1
  52. data/lib/rdoc/markup/paragraph.rb +0 -1
  53. data/lib/rdoc/markup/parser.rb +5 -1
  54. data/lib/rdoc/markup/raw.rb +0 -1
  55. data/lib/rdoc/markup/regexp_handling.rb +0 -1
  56. data/lib/rdoc/markup/rule.rb +0 -1
  57. data/lib/rdoc/markup/table.rb +11 -2
  58. data/lib/rdoc/markup/to_ansi.rb +0 -1
  59. data/lib/rdoc/markup/to_bs.rb +25 -0
  60. data/lib/rdoc/markup/to_html.rb +7 -3
  61. data/lib/rdoc/markup/to_html_crossref.rb +13 -14
  62. data/lib/rdoc/markup/to_html_snippet.rb +3 -1
  63. data/lib/rdoc/markup/to_joined_paragraph.rb +2 -3
  64. data/lib/rdoc/markup/to_label.rb +0 -1
  65. data/lib/rdoc/markup/to_markdown.rb +4 -5
  66. data/lib/rdoc/markup/to_rdoc.rb +11 -4
  67. data/lib/rdoc/markup/to_table_of_contents.rb +0 -1
  68. data/lib/rdoc/markup/to_test.rb +0 -1
  69. data/lib/rdoc/markup/to_tt_only.rb +0 -1
  70. data/lib/rdoc/markup/verbatim.rb +0 -1
  71. data/lib/rdoc/meta_method.rb +0 -1
  72. data/lib/rdoc/method_attr.rb +0 -1
  73. data/lib/rdoc/mixin.rb +0 -1
  74. data/lib/rdoc/normal_class.rb +0 -1
  75. data/lib/rdoc/normal_module.rb +0 -1
  76. data/lib/rdoc/options.rb +4 -2
  77. data/lib/rdoc/parser/c.rb +33 -22
  78. data/lib/rdoc/parser/changelog.rb +15 -1
  79. data/lib/rdoc/parser/markdown.rb +0 -2
  80. data/lib/rdoc/parser/rd.rb +0 -1
  81. data/lib/rdoc/parser/ripper_state_lex.rb +11 -1
  82. data/lib/rdoc/parser/ruby.rb +18 -6
  83. data/lib/rdoc/parser/ruby_tools.rb +0 -2
  84. data/lib/rdoc/parser/text.rb +0 -1
  85. data/lib/rdoc/parser.rb +4 -2
  86. data/lib/rdoc/rd/block_parser.rb +650 -4
  87. data/lib/rdoc/rd/block_parser.ry +1 -1
  88. data/lib/rdoc/rd/inline.rb +0 -1
  89. data/lib/rdoc/rd/inline_parser.rb +649 -3
  90. data/lib/rdoc/rdoc.rb +2 -4
  91. data/lib/rdoc/require.rb +0 -1
  92. data/lib/rdoc/ri/driver.rb +10 -9
  93. data/lib/rdoc/ri/store.rb +0 -1
  94. data/lib/rdoc/single_class.rb +0 -1
  95. data/lib/rdoc/stats/quiet.rb +0 -1
  96. data/lib/rdoc/stats/verbose.rb +0 -2
  97. data/lib/rdoc/store.rb +29 -19
  98. data/lib/rdoc/task.rb +28 -2
  99. data/lib/rdoc/text.rb +10 -0
  100. data/lib/rdoc/token_stream.rb +1 -2
  101. data/lib/rdoc/top_level.rb +3 -1
  102. data/lib/rdoc/version.rb +1 -1
  103. data/lib/rdoc.rb +12 -0
  104. metadata +8 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acfa378032b35ef7563cf5255d5d3127b1fa8066dd5c5255088d7d13fdabb757
4
- data.tar.gz: 0bbc31e7348fcc5227a9b4319dc48cfb5e40143eeaeeb471921a5b2c6b098220
3
+ metadata.gz: 7b5120e82f653957d49d069e88f361f338a2db7f40bdc0756ffcea7d3bd3c4f2
4
+ data.tar.gz: a0f09a9246684a22992f2deff120c238b24fbe59a20dfdfa87b340fecc9ce297
5
5
  SHA512:
6
- metadata.gz: 7ad2f4cdcf3e7ffa7f81bc8d5795b1481d9c8f7feeba0f2a6455555cecbee603c5fb24e4e612929a7ff314ff027f69b561a0d8cf343c4099ea554db216ad3078
7
- data.tar.gz: 93bf81edf3cd84b35db94038b5978abd548042919a1dd3cd039431a681736a3aafe098135c86abe0701dbf3f242bae8af64b293d2f908b2a258ce5075f1519b3
6
+ metadata.gz: e0391b650362cb28f505eaf1d258b259debc4d828ad98643e3a27c1a16811d2bf126b40dd3f9872f4d50536e6875a4691e52c4e6d3732850150710866baf0f69
7
+ data.tar.gz: c8a40bfeedd964ce6b42781c1ee6c93dda1917a3333b79ebe8b886cd26a8fe49b32522a156c39c99811134fa8bd60612aface400f06641bea155d07a9de6ec2a
data/CONTRIBUTING.rdoc CHANGED
@@ -40,7 +40,7 @@ If the tests don't pass on the first run check the {GitHub Actions page}[https:/
40
40
  You can now use `rake` and `autotest` to run the tests.
41
41
 
42
42
  Note: the `rake` command must be used first before running any tests, because
43
- its used to generate various parsers implemented in RDoc. Also `rake clean` is
43
+ it's used to generate various parsers implemented in RDoc. Also `rake clean` is
44
44
  helpful to delete these generated files.
45
45
 
46
46
  == Glossary
data/README.rdoc CHANGED
@@ -3,7 +3,7 @@
3
3
  home :: https://github.com/ruby/rdoc
4
4
  rdoc :: https://ruby.github.io/rdoc
5
5
  bugs :: https://github.com/ruby/rdoc/issues
6
- code quality :: {<img src="https://codeclimate.com/github/ruby/rdoc/badges/gpa.svg" alt="Code Climate">}[https://codeclimate.com/github/ruby/rdoc]
6
+ code quality :: https://codeclimate.com/github/ruby/rdoc
7
7
 
8
8
  == Description
9
9
 
@@ -46,7 +46,7 @@ contain just Markup-style markup (with or without leading '#' comment
46
46
  markers). If directory names are passed to RDoc, they are scanned
47
47
  recursively for C and Ruby source files only.
48
48
 
49
- To generate documentation using +rake+ see RDoc::Task[https://ruby.github.io/rdoc/RDocTask.html].
49
+ To generate documentation using +rake+ see RDoc::Task[https://ruby.github.io/rdoc/RDoc/Task.html].
50
50
 
51
51
  To generate documentation programmatically:
52
52
 
data/TODO.rdoc CHANGED
@@ -26,7 +26,7 @@ Nice to have:
26
26
  * Global variable support
27
27
  * Provide the code_object to directive handlers
28
28
 
29
- === 4
29
+ === More Future
30
30
 
31
31
  API changes to RDoc
32
32
 
data/lib/rdoc/alias.rb CHANGED
@@ -109,4 +109,3 @@ class RDoc::Alias < RDoc::CodeObject
109
109
  end
110
110
 
111
111
  end
112
-
@@ -8,4 +8,3 @@
8
8
 
9
9
  class RDoc::AnonClass < RDoc::ClassModule
10
10
  end
11
-
@@ -115,6 +115,13 @@ class RDoc::AnyMethod < RDoc::MethodAttr
115
115
  @call_seq = call_seq
116
116
  end
117
117
 
118
+ ##
119
+ # Whether the method has a call-seq.
120
+
121
+ def has_call_seq?
122
+ !!(@call_seq || is_alias_for&._call_seq)
123
+ end
124
+
118
125
  ##
119
126
  # Loads is_alias_for from the internal name. Returns nil if the alias
120
127
  # cannot be found.
@@ -296,6 +303,14 @@ class RDoc::AnyMethod < RDoc::MethodAttr
296
303
  params
297
304
  end
298
305
 
306
+ ##
307
+ # Whether to skip the method description, true for methods that have
308
+ # aliases with a call-seq that doesn't include the method name.
309
+
310
+ def skip_description?
311
+ has_call_seq? && call_seq.nil? && !!(is_alias_for || !aliases.empty?)
312
+ end
313
+
299
314
  ##
300
315
  # Sets the store for this method and its referenced code objects.
301
316
 
data/lib/rdoc/attr.rb CHANGED
@@ -173,4 +173,3 @@ class RDoc::Attr < RDoc::MethodAttr
173
173
  end
174
174
 
175
175
  end
176
-
@@ -799,4 +799,3 @@ class RDoc::ClassModule < RDoc::Context
799
799
  end
800
800
 
801
801
  end
802
-
data/lib/rdoc/comment.rb CHANGED
@@ -6,8 +6,8 @@
6
6
  # Each comment may have a different markup format set by #format=. By default
7
7
  # 'rdoc' is used. The :markup: directive tells RDoc which format to use.
8
8
  #
9
- # See RDoc::Markup@Other+directives for instructions on adding an alternate
10
- # format.
9
+ # See RDoc::MarkupReference@Directive+for+Specifying+RDoc+Source+Format.
10
+
11
11
 
12
12
  class RDoc::Comment
13
13
 
@@ -97,42 +97,26 @@ class RDoc::Comment
97
97
  # comment. The difficulty is to make sure not to match lines starting
98
98
  # with ARGF at the same indent, but that are after the first description
99
99
  # paragraph.
100
- if @text =~ /^\s*:?call-seq:(.*?(?:\S).*?)^\s*$/m then
100
+ if /^(?<S> ((?!\n)\s)*+ (?# whitespaces except newline))
101
+ :?call-seq:
102
+ (?<B> \g<S>(?<N>\n|\z) (?# trailing spaces))?
103
+ (?<seq>
104
+ (\g<S>(?!\w)\S.*\g<N>)*
105
+ (?>
106
+ (?<H> \g<S>\w+ (?# ' # ARGF' in the example above))
107
+ .*\g<N>)?
108
+ (\g<S>\S.*\g<N> (?# other non-blank line))*+
109
+ (\g<B>+(\k<H>.*\g<N> (?# ARGF.to_a lines))++)*+
110
+ )
111
+ (?m:^\s*$|\z)
112
+ /x =~ @text
113
+ seq = $~[:seq]
114
+
101
115
  all_start, all_stop = $~.offset(0)
102
- seq_start, seq_stop = $~.offset(1)
103
-
104
- # we get the following lines that start with the leading word at the
105
- # same indent, even if they have blank lines before
106
- if $1 =~ /(^\s*\n)+^(\s*\w+)/m then
107
- leading = $2 # ' * ARGF' in the example above
108
- re = %r%
109
- \A(
110
- (^\s*\n)+
111
- (^#{Regexp.escape leading}.*?\n)+
112
- )+
113
- ^\s*$
114
- %xm
115
-
116
- if @text[seq_stop..-1] =~ re then
117
- all_stop = seq_stop + $~.offset(0).last
118
- seq_stop = seq_stop + $~.offset(1).last
119
- end
120
- end
121
-
122
- seq = @text[seq_start..seq_stop]
123
- seq.gsub!(/^\s*(\S|\n)/m, '\1')
124
116
  @text.slice! all_start...all_stop
125
117
 
126
- method.call_seq = seq.chomp
127
-
128
- else
129
- regexp = /^\s*:?call-seq:(.*?)(^\s*$|\z)/m
130
- if regexp =~ @text then
131
- @text = @text.sub(regexp, '')
132
- seq = $1
133
- seq.gsub!(/^\s*/, '')
134
- method.call_seq = seq
135
- end
118
+ seq.gsub!(/^\s*/, '')
119
+ method.call_seq = seq
136
120
  end
137
121
 
138
122
  method
@@ -149,12 +133,7 @@ class RDoc::Comment
149
133
  # HACK dubious
150
134
 
151
135
  def encode! encoding
152
- # TODO: Remove this condition after Ruby 2.2 EOL
153
- if RUBY_VERSION < '2.3.0'
154
- @text = @text.force_encoding encoding
155
- else
156
- @text = String.new @text, encoding: encoding
157
- end
136
+ @text = String.new @text, encoding: encoding
158
137
  self
159
138
  end
160
139
 
data/lib/rdoc/constant.rb CHANGED
@@ -184,4 +184,3 @@ class RDoc::Constant < RDoc::CodeObject
184
184
  end
185
185
 
186
186
  end
187
-
@@ -231,4 +231,3 @@ class RDoc::Context::Section
231
231
  end
232
232
 
233
233
  end
234
-
data/lib/rdoc/context.rb CHANGED
@@ -710,7 +710,7 @@ class RDoc::Context < RDoc::CodeObject
710
710
  # This method exists to make it easy to work with Context subclasses that
711
711
  # aren't part of RDoc.
712
712
 
713
- def each_ancestor # :nodoc:
713
+ def each_ancestor(&_) # :nodoc:
714
714
  end
715
715
 
716
716
  ##
@@ -131,6 +131,9 @@ class RDoc::CrossReference
131
131
  @seen = {}
132
132
  end
133
133
 
134
+ ##
135
+ # Returns a method reference to +name+.
136
+
134
137
  def resolve_method name
135
138
  ref = nil
136
139
 
@@ -223,4 +226,3 @@ class RDoc::CrossReference
223
226
  end
224
227
 
225
228
  end
226
-
data/lib/rdoc/encoding.rb CHANGED
@@ -86,17 +86,6 @@ module RDoc::Encoding
86
86
  nil
87
87
  end
88
88
 
89
- def self.remove_frozen_string_literal string
90
- string =~ /\A(?:#!.*\n)?(.*\n)/
91
- first_line = $1
92
-
93
- if first_line =~ /\A# +frozen[-_]string[-_]literal[=:].+$/i
94
- string = string.sub first_line, ''
95
- end
96
-
97
- string
98
- end
99
-
100
89
  ##
101
90
  # Detects the encoding of +string+ based on the magic comment
102
91
 
@@ -124,12 +113,7 @@ module RDoc::Encoding
124
113
  if text.kind_of? RDoc::Comment
125
114
  text.encode! encoding
126
115
  else
127
- # TODO: Remove this condition after Ruby 2.2 EOL
128
- if RUBY_VERSION < '2.3.0'
129
- text.force_encoding encoding
130
- else
131
- String.new text, encoding: encoding
132
- end
116
+ String.new text, encoding: encoding
133
117
  end
134
118
  end
135
119
 
@@ -16,4 +16,3 @@ class RDoc::ERBPartial < ERB
16
16
  end
17
17
 
18
18
  end
19
-
data/lib/rdoc/erbio.rb CHANGED
@@ -20,12 +20,8 @@ class RDoc::ERBIO < ERB
20
20
  ##
21
21
  # Defaults +eoutvar+ to 'io', otherwise is identical to ERB's initialize
22
22
 
23
- def initialize str, safe_level = nil, legacy_trim_mode = nil, legacy_eoutvar = 'io', trim_mode: nil, eoutvar: 'io'
24
- if RUBY_VERSION >= '2.6'
25
- super(str, trim_mode: trim_mode, eoutvar: eoutvar)
26
- else
27
- super(str, safe_level, legacy_trim_mode, legacy_eoutvar)
28
- end
23
+ def initialize str, trim_mode: nil, eoutvar: 'io'
24
+ super(str, trim_mode: trim_mode, eoutvar: eoutvar)
29
25
  end
30
26
 
31
27
  ##
@@ -39,4 +35,3 @@ class RDoc::ERBIO < ERB
39
35
  end
40
36
 
41
37
  end
42
-
data/lib/rdoc/extend.rb CHANGED
@@ -7,4 +7,3 @@
7
7
  class RDoc::Extend < RDoc::Mixin
8
8
 
9
9
  end
10
-
@@ -610,7 +610,7 @@ class RDoc::Generator::Darkfish
610
610
 
611
611
  @classes = @store.all_classes_and_modules.sort
612
612
  @files = @store.all_files.sort
613
- @methods = @classes.map { |m| m.method_list }.flatten.sort
613
+ @methods = @classes.flat_map { |m| m.method_list }.sort
614
614
  @modsort = get_sorted_module_list @classes
615
615
  end
616
616
 
@@ -778,11 +778,7 @@ class RDoc::Generator::Darkfish
778
778
  erbout = "_erbout_#{file_var}"
779
779
  end
780
780
 
781
- if RUBY_VERSION >= '2.6'
782
- template = klass.new template, trim_mode: '-', eoutvar: erbout
783
- else
784
- template = klass.new template, nil, '-', erbout
785
- end
781
+ template = klass.new template, trim_mode: '-', eoutvar: erbout
786
782
  @template_cache[file] = template
787
783
  template
788
784
  end
@@ -230,9 +230,9 @@ class RDoc::Generator::JsonIndex
230
230
  def index_methods
231
231
  debug_msg " generating method search index"
232
232
 
233
- list = @classes.uniq.map do |klass|
233
+ list = @classes.uniq.flat_map do |klass|
234
234
  klass.method_list
235
- end.flatten.sort_by do |method|
235
+ end.sort_by do |method|
236
236
  [method.name, method.parent.full_name]
237
237
  end
238
238
 
@@ -157,4 +157,3 @@ class RDoc::TopLevel
157
157
  end
158
158
 
159
159
  end
160
-
@@ -81,6 +81,7 @@ class RDoc::Generator::POT
81
81
  end
82
82
  end
83
83
 
84
+ # :nodoc:
84
85
  def class_dir
85
86
  nil
86
87
  end
@@ -28,4 +28,3 @@ class RDoc::Generator::RI
28
28
  end
29
29
 
30
30
  end
31
-
@@ -3,7 +3,7 @@
3
3
  <div id="search-field-wrapper">
4
4
  <input id="search-field" role="combobox" aria-label="Search"
5
5
  aria-autocomplete="list" aria-controls="search-results"
6
- type="text" name="search" placeholder="Search" spellcheck="false"
6
+ type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
7
7
  title="Type to search, Up and Down to navigate, Enter to load">
8
8
  </div>
9
9
 
@@ -112,6 +112,10 @@
112
112
  <%- end -%>
113
113
  </div>
114
114
  <%- end -%>
115
+ <%- elsif method.has_call_seq? then -%>
116
+ <div class="method-heading">
117
+ <span class="method-name"><%= h method.name %></span>
118
+ </div>
115
119
  <%- else -%>
116
120
  <div class="method-heading">
117
121
  <span class="method-name"><%= h method.name %></span><span
@@ -123,6 +127,7 @@
123
127
  <%- end -%>
124
128
  </div>
125
129
 
130
+ <%- unless method.skip_description? then -%>
126
131
  <div class="method-description">
127
132
  <%- if method.comment then -%>
128
133
  <%= method.description.strip %>
@@ -145,6 +150,7 @@
145
150
  </div>
146
151
  <%- end -%>
147
152
  </div>
153
+ <%- end -%>
148
154
 
149
155
  <%- unless method.aliases.empty? then -%>
150
156
  <div class="aliases">
@@ -17,6 +17,14 @@ body {
17
17
  background: #fafafa;
18
18
  font-family: Lato, sans-serif;
19
19
  font-weight: 300;
20
+
21
+ /* Layout */
22
+ display: grid;
23
+ grid-template-columns: auto 1fr;
24
+ }
25
+
26
+ body > :last-child {
27
+ grid-column: 1 / 3;
20
28
  }
21
29
 
22
30
  h1 span,
@@ -79,6 +87,17 @@ pre {
79
87
  border-radius: 0.2em;
80
88
  }
81
89
 
90
+ em {
91
+ text-decoration-color: rgba(52, 48, 64, 0.25);
92
+ text-decoration-line: underline;
93
+ text-decoration-style: dotted;
94
+ }
95
+
96
+ strong,
97
+ em {
98
+ background-color: rgba(158, 178, 255, 0.1);
99
+ }
100
+
82
101
  table {
83
102
  margin: 0;
84
103
  border-spacing: 0;
@@ -181,21 +200,25 @@ table tr:nth-child(even) td {
181
200
  /* @group Top-Level Structure */
182
201
 
183
202
  nav {
184
- float: left;
185
- width: 260px;
186
203
  font-family: Helvetica, sans-serif;
187
204
  font-size: 14px;
188
205
  border-right: 1px solid #ccc;
189
206
  position: sticky;
190
207
  top: 0;
191
208
  overflow: auto;
209
+
210
+ /* Layout */
211
+ width: 260px; /* fallback */
212
+ width: max(50px, 20vw);
213
+ min-width: 50px;
214
+ max-width: 80vw;
192
215
  height: calc(100vh - 100px); /* reduce the footer height */
216
+ resize: horizontal;
193
217
  }
194
218
 
195
219
  main {
196
220
  display: block;
197
- margin: 0 2em 5em 260px;
198
- padding-left: 20px;
221
+ margin: 1em;
199
222
  min-width: 340px;
200
223
  font-size: 16px;
201
224
  }
@@ -214,7 +237,6 @@ main h6 {
214
237
  }
215
238
 
216
239
  #validator-badges {
217
- clear: both;
218
240
  margin: 1em 1em 2em;
219
241
  font-size: smaller;
220
242
  }
@@ -309,23 +331,26 @@ dl.note-list dt {
309
331
  background: url(../images/arrow_up.png) no-repeat right center;
310
332
  }
311
333
 
312
- .nav-section details summary {
334
+ .nav-section details > summary {
313
335
  display: block;
314
336
  }
315
337
 
316
- .nav-section details summary::-webkit-details-marker {
338
+ .nav-section details > summary::-webkit-details-marker {
317
339
  display: none;
318
340
  }
319
341
 
320
- .nav-section details summary:before {
342
+ .nav-section details > summary::before {
321
343
  content: "";
322
344
  }
323
345
 
324
- .nav-section details summary:after {
325
- content: " \25B6"; /* BLACK RIGHT-POINTING TRIANGLE */
346
+ .nav-section details > summary::after {
347
+ content: "\25B6"; /* BLACK RIGHT-POINTING TRIANGLE */
348
+ font-size: 0.8em;
349
+ margin-left: 0.4em;
326
350
  }
327
- .nav-section details[open] > summary:after {
328
- content: " \25BD"; /* WHITE DOWN-POINTING TRIANGLE */
351
+
352
+ .nav-section details[open] > summary::after {
353
+ content: "\25BD"; /* WHITE DOWN-POINTING TRIANGLE */
329
354
  }
330
355
 
331
356
  /* @end */
@@ -553,7 +578,7 @@ main .method-click-advice {
553
578
  line-height: 20px;
554
579
  background: url(../images/zoom.png) no-repeat right top;
555
580
  }
556
- main .method-heading:hover .method-click-advice {
581
+ main .method-header:hover .method-click-advice {
557
582
  visibility: visible;
558
583
  }
559
584
 
@@ -78,7 +78,20 @@ function hookSearch() {
78
78
  search.scrollIntoView = search.scrollInWindow;
79
79
  };
80
80
 
81
+ function hookFocus() {
82
+ document.addEventListener("keydown", (event) => {
83
+ if (document.activeElement.tagName === 'INPUT') {
84
+ return;
85
+ }
86
+ if (event.key === "/") {
87
+ event.preventDefault();
88
+ document.querySelector('#search-field').focus();
89
+ }
90
+ });
91
+ }
92
+
81
93
  document.addEventListener('DOMContentLoaded', function() {
82
94
  hookSourceViews();
83
95
  hookSearch();
96
+ hookFocus();
84
97
  });
@@ -15,9 +15,9 @@ Search.prototype = Object.assign({}, Navigation, new function() {
15
15
  this.init = function() {
16
16
  var _this = this;
17
17
  var observer = function(e) {
18
- switch(e.keyCode) {
19
- case 38: // Event.KEY_UP
20
- case 40: // Event.KEY_DOWN
18
+ switch(e.key) {
19
+ case 'ArrowUp':
20
+ case 'ArrowDown':
21
21
  return;
22
22
  }
23
23
  _this.search(_this.input.value);
@@ -36,8 +36,9 @@
36
36
  unless table.empty? then %>
37
37
  <ul>
38
38
  <%- table.each do |item| -%>
39
- <li><a href="<%= klass.path %>#<%= item.aref %>"><%= item.plain_html %></a>
40
- <%- end -%>
39
+ <%- label = item.respond_to?(:label) ? item.label(klass) : item.aref -%>
40
+ <li><a href="<%= klass.path %>#<%= label %>"><%= item.plain_html %></a>
41
+ <%- end -%>
41
42
  </ul>
42
43
  <%- end -%>
43
44
  </li>
@@ -46,9 +47,9 @@
46
47
 
47
48
  <h2 id="methods">Methods</h2>
48
49
  <ul>
49
- <%- @store.all_classes_and_modules.map do |mod|
50
+ <%- @store.all_classes_and_modules.flat_map do |mod|
50
51
  mod.method_list
51
- end.flatten.sort.each do |method| %>
52
+ end.sort.each do |method| %>
52
53
  <li class="method">
53
54
  <a href="<%= method.path %>"><%= h method.pretty_name %></a>
54
55
  &mdash;
@@ -23,24 +23,24 @@ Navigation = new function() {
23
23
 
24
24
  this.onkeydown = function(e) {
25
25
  if (!this.navigationActive) return;
26
- switch(e.keyCode) {
27
- case 37: //Event.KEY_LEFT:
26
+ switch(e.key) {
27
+ case 'ArrowLeft':
28
28
  if (this.moveLeft()) e.preventDefault();
29
29
  break;
30
- case 38: //Event.KEY_UP:
31
- if (e.keyCode == 38 || e.ctrlKey) {
30
+ case 'ArrowUp':
31
+ if (e.key == 'ArrowUp' || e.ctrlKey) {
32
32
  if (this.moveUp()) e.preventDefault();
33
33
  }
34
34
  break;
35
- case 39: //Event.KEY_RIGHT:
35
+ case 'ArrowRight':
36
36
  if (this.moveRight()) e.preventDefault();
37
37
  break;
38
- case 40: //Event.KEY_DOWN:
39
- if (e.keyCode == 40 || e.ctrlKey) {
38
+ case 'ArrowDown':
39
+ if (e.key == 'ArrowDown' || e.ctrlKey) {
40
40
  if (this.moveDown()) e.preventDefault();
41
41
  }
42
42
  break;
43
- case 13: //Event.KEY_RETURN:
43
+ case 'Enter':
44
44
  if (this.current) e.preventDefault();
45
45
  this.select(this.current);
46
46
  break;
@@ -4,4 +4,3 @@
4
4
 
5
5
  class RDoc::GhostMethod < RDoc::AnyMethod
6
6
  end
7
-
data/lib/rdoc/include.rb CHANGED
@@ -7,4 +7,3 @@
7
7
  class RDoc::Include < RDoc::Mixin
8
8
 
9
9
  end
10
-
@@ -2129,4 +2129,3 @@ RDoc::Markdown::HTML_ENTITIES = {
2129
2129
  "zwj" => [0x0200D],
2130
2130
  "zwnj" => [0x0200C],
2131
2131
  }
2132
-
@@ -6,7 +6,6 @@
6
6
  # :markup: markdown
7
7
 
8
8
  ##
9
- #--
10
9
  # This set of literals is for Ruby 1.9 regular expressions and gives full
11
10
  # unicode support.
12
11
  #
@@ -20,4 +19,3 @@ BOM = "\uFEFF"
20
19
  Newline = /\n|\r\n?|\p{Zl}|\p{Zp}/
21
20
  NonAlphanumeric = /\p{^Word}/
22
21
  Spacechar = /\t|\p{Zs}/
23
-