rdoc 8.0.0 → 8.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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +1 -3
  3. data/RI.md +75 -75
  4. data/exe/rdoc +2 -2
  5. data/lib/rdoc/code_object/alias.rb +71 -69
  6. data/lib/rdoc/code_object/any_method.rb +305 -303
  7. data/lib/rdoc/code_object/attr.rb +150 -148
  8. data/lib/rdoc/code_object/class_module.rb +798 -792
  9. data/lib/rdoc/code_object/constant.rb +175 -173
  10. data/lib/rdoc/code_object/context/section.rb +142 -138
  11. data/lib/rdoc/code_object/context.rb +926 -958
  12. data/lib/rdoc/code_object/extend.rb +7 -5
  13. data/lib/rdoc/code_object/include.rb +7 -5
  14. data/lib/rdoc/code_object/method_attr.rb +326 -319
  15. data/lib/rdoc/code_object/mixin.rb +97 -95
  16. data/lib/rdoc/code_object/normal_class.rb +77 -78
  17. data/lib/rdoc/code_object/normal_module.rb +61 -59
  18. data/lib/rdoc/code_object/require.rb +23 -39
  19. data/lib/rdoc/code_object/single_class.rb +21 -19
  20. data/lib/rdoc/code_object/top_level.rb +212 -219
  21. data/lib/rdoc/code_object.rb +305 -303
  22. data/lib/rdoc/comment.rb +275 -273
  23. data/lib/rdoc/cross_reference.rb +192 -190
  24. data/lib/rdoc/encoding.rb +105 -103
  25. data/lib/rdoc/erb_partial.rb +13 -11
  26. data/lib/rdoc/erbio.rb +29 -27
  27. data/lib/rdoc/generator/aliki.rb +161 -153
  28. data/lib/rdoc/generator/darkfish.rb +645 -635
  29. data/lib/rdoc/generator/json_index.rb +233 -229
  30. data/lib/rdoc/generator/markup.rb +164 -146
  31. data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
  32. data/lib/rdoc/generator/pot/po.rb +52 -51
  33. data/lib/rdoc/generator/pot/po_entry.rb +138 -132
  34. data/lib/rdoc/generator/pot.rb +85 -81
  35. data/lib/rdoc/generator/ri.rb +23 -19
  36. data/lib/rdoc/generator/template/aliki/DESIGN.md +6 -4
  37. data/lib/rdoc/generator/template/aliki/_footer.rhtml +1 -1
  38. data/lib/rdoc/generator/template/aliki/_head.rhtml +10 -10
  39. data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
  40. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +4 -4
  41. data/lib/rdoc/generator/template/aliki/css/rdoc.css +207 -178
  42. data/lib/rdoc/generator/template/aliki/js/aliki.js +60 -84
  43. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
  44. data/lib/rdoc/generator.rb +48 -46
  45. data/lib/rdoc/i18n/locale.rb +99 -95
  46. data/lib/rdoc/i18n/text.rb +109 -105
  47. data/lib/rdoc/i18n.rb +7 -5
  48. data/lib/rdoc/markdown/byte_runtime.rb +80 -0
  49. data/lib/rdoc/markdown.kpeg +15 -11
  50. data/lib/rdoc/markdown.rb +40 -47
  51. data/lib/rdoc/markup/block_quote.rb +12 -8
  52. data/lib/rdoc/markup/document.rb +127 -123
  53. data/lib/rdoc/markup/formatter.rb +219 -215
  54. data/lib/rdoc/markup/include.rb +33 -29
  55. data/lib/rdoc/markup/indented_paragraph.rb +37 -33
  56. data/lib/rdoc/markup/inline_parser.rb +281 -277
  57. data/lib/rdoc/markup/list.rb +80 -88
  58. data/lib/rdoc/markup/list_item.rb +73 -85
  59. data/lib/rdoc/markup/paragraph.rb +23 -19
  60. data/lib/rdoc/markup/parser.rb +501 -497
  61. data/lib/rdoc/markup/pre_process.rb +283 -279
  62. data/lib/rdoc/markup/raw.rb +2 -2
  63. data/lib/rdoc/markup/rule.rb +16 -12
  64. data/lib/rdoc/markup/to_ansi.rb +143 -139
  65. data/lib/rdoc/markup/to_bs.rb +72 -68
  66. data/lib/rdoc/markup/to_html.rb +594 -565
  67. data/lib/rdoc/markup/to_html_crossref.rb +234 -230
  68. data/lib/rdoc/markup/to_html_snippet.rb +232 -227
  69. data/lib/rdoc/markup/to_joined_paragraph.rb +36 -32
  70. data/lib/rdoc/markup/to_label.rb +63 -59
  71. data/lib/rdoc/markup/to_markdown.rb +212 -208
  72. data/lib/rdoc/markup/to_rdoc.rb +336 -332
  73. data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
  74. data/lib/rdoc/markup/to_test.rb +60 -56
  75. data/lib/rdoc/markup/to_tt_only.rb +84 -80
  76. data/lib/rdoc/markup/verbatim.rb +62 -58
  77. data/lib/rdoc/markup.rb +198 -196
  78. data/lib/rdoc/options.rb +1063 -1061
  79. data/lib/rdoc/parser/c.rb +1039 -1037
  80. data/lib/rdoc/parser/changelog.rb +319 -315
  81. data/lib/rdoc/parser/markdown.rb +17 -13
  82. data/lib/rdoc/parser/rbs.rb +239 -235
  83. data/lib/rdoc/parser/rd.rb +17 -13
  84. data/lib/rdoc/parser/ruby.rb +1245 -1124
  85. data/lib/rdoc/parser/ruby_colorizer.rb +263 -213
  86. data/lib/rdoc/parser/simple.rb +31 -27
  87. data/lib/rdoc/parser/text.rb +12 -8
  88. data/lib/rdoc/parser.rb +228 -220
  89. data/lib/rdoc/rbs_helper.rb +1 -1
  90. data/lib/rdoc/rd/inline.rb +57 -53
  91. data/lib/rdoc/rd.rb +90 -88
  92. data/lib/rdoc/rdoc.rb +500 -491
  93. data/lib/rdoc/ri/driver.rb +1140 -1135
  94. data/lib/rdoc/ri/formatter.rb +7 -3
  95. data/lib/rdoc/ri/paths.rb +140 -136
  96. data/lib/rdoc/ri/servlet.rb +354 -350
  97. data/lib/rdoc/ri/store.rb +4 -2
  98. data/lib/rdoc/ri/task.rb +55 -51
  99. data/lib/rdoc/ri.rb +14 -12
  100. data/lib/rdoc/rubygems_hook.rb +183 -181
  101. data/lib/rdoc/server.rb +349 -347
  102. data/lib/rdoc/stats/normal.rb +46 -42
  103. data/lib/rdoc/stats/quiet.rb +39 -35
  104. data/lib/rdoc/stats/verbose.rb +35 -31
  105. data/lib/rdoc/stats.rb +365 -363
  106. data/lib/rdoc/store.rb +888 -902
  107. data/lib/rdoc/task.rb +260 -256
  108. data/lib/rdoc/text.rb +135 -133
  109. data/lib/rdoc/token_stream.rb +101 -93
  110. data/lib/rdoc/tom_doc.rb +203 -201
  111. data/lib/rdoc/version.rb +1 -1
  112. metadata +4 -5
  113. data/lib/rdoc/markdown/literals.kpeg +0 -21
  114. data/lib/rdoc/markdown/literals.rb +0 -454
@@ -1,287 +1,292 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # Outputs RDoc markup as paragraphs with inline markup only.
2
+ module RDoc
3
+ class Markup
4
+ ##
5
+ # Outputs RDoc markup as paragraphs with inline markup only.
4
6
 
5
- class RDoc::Markup::ToHtmlSnippet < RDoc::Markup::ToHtml
7
+ class ToHtmlSnippet < Markup::ToHtml
6
8
 
7
- ##
8
- # After this many characters the input will be cut off.
9
+ ##
10
+ # After this many characters the input will be cut off.
9
11
 
10
- attr_reader :character_limit
12
+ attr_reader :character_limit
11
13
 
12
- ##
13
- # The number of characters seen so far.
14
+ ##
15
+ # The number of characters seen so far.
14
16
 
15
- attr_reader :characters # :nodoc:
17
+ attr_reader :characters # :nodoc:
16
18
 
17
- ##
18
- # The attribute bitmask
19
+ ##
20
+ # The attribute bitmask
19
21
 
20
- attr_reader :mask
22
+ attr_reader :mask
21
23
 
22
- ##
23
- # After this many paragraphs the input will be cut off.
24
+ ##
25
+ # After this many paragraphs the input will be cut off.
24
26
 
25
- attr_reader :paragraph_limit
27
+ attr_reader :paragraph_limit
26
28
 
27
- ##
28
- # Count of paragraphs found
29
+ ##
30
+ # Count of paragraphs found
29
31
 
30
- attr_reader :paragraphs
32
+ attr_reader :paragraphs
31
33
 
32
- ##
33
- # Creates a new ToHtmlSnippet formatter that will cut off the input on the
34
- # next word boundary after the given number of +characters+ or +paragraphs+
35
- # of text have been encountered.
34
+ ##
35
+ # Creates a new ToHtmlSnippet formatter that will cut off the input on the
36
+ # next word boundary after the given number of +characters+ or +paragraphs+
37
+ # of text have been encountered.
36
38
 
37
- def initialize(characters = 100, paragraphs = 3)
38
- super()
39
+ def initialize(characters = 100, paragraphs = 3)
40
+ super()
39
41
 
40
- @character_limit = characters
41
- @paragraph_limit = paragraphs
42
+ @character_limit = characters
43
+ @paragraph_limit = paragraphs
42
44
 
43
- @characters = 0
44
- @mask = 0
45
- @paragraphs = 0
45
+ @characters = 0
46
+ @mask = 0
47
+ @paragraphs = 0
46
48
 
47
- @markup.add_regexp_handling RDoc::CrossReference::CROSSREF_REGEXP, :CROSSREF
48
- end
49
+ @markup.add_regexp_handling CrossReference::CROSSREF_REGEXP, :CROSSREF
50
+ end
49
51
 
50
- ##
51
- # Adds +heading+ to the output as a paragraph
52
+ ##
53
+ # Adds +heading+ to the output as a paragraph
52
54
 
53
- def accept_heading(heading)
54
- @res << "<p>#{to_html heading.text}\n"
55
+ def accept_heading(heading)
56
+ @res << "<p>#{to_html heading.text}\n"
55
57
 
56
- add_paragraph
57
- end
58
+ add_paragraph
59
+ end
58
60
 
59
- ##
60
- # Raw sections are untrusted and ignored
61
+ ##
62
+ # Raw sections are untrusted and ignored
61
63
 
62
- alias accept_raw ignore
64
+ alias accept_raw ignore
63
65
 
64
- ##
65
- # Rules are ignored
66
+ ##
67
+ # Rules are ignored
66
68
 
67
- alias accept_rule ignore
69
+ alias accept_rule ignore
68
70
 
69
- ##
70
- # Adds +paragraph+ to the output
71
+ ##
72
+ # Adds +paragraph+ to the output
71
73
 
72
- def accept_paragraph(paragraph)
73
- para = @in_list_entry.last || "<p>"
74
+ def accept_paragraph(paragraph)
75
+ para = @in_list_entry.last || "<p>"
74
76
 
75
- text = paragraph.text @hard_break
77
+ text = paragraph.text @hard_break
76
78
 
77
- @res << "#{para}#{to_html text}\n"
79
+ @res << "#{para}#{to_html text}\n"
78
80
 
79
- add_paragraph
80
- end
81
+ add_paragraph
82
+ end
81
83
 
82
- ##
83
- # Finishes consumption of +list_item+
84
+ ##
85
+ # Finishes consumption of +list_item+
84
86
 
85
- def accept_list_item_end(list_item)
86
- end
87
+ def accept_list_item_end(list_item)
88
+ end
87
89
 
88
- ##
89
- # Prepares the visitor for consuming +list_item+
90
+ ##
91
+ # Prepares the visitor for consuming +list_item+
90
92
 
91
- def accept_list_item_start(list_item)
92
- @res << list_item_start(list_item, @list.last)
93
- end
93
+ def accept_list_item_start(list_item)
94
+ @res << list_item_start(list_item, @list.last)
95
+ end
94
96
 
95
- ##
96
- # Prepares the visitor for consuming +list+
97
+ ##
98
+ # Prepares the visitor for consuming +list+
97
99
 
98
- def accept_list_start(list)
99
- @list << list.type
100
- @res << html_list_name(list.type, true)
101
- @in_list_entry.push ''
102
- end
100
+ def accept_list_start(list)
101
+ @list << list.type
102
+ @res << html_list_name(list.type, true)
103
+ @in_list_entry.push ''
104
+ end
103
105
 
104
- ##
105
- # Adds +verbatim+ to the output
106
+ ##
107
+ # Adds +verbatim+ to the output
106
108
 
107
- def accept_verbatim(verbatim)
108
- throw :done if @characters >= @character_limit
109
- input = verbatim.text.rstrip
110
- text = truncate(input, @character_limit - @characters)
111
- @characters += input.length
112
- text << " #{TO_HTML_CHARACTERS[text.encoding][:ellipsis]}" unless text == input
109
+ def accept_verbatim(verbatim)
110
+ throw :done if @characters >= @character_limit
111
+ input = verbatim.text.rstrip
112
+ text = truncate(input, @character_limit - @characters)
113
+ @characters += input.length
114
+ text << " #{TO_HTML_CHARACTERS[text.encoding][:ellipsis]}" unless text == input
113
115
 
114
- super RDoc::Markup::Verbatim.new text
116
+ super Markup::Verbatim.new text
115
117
 
116
- add_paragraph
117
- end
118
+ add_paragraph
119
+ end
118
120
 
119
- ##
120
- # Prepares the visitor for HTML snippet generation
121
+ ##
122
+ # Prepares the visitor for HTML snippet generation
121
123
 
122
- def start_accepting
123
- super
124
+ def start_accepting
125
+ super
124
126
 
125
- @characters = 0
126
- end
127
-
128
- ##
129
- # Removes escaping from the cross-references in +target+
127
+ @characters = 0
128
+ end
130
129
 
131
- def handle_regexp_CROSSREF(text)
132
- text.sub(/\A\\/, '')
133
- end
130
+ ##
131
+ # Removes escaping from the cross-references in +target+ and escapes HTML
132
+ # characters, since snippets don't link cross-references.
134
133
 
135
- ##
136
- # Lists are paragraphs, but notes and labels have a separator
134
+ def handle_regexp_CROSSREF(text)
135
+ convert_string(text.delete_prefix('\\'))
136
+ end
137
137
 
138
- def list_item_start(list_item, list_type)
139
- throw :done if @characters >= @character_limit
138
+ ##
139
+ # Lists are paragraphs, but notes and labels have a separator
140
140
 
141
- case list_type
142
- when :BULLET, :LALPHA, :NUMBER, :UALPHA then
143
- "<p>"
144
- when :LABEL, :NOTE then
145
- labels = Array(list_item.label).map do |label|
146
- to_html label
147
- end.join ', '
141
+ def list_item_start(list_item, list_type)
142
+ throw :done if @characters >= @character_limit
148
143
 
149
- labels << " &mdash; " unless labels.empty?
144
+ case list_type
145
+ when :BULLET, :LALPHA, :NUMBER, :UALPHA
146
+ "<p>"
147
+ when :LABEL, :NOTE
148
+ labels = Array(list_item.label).map do |label|
149
+ to_html label
150
+ end.join ', '
150
151
 
151
- start = "<p>#{labels}"
152
- @characters += 1 # try to include the label
153
- start
154
- else
155
- raise RDoc::Error, "Invalid list type: #{list_type.inspect}"
156
- end
157
- end
152
+ labels << " &mdash; " unless labels.empty?
158
153
 
159
- ##
160
- # Returns just the text of +link+, +url+ is only used to determine the link
161
- # type.
162
-
163
- def gen_url(url, text)
164
- if url =~ /^rdoc-label:([^:]*)(?::(.*))?/ then
165
- type = "link"
166
- elsif url =~ /([A-Za-z]+):(.*)/ then
167
- type = $1
168
- else
169
- type = "http"
170
- end
154
+ start = "<p>#{labels}"
155
+ @characters += 1 # try to include the label
156
+ start
157
+ else
158
+ raise Error, "Invalid list type: #{list_type.inspect}"
159
+ end
160
+ end
171
161
 
172
- if (type == "http" or type == "https" or type == "link") and
173
- url =~ /\.(gif|png|jpg|jpeg|bmp)$/ then
174
- ''
175
- else
176
- text.sub(%r%^#{type}:/*%, '')
177
- end
178
- end
162
+ ##
163
+ # Returns just the text of +link+, +url+ is only used to determine the link
164
+ # type.
179
165
 
180
- ##
181
- # In snippets, there are no lists
166
+ def gen_url(url, text)
167
+ if url =~ /^rdoc-label:([^:]*)(?::(.*))?/
168
+ type = "link"
169
+ elsif url =~ /([A-Za-z]+):(.*)/
170
+ type = $1
171
+ else
172
+ type = "http"
173
+ end
174
+
175
+ if (type == "http" or type == "https" or type == "link") and
176
+ url =~ /\.(gif|png|jpg|jpeg|bmp)$/
177
+ ''
178
+ else
179
+ text.sub(%r%^#{type}:/*%, '')
180
+ end
181
+ end
182
+
183
+ ##
184
+ # In snippets, there are no lists
185
+
186
+ def html_list_name(list_type, open_tag)
187
+ ''
188
+ end
189
+
190
+ ##
191
+ # Throws +:done+ when paragraph_limit paragraphs have been encountered
192
+
193
+ def add_paragraph
194
+ @paragraphs += 1
195
+
196
+ throw :done if @paragraphs >= @paragraph_limit
197
+ end
198
+
199
+ ##
200
+ # Marks up +content+
201
+
202
+ def convert(content)
203
+ catch :done do
204
+ return super
205
+ end
206
+
207
+ end_accepting
208
+ end
209
+
210
+ def handle_PLAIN_TEXT(text) # :nodoc:
211
+ return if inline_limit_reached?
212
+
213
+ truncated = truncate(text, @inline_character_limit)
214
+ @inline_character_limit -= text.size
215
+ emit_inline(convert_string(truncated))
216
+ end
217
+
218
+ def handle_REGEXP_HANDLING_TEXT(text) # :nodoc:
219
+ return if inline_limit_reached?
220
+
221
+ # We can't truncate text including html tags.
222
+ # Just emit as is, and count all characters including html tag part.
223
+ emit_inline(text)
224
+ @inline_character_limit -= text.size
225
+ end
226
+
227
+ def handle_BOLD(nodes)
228
+ super unless inline_limit_reached?
229
+ end
230
+
231
+ def handle_BOLD_WORD(word)
232
+ super unless inline_limit_reached?
233
+ end
234
+
235
+ def handle_EM(nodes)
236
+ super unless inline_limit_reached?
237
+ end
238
+
239
+ def handle_EM_WORD(word)
240
+ super unless inline_limit_reached?
241
+ end
242
+
243
+ def handle_TT(code)
244
+ super unless inline_limit_reached?
245
+ end
246
+
247
+ def handle_STRIKE(nodes)
248
+ super unless inline_limit_reached?
249
+ end
250
+
251
+ def handle_HARD_BREAK
252
+ super unless inline_limit_reached?
253
+ end
254
+
255
+ def handle_TIDYLINK(label_part, url)
256
+ traverse_inline_nodes(label_part) unless inline_limit_reached?
257
+ end
258
+
259
+ def inline_limit_reached?
260
+ @inline_character_limit <= 0
261
+ end
262
+
263
+ def handle_inline(text)
264
+ limit = @character_limit - @characters
265
+ return ['', 0] if limit <= 0
266
+ @inline_character_limit = limit
267
+ res = super
268
+ res << " #{TO_HTML_CHARACTERS[text.encoding][:ellipsis]}" if @inline_character_limit <= 0
269
+ @characters += limit - @inline_character_limit
270
+ res
271
+ end
182
272
 
183
- def html_list_name(list_type, open_tag)
184
- ''
185
- end
273
+ def to_html(item)
274
+ throw :done if @characters >= @character_limit
275
+ handle_inline(item)
276
+ end
186
277
 
187
- ##
188
- # Throws +:done+ when paragraph_limit paragraphs have been encountered
278
+ ##
279
+ # Truncates +text+ at the end of the first word after the limit.
189
280
 
190
- def add_paragraph
191
- @paragraphs += 1
281
+ def truncate(text, limit)
282
+ return text if limit >= text.size
283
+ return '' if limit <= 0
192
284
 
193
- throw :done if @paragraphs >= @paragraph_limit
194
- end
285
+ text =~ /\A(.{#{limit},}?)(\s|$)/m # TODO word-break instead of \s?
195
286
 
196
- ##
197
- # Marks up +content+
287
+ $1
288
+ end
198
289
 
199
- def convert(content)
200
- catch :done do
201
- return super
202
290
  end
203
-
204
- end_accepting
205
- end
206
-
207
- def handle_PLAIN_TEXT(text) # :nodoc:
208
- return if inline_limit_reached?
209
-
210
- truncated = truncate(text, @inline_character_limit)
211
- @inline_character_limit -= text.size
212
- emit_inline(convert_string(truncated))
213
- end
214
-
215
- def handle_REGEXP_HANDLING_TEXT(text) # :nodoc:
216
- return if inline_limit_reached?
217
-
218
- # We can't truncate text including html tags.
219
- # Just emit as is, and count all characters including html tag part.
220
- emit_inline(text)
221
- @inline_character_limit -= text.size
222
- end
223
-
224
- def handle_BOLD(nodes)
225
- super unless inline_limit_reached?
226
291
  end
227
-
228
- def handle_BOLD_WORD(word)
229
- super unless inline_limit_reached?
230
- end
231
-
232
- def handle_EM(nodes)
233
- super unless inline_limit_reached?
234
- end
235
-
236
- def handle_EM_WORD(word)
237
- super unless inline_limit_reached?
238
- end
239
-
240
- def handle_TT(code)
241
- super unless inline_limit_reached?
242
- end
243
-
244
- def handle_STRIKE(nodes)
245
- super unless inline_limit_reached?
246
- end
247
-
248
- def handle_HARD_BREAK
249
- super unless inline_limit_reached?
250
- end
251
-
252
- def handle_TIDYLINK(label_part, url)
253
- traverse_inline_nodes(label_part) unless inline_limit_reached?
254
- end
255
-
256
- def inline_limit_reached?
257
- @inline_character_limit <= 0
258
- end
259
-
260
- def handle_inline(text)
261
- limit = @character_limit - @characters
262
- return ['', 0] if limit <= 0
263
- @inline_character_limit = limit
264
- res = super
265
- res << " #{TO_HTML_CHARACTERS[text.encoding][:ellipsis]}" if @inline_character_limit <= 0
266
- @characters += limit - @inline_character_limit
267
- res
268
- end
269
-
270
- def to_html(item)
271
- throw :done if @characters >= @character_limit
272
- handle_inline(item)
273
- end
274
-
275
- ##
276
- # Truncates +text+ at the end of the first word after the limit.
277
-
278
- def truncate(text, limit)
279
- return text if limit >= text.size
280
- return '' if limit <= 0
281
-
282
- text =~ /\A(.{#{limit},}?)(\s|$)/m # TODO word-break instead of \s?
283
-
284
- $1
285
- end
286
-
287
292
  end
@@ -1,41 +1,45 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # Joins the parts of an RDoc::Markup::Paragraph into a single String.
4
- #
5
- # This allows for easier maintenance and testing of Markdown support.
6
- #
7
- # This formatter only works on Paragraph instances. Attempting to process
8
- # other markup syntax items will not work.
2
+ module RDoc
3
+ class Markup
4
+ ##
5
+ # Joins the parts of an RDoc::Markup::Paragraph into a single String.
6
+ #
7
+ # This allows for easier maintenance and testing of Markdown support.
8
+ #
9
+ # This formatter only works on Paragraph instances. Attempting to process
10
+ # other markup syntax items will not work.
9
11
 
10
- class RDoc::Markup::ToJoinedParagraph < RDoc::Markup::Formatter
11
- def start_accepting # :nodoc:
12
- end
12
+ class ToJoinedParagraph < Markup::Formatter
13
+ def start_accepting # :nodoc:
14
+ end
13
15
 
14
- def end_accepting # :nodoc:
15
- end
16
+ def end_accepting # :nodoc:
17
+ end
16
18
 
17
- ##
18
- # Converts the parts of +paragraph+ to a single entry.
19
+ ##
20
+ # Converts the parts of +paragraph+ to a single entry.
19
21
 
20
- def accept_paragraph(paragraph)
21
- parts = paragraph.parts.chunk do |part|
22
- String === part
23
- end.flat_map do |string, chunk|
24
- string ? chunk.join.rstrip : chunk
25
- end
22
+ def accept_paragraph(paragraph)
23
+ parts = paragraph.parts.chunk do |part|
24
+ String === part
25
+ end.flat_map do |string, chunk|
26
+ string ? chunk.join.rstrip : chunk
27
+ end
26
28
 
27
- paragraph.parts.replace parts
28
- end
29
+ paragraph.parts.replace parts
30
+ end
29
31
 
30
- alias accept_block_quote ignore
31
- alias accept_heading ignore
32
- alias accept_list_end ignore
33
- alias accept_list_item_end ignore
34
- alias accept_list_item_start ignore
35
- alias accept_list_start ignore
36
- alias accept_raw ignore
37
- alias accept_rule ignore
38
- alias accept_verbatim ignore
39
- alias accept_table ignore
32
+ alias accept_block_quote ignore
33
+ alias accept_heading ignore
34
+ alias accept_list_end ignore
35
+ alias accept_list_item_end ignore
36
+ alias accept_list_item_start ignore
37
+ alias accept_list_start ignore
38
+ alias accept_raw ignore
39
+ alias accept_rule ignore
40
+ alias accept_verbatim ignore
41
+ alias accept_table ignore
40
42
 
43
+ end
44
+ end
41
45
  end