rdoc 7.2.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 (150) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +4 -7
  3. data/LICENSE.rdoc +4 -0
  4. data/README.md +43 -2
  5. data/RI.md +75 -75
  6. data/doc/markup_reference/markdown.md +104 -3
  7. data/exe/rdoc +2 -2
  8. data/lib/rdoc/code_object/alias.rb +70 -74
  9. data/lib/rdoc/code_object/any_method.rb +305 -298
  10. data/lib/rdoc/code_object/attr.rb +150 -143
  11. data/lib/rdoc/code_object/class_module.rb +801 -765
  12. data/lib/rdoc/code_object/constant.rb +178 -150
  13. data/lib/rdoc/code_object/context/section.rb +133 -160
  14. data/lib/rdoc/code_object/context.rb +925 -952
  15. data/lib/rdoc/code_object/extend.rb +7 -5
  16. data/lib/rdoc/code_object/include.rb +7 -5
  17. data/lib/rdoc/code_object/method_attr.rb +325 -324
  18. data/lib/rdoc/code_object/mixin.rb +97 -95
  19. data/lib/rdoc/code_object/normal_class.rb +77 -78
  20. data/lib/rdoc/code_object/normal_module.rb +61 -59
  21. data/lib/rdoc/code_object/require.rb +23 -39
  22. data/lib/rdoc/code_object/single_class.rb +21 -19
  23. data/lib/rdoc/code_object/top_level.rb +212 -213
  24. data/lib/rdoc/code_object.rb +305 -305
  25. data/lib/rdoc/comment.rb +274 -337
  26. data/lib/rdoc/cross_reference.rb +194 -212
  27. data/lib/rdoc/encoding.rb +105 -103
  28. data/lib/rdoc/erb_partial.rb +13 -11
  29. data/lib/rdoc/erbio.rb +29 -27
  30. data/lib/rdoc/generator/aliki.rb +165 -140
  31. data/lib/rdoc/generator/darkfish.rb +647 -631
  32. data/lib/rdoc/generator/json_index.rb +233 -229
  33. data/lib/rdoc/generator/markup.rb +165 -122
  34. data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
  35. data/lib/rdoc/generator/pot/po.rb +52 -51
  36. data/lib/rdoc/generator/pot/po_entry.rb +138 -132
  37. data/lib/rdoc/generator/pot.rb +85 -81
  38. data/lib/rdoc/generator/ri.rb +23 -19
  39. data/lib/rdoc/generator/template/aliki/DESIGN.md +538 -0
  40. data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +1 -1
  41. data/lib/rdoc/generator/template/aliki/_footer.rhtml +1 -1
  42. data/lib/rdoc/generator/template/aliki/_head.rhtml +11 -11
  43. data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
  44. data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +8 -6
  45. data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +8 -6
  46. data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +1 -1
  47. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +2 -2
  48. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +4 -4
  49. data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +1 -1
  50. data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +1 -1
  51. data/lib/rdoc/generator/template/aliki/class.rhtml +56 -46
  52. data/lib/rdoc/generator/template/aliki/css/rdoc.css +538 -283
  53. data/lib/rdoc/generator/template/aliki/index.rhtml +1 -1
  54. data/lib/rdoc/generator/template/aliki/js/aliki.js +80 -102
  55. data/lib/rdoc/generator/template/aliki/page.rhtml +1 -1
  56. data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +1 -1
  57. data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +2 -2
  58. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
  59. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +8 -6
  60. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +8 -6
  61. data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +1 -1
  62. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +1 -1
  63. data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +1 -1
  64. data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +5 -5
  65. data/lib/rdoc/generator/template/darkfish/class.rhtml +18 -21
  66. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +0 -1
  67. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +3 -3
  68. data/lib/rdoc/generator.rb +48 -46
  69. data/lib/rdoc/i18n/locale.rb +99 -95
  70. data/lib/rdoc/i18n/text.rb +109 -105
  71. data/lib/rdoc/i18n.rb +7 -5
  72. data/lib/rdoc/markdown/byte_runtime.rb +80 -0
  73. data/lib/rdoc/markdown.kpeg +30 -21
  74. data/lib/rdoc/markdown.rb +329 -151
  75. data/lib/rdoc/markup/block_quote.rb +12 -8
  76. data/lib/rdoc/markup/document.rb +127 -123
  77. data/lib/rdoc/markup/formatter.rb +215 -221
  78. data/lib/rdoc/markup/heading.rb +1 -4
  79. data/lib/rdoc/markup/include.rb +33 -29
  80. data/lib/rdoc/markup/indented_paragraph.rb +37 -33
  81. data/lib/rdoc/markup/inline_parser.rb +281 -277
  82. data/lib/rdoc/markup/list.rb +80 -88
  83. data/lib/rdoc/markup/list_item.rb +73 -85
  84. data/lib/rdoc/markup/paragraph.rb +23 -19
  85. data/lib/rdoc/markup/parser.rb +501 -497
  86. data/lib/rdoc/markup/pre_process.rb +284 -305
  87. data/lib/rdoc/markup/raw.rb +2 -2
  88. data/lib/rdoc/markup/rule.rb +16 -12
  89. data/lib/rdoc/markup/to_ansi.rb +143 -139
  90. data/lib/rdoc/markup/to_bs.rb +72 -68
  91. data/lib/rdoc/markup/to_html.rb +600 -493
  92. data/lib/rdoc/markup/to_html_crossref.rb +221 -191
  93. data/lib/rdoc/markup/to_html_snippet.rb +232 -227
  94. data/lib/rdoc/markup/to_joined_paragraph.rb +40 -41
  95. data/lib/rdoc/markup/to_label.rb +63 -59
  96. data/lib/rdoc/markup/to_markdown.rb +212 -208
  97. data/lib/rdoc/markup/to_rdoc.rb +336 -332
  98. data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
  99. data/lib/rdoc/markup/to_test.rb +60 -56
  100. data/lib/rdoc/markup/to_tt_only.rb +83 -86
  101. data/lib/rdoc/markup/verbatim.rb +62 -58
  102. data/lib/rdoc/markup.rb +198 -196
  103. data/lib/rdoc/options.rb +1063 -1076
  104. data/lib/rdoc/parser/c.rb +1039 -1036
  105. data/lib/rdoc/parser/changelog.rb +319 -315
  106. data/lib/rdoc/parser/markdown.rb +17 -13
  107. data/lib/rdoc/parser/rbs.rb +279 -0
  108. data/lib/rdoc/parser/rd.rb +17 -13
  109. data/lib/rdoc/parser/ruby.rb +1231 -2222
  110. data/lib/rdoc/parser/ruby_colorizer.rb +303 -0
  111. data/lib/rdoc/parser/simple.rb +31 -27
  112. data/lib/rdoc/parser/text.rb +12 -8
  113. data/lib/rdoc/parser.rb +230 -221
  114. data/lib/rdoc/rbs_helper.rb +186 -0
  115. data/lib/rdoc/rd/inline.rb +57 -53
  116. data/lib/rdoc/rd.rb +90 -88
  117. data/lib/rdoc/rdoc.rb +547 -366
  118. data/lib/rdoc/ri/driver.rb +1141 -1130
  119. data/lib/rdoc/ri/formatter.rb +7 -3
  120. data/lib/rdoc/ri/paths.rb +140 -136
  121. data/lib/rdoc/ri/servlet.rb +456 -0
  122. data/lib/rdoc/ri/store.rb +4 -2
  123. data/lib/rdoc/ri/task.rb +55 -51
  124. data/lib/rdoc/ri.rb +14 -11
  125. data/lib/rdoc/rubygems_hook.rb +194 -192
  126. data/lib/rdoc/server.rb +462 -0
  127. data/lib/rdoc/stats/normal.rb +46 -42
  128. data/lib/rdoc/stats/quiet.rb +39 -35
  129. data/lib/rdoc/stats/verbose.rb +35 -31
  130. data/lib/rdoc/stats.rb +363 -338
  131. data/lib/rdoc/store.rb +919 -725
  132. data/lib/rdoc/task.rb +260 -255
  133. data/lib/rdoc/text.rb +130 -245
  134. data/lib/rdoc/token_stream.rb +101 -115
  135. data/lib/rdoc/tom_doc.rb +203 -201
  136. data/lib/rdoc/version.rb +1 -1
  137. data/lib/rdoc.rb +35 -7
  138. data/lib/rubygems_plugin.rb +2 -11
  139. data/rdoc-logo.svg +43 -0
  140. data/rdoc.gemspec +6 -4
  141. metadata +36 -20
  142. data/lib/rdoc/code_object/anon_class.rb +0 -10
  143. data/lib/rdoc/code_object/ghost_method.rb +0 -6
  144. data/lib/rdoc/code_object/meta_method.rb +0 -6
  145. data/lib/rdoc/markdown/literals.kpeg +0 -21
  146. data/lib/rdoc/markdown/literals.rb +0 -454
  147. data/lib/rdoc/parser/prism_ruby.rb +0 -1112
  148. data/lib/rdoc/parser/ripper_state_lex.rb +0 -302
  149. data/lib/rdoc/parser/ruby_tools.rb +0 -163
  150. data/lib/rdoc/servlet.rb +0 -452
data/lib/rdoc/markup.rb CHANGED
@@ -1,127 +1,128 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # RDoc::Markup parses plain text documents and attempts to decompose them into
4
- # their constituent parts. Some of these parts are high-level: paragraphs,
5
- # chunks of verbatim text, list entries and the like. Other parts happen at
6
- # the character level: a piece of bold text, a word in code font. This markup
7
- # is similar in spirit to that used on WikiWiki webs, where folks create web
8
- # pages using a simple set of formatting rules.
9
- #
10
- # RDoc::Markup and other markup formats do no output formatting, this is
11
- # handled by the RDoc::Markup::Formatter subclasses.
12
- #
13
- # = Markup Formats
14
- #
15
- # +RDoc+ supports these markup formats:
16
- #
17
- # - +rdoc+:
18
- # the +RDoc+ markup format;
19
- # see {RDoc Markup Reference}[rdoc-ref:doc/markup_reference/rdoc.rdoc]
20
- # - +markdown+:
21
- # The +markdown+ markup format as described in
22
- # the {Markdown Guide}[https://www.markdownguide.org];
23
- # see RDoc::Markdown.
24
- # - +rd+:
25
- # the +rd+ markup format format;
26
- # see RDoc::RD.
27
- # - +tomdoc+:
28
- # the TomDoc format as described in
29
- # {TomDoc for Ruby}[http://tomdoc.org];
30
- # see RDoc::TomDoc.
31
- #
32
- # You can choose a markup format using the following methods:
33
- #
34
- # per project::
35
- # If you build your documentation with rake use RDoc::Task#markup.
36
- #
37
- # If you build your documentation by hand run:
38
- #
39
- # rdoc --markup your_favorite_format --write-options
40
- #
41
- # and commit <tt>.rdoc_options</tt> and ship it with your packaged gem.
42
- # per file::
43
- # At the top of the file use the <tt>:markup:</tt> directive to set the
44
- # default format for the rest of the file.
45
- # per comment::
46
- # Use the <tt>:markup:</tt> directive at the top of a comment you want
47
- # to write in a different format.
48
- #
49
- # = RDoc::Markup
50
- #
51
- # RDoc::Markup is extensible at runtime: you can add \new markup elements to
52
- # be recognized in the documents that RDoc::Markup parses.
53
- #
54
- # RDoc::Markup is intended to be the basis for a family of tools which share
55
- # the common requirement that simple, plain-text should be rendered in a
56
- # variety of different output formats and media. It is envisaged that
57
- # RDoc::Markup could be the basis for formatting RDoc style comment blocks,
58
- # Wiki entries, and online FAQs.
59
- #
60
- # == Synopsis
61
- #
62
- # This code converts +input_string+ to HTML. The conversion takes place in
63
- # the +convert+ method, so you can use the same RDoc::Markup converter to
64
- # convert multiple input strings.
65
- #
66
- # require 'rdoc'
67
- #
68
- # h = RDoc::Markup::ToHtml.new(RDoc::Options.new)
69
- #
70
- # puts h.convert(input_string)
71
- #
72
- # You can extend the RDoc::Markup parser to recognize new markup
73
- # sequences, and to add regexp handling. Here we make WikiWords significant to
74
- # the parser, and also make the sequences {word} and \<no>text...</no> signify
75
- # strike-through text. We then subclass the HTML output class to deal
76
- # with these:
77
- #
78
- # require 'rdoc'
79
- #
80
- # class WikiHtml < RDoc::Markup::ToHtml
81
- # def handle_regexp_WIKIWORD(target)
82
- # "<font color=red>" + target + "</font>"
83
- # end
84
- # end
85
- #
86
- # markup = RDoc::Markup.new
87
- # markup.add_word_pair("{", "}", :STRIKE)
88
- # markup.add_html("no", :STRIKE)
89
- #
90
- # markup.add_regexp_handling(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
91
- #
92
- # wh = WikiHtml.new RDoc::Options.new, markup
93
- # wh.add_tag(:STRIKE, "<strike>", "</strike>")
94
- #
95
- # puts "<body>#{wh.convert ARGF.read}</body>"
96
- #
97
- # == Encoding
98
- #
99
- # Where Encoding support is available, RDoc will automatically convert all
100
- # documents to the same output encoding. The output encoding can be set via
101
- # RDoc::Options#encoding and defaults to Encoding.default_external.
102
- #
103
- # = \RDoc Markup Reference
104
- #
105
- # See {RDoc Markup Reference}[rdoc-ref:doc/markup_reference/rdoc.rdoc]
106
- #
107
- #--
108
- # Original Author:: Dave Thomas, dave@pragmaticprogrammer.com
109
- # License:: Ruby license
110
-
111
- class RDoc::Markup
112
-
113
- # Array of regexp handling pattern and its name. A regexp handling
114
- # sequence is something like a WikiWord
115
-
116
- attr_reader :regexp_handlings
117
-
2
+ module RDoc
118
3
  ##
119
- # Parses +str+ into an RDoc::Markup::Document.
4
+ # RDoc::Markup parses plain text documents and attempts to decompose them into
5
+ # their constituent parts. Some of these parts are high-level: paragraphs,
6
+ # chunks of verbatim text, list entries and the like. Other parts happen at
7
+ # the character level: a piece of bold text, a word in code font. This markup
8
+ # is similar in spirit to that used on WikiWiki webs, where folks create web
9
+ # pages using a simple set of formatting rules.
10
+ #
11
+ # RDoc::Markup and other markup formats do no output formatting, this is
12
+ # handled by the RDoc::Markup::Formatter subclasses.
13
+ #
14
+ # = Markup Formats
15
+ #
16
+ # +RDoc+ supports these markup formats:
17
+ #
18
+ # - +rdoc+:
19
+ # the +RDoc+ markup format;
20
+ # see {RDoc Markup Reference}[rdoc-ref:doc/markup_reference/rdoc.rdoc]
21
+ # - +markdown+:
22
+ # The +markdown+ markup format as described in
23
+ # the {Markdown Guide}[https://www.markdownguide.org];
24
+ # see RDoc::Markdown.
25
+ # - +rd+:
26
+ # the +rd+ markup format format;
27
+ # see RDoc::RD.
28
+ # - +tomdoc+:
29
+ # the TomDoc format as described in
30
+ # {TomDoc for Ruby}[http://tomdoc.org];
31
+ # see RDoc::TomDoc.
32
+ #
33
+ # You can choose a markup format using the following methods:
34
+ #
35
+ # per project::
36
+ # If you build your documentation with rake use RDoc::Task#markup.
37
+ #
38
+ # If you build your documentation by hand run:
39
+ #
40
+ # rdoc --markup your_favorite_format --write-options
41
+ #
42
+ # and commit <tt>.rdoc_options</tt> and ship it with your packaged gem.
43
+ # per file::
44
+ # At the top of the file use the <tt>:markup:</tt> directive to set the
45
+ # default format for the rest of the file.
46
+ # per comment::
47
+ # Use the <tt>:markup:</tt> directive at the top of a comment you want
48
+ # to write in a different format.
49
+ #
50
+ # = RDoc::Markup
51
+ #
52
+ # RDoc::Markup is extensible at runtime: you can add \new markup elements to
53
+ # be recognized in the documents that RDoc::Markup parses.
54
+ #
55
+ # RDoc::Markup is intended to be the basis for a family of tools which share
56
+ # the common requirement that simple, plain-text should be rendered in a
57
+ # variety of different output formats and media. It is envisaged that
58
+ # RDoc::Markup could be the basis for formatting RDoc style comment blocks,
59
+ # Wiki entries, and online FAQs.
60
+ #
61
+ # == Synopsis
62
+ #
63
+ # This code converts +input_string+ to HTML. The conversion takes place in
64
+ # the +convert+ method, so you can use the same RDoc::Markup converter to
65
+ # convert multiple input strings.
66
+ #
67
+ # require 'rdoc'
68
+ #
69
+ # h = RDoc::Markup::ToHtml.new(RDoc::Options.new)
70
+ #
71
+ # puts h.convert(input_string)
72
+ #
73
+ # You can extend the RDoc::Markup parser to recognize new markup
74
+ # sequences, and to add regexp handling. Here we make WikiWords significant to
75
+ # the parser, and also make the sequences {word} and \<no>text...</no> signify
76
+ # strike-through text. We then subclass the HTML output class to deal
77
+ # with these:
78
+ #
79
+ # require 'rdoc'
80
+ #
81
+ # class WikiHtml < RDoc::Markup::ToHtml
82
+ # def handle_regexp_WIKIWORD(target)
83
+ # "<font color=red>" + target + "</font>"
84
+ # end
85
+ # end
86
+ #
87
+ # markup = RDoc::Markup.new
88
+ # markup.add_word_pair("{", "}", :STRIKE)
89
+ # markup.add_html("no", :STRIKE)
90
+ #
91
+ # markup.add_regexp_handling(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
92
+ #
93
+ # wh = WikiHtml.new RDoc::Options.new, markup
94
+ # wh.add_tag(:STRIKE, "<strike>", "</strike>")
95
+ #
96
+ # puts "<body>#{wh.convert ARGF.read}</body>"
97
+ #
98
+ # == Encoding
99
+ #
100
+ # Where Encoding support is available, RDoc will automatically convert all
101
+ # documents to the same output encoding. The output encoding can be set via
102
+ # RDoc::Options#encoding and defaults to Encoding.default_external.
103
+ #
104
+ # = \RDoc Markup Reference
105
+ #
106
+ # See {RDoc Markup Reference}[rdoc-ref:doc/markup_reference/rdoc.rdoc]
107
+ #
108
+ #--
109
+ # Original Author:: Dave Thomas, dave@pragmaticprogrammer.com
110
+ # License:: Ruby license
120
111
 
121
- def self.parse(str)
122
- RDoc::Markup::Parser.parse str
123
- rescue RDoc::Markup::Parser::Error => e
124
- $stderr.puts <<-EOF
112
+ class Markup
113
+
114
+ # Array of regexp handling pattern and its name. A regexp handling
115
+ # sequence is something like a WikiWord
116
+
117
+ attr_reader :regexp_handlings
118
+
119
+ ##
120
+ # Parses +str+ into an RDoc::Markup::Document.
121
+
122
+ def self.parse(str)
123
+ Markup::Parser.parse str
124
+ rescue Markup::Parser::Error => e
125
+ $stderr.puts <<-EOF
125
126
  While parsing markup, RDoc encountered a #{e.class}:
126
127
 
127
128
  #{e}
@@ -131,7 +132,7 @@ While parsing markup, RDoc encountered a #{e.class}:
131
132
  #{text}
132
133
  ---8<---
133
134
 
134
- RDoc #{RDoc::VERSION}
135
+ RDoc #{VERSION}
135
136
 
136
137
  Ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} #{RUBY_RELEASE_DATE}
137
138
 
@@ -140,80 +141,81 @@ Please file a bug report with the above information at:
140
141
  https://github.com/ruby/rdoc/issues
141
142
 
142
143
  EOF
143
- raise
144
- end
145
-
146
- ##
147
- # Take a block of text and use various heuristics to determine its
148
- # structure (paragraphs, lists, and so on). Invoke an event handler as we
149
- # identify significant chunks.
150
-
151
- def initialize
152
- @regexp_handlings = []
153
- @output = nil
154
- end
155
-
156
- ##
157
- # Add to other inline sequences. For example, we could add WikiWords using
158
- # something like:
159
- #
160
- # parser.add_regexp_handling(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
161
- #
162
- # Each wiki word will be presented to the output formatter.
163
-
164
- def add_regexp_handling(pattern, name)
165
- @regexp_handlings << [pattern, name]
166
- end
144
+ raise
145
+ end
146
+
147
+ ##
148
+ # Take a block of text and use various heuristics to determine its
149
+ # structure (paragraphs, lists, and so on). Invoke an event handler as we
150
+ # identify significant chunks.
151
+
152
+ def initialize
153
+ @regexp_handlings = []
154
+ @output = nil
155
+ end
156
+
157
+ ##
158
+ # Add to other inline sequences. For example, we could add WikiWords using
159
+ # something like:
160
+ #
161
+ # parser.add_regexp_handling(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
162
+ #
163
+ # Each wiki word will be presented to the output formatter.
164
+
165
+ def add_regexp_handling(pattern, name)
166
+ @regexp_handlings << [pattern, name]
167
+ end
168
+
169
+ ##
170
+ # We take +input+, parse it if necessary, then invoke the output +formatter+
171
+ # using a Visitor to render the result.
172
+
173
+ def convert(input, formatter)
174
+ document = case input
175
+ when Markup::Document
176
+ input
177
+ else
178
+ Markup::Parser.parse input
179
+ end
180
+
181
+ document.accept formatter
182
+ end
183
+
184
+ autoload :Parser, "#{__dir__}/markup/parser"
185
+ autoload :InlineParser, "#{__dir__}/markup/inline_parser"
186
+ autoload :PreProcess, "#{__dir__}/markup/pre_process"
187
+
188
+ # RDoc::Markup AST
189
+ autoload :BlankLine, "#{__dir__}/markup/blank_line"
190
+ autoload :BlockQuote, "#{__dir__}/markup/block_quote"
191
+ autoload :Document, "#{__dir__}/markup/document"
192
+ autoload :Element, "#{__dir__}/markup/element"
193
+ autoload :HardBreak, "#{__dir__}/markup/hard_break"
194
+ autoload :Heading, "#{__dir__}/markup/heading"
195
+ autoload :Include, "#{__dir__}/markup/include"
196
+ autoload :IndentedParagraph, "#{__dir__}/markup/indented_paragraph"
197
+ autoload :List, "#{__dir__}/markup/list"
198
+ autoload :ListItem, "#{__dir__}/markup/list_item"
199
+ autoload :Paragraph, "#{__dir__}/markup/paragraph"
200
+ autoload :Table, "#{__dir__}/markup/table"
201
+ autoload :Raw, "#{__dir__}/markup/raw"
202
+ autoload :Rule, "#{__dir__}/markup/rule"
203
+ autoload :Verbatim, "#{__dir__}/markup/verbatim"
204
+
205
+ # Formatters
206
+ autoload :Formatter, "#{__dir__}/markup/formatter"
207
+
208
+ autoload :ToAnsi, "#{__dir__}/markup/to_ansi"
209
+ autoload :ToBs, "#{__dir__}/markup/to_bs"
210
+ autoload :ToHtml, "#{__dir__}/markup/to_html"
211
+ autoload :ToHtmlCrossref, "#{__dir__}/markup/to_html_crossref"
212
+ autoload :ToHtmlSnippet, "#{__dir__}/markup/to_html_snippet"
213
+ autoload :ToLabel, "#{__dir__}/markup/to_label"
214
+ autoload :ToMarkdown, "#{__dir__}/markup/to_markdown"
215
+ autoload :ToRdoc, "#{__dir__}/markup/to_rdoc"
216
+ autoload :ToTableOfContents, "#{__dir__}/markup/to_table_of_contents"
217
+ autoload :ToTest, "#{__dir__}/markup/to_test"
218
+ autoload :ToTtOnly, "#{__dir__}/markup/to_tt_only"
167
219
 
168
- ##
169
- # We take +input+, parse it if necessary, then invoke the output +formatter+
170
- # using a Visitor to render the result.
171
-
172
- def convert(input, formatter)
173
- document = case input
174
- when RDoc::Markup::Document then
175
- input
176
- else
177
- RDoc::Markup::Parser.parse input
178
- end
179
-
180
- document.accept formatter
181
220
  end
182
-
183
- autoload :Parser, "#{__dir__}/markup/parser"
184
- autoload :InlineParser, "#{__dir__}/markup/inline_parser"
185
- autoload :PreProcess, "#{__dir__}/markup/pre_process"
186
-
187
- # RDoc::Markup AST
188
- autoload :BlankLine, "#{__dir__}/markup/blank_line"
189
- autoload :BlockQuote, "#{__dir__}/markup/block_quote"
190
- autoload :Document, "#{__dir__}/markup/document"
191
- autoload :Element, "#{__dir__}/markup/element"
192
- autoload :HardBreak, "#{__dir__}/markup/hard_break"
193
- autoload :Heading, "#{__dir__}/markup/heading"
194
- autoload :Include, "#{__dir__}/markup/include"
195
- autoload :IndentedParagraph, "#{__dir__}/markup/indented_paragraph"
196
- autoload :List, "#{__dir__}/markup/list"
197
- autoload :ListItem, "#{__dir__}/markup/list_item"
198
- autoload :Paragraph, "#{__dir__}/markup/paragraph"
199
- autoload :Table, "#{__dir__}/markup/table"
200
- autoload :Raw, "#{__dir__}/markup/raw"
201
- autoload :Rule, "#{__dir__}/markup/rule"
202
- autoload :Verbatim, "#{__dir__}/markup/verbatim"
203
-
204
- # Formatters
205
- autoload :Formatter, "#{__dir__}/markup/formatter"
206
-
207
- autoload :ToAnsi, "#{__dir__}/markup/to_ansi"
208
- autoload :ToBs, "#{__dir__}/markup/to_bs"
209
- autoload :ToHtml, "#{__dir__}/markup/to_html"
210
- autoload :ToHtmlCrossref, "#{__dir__}/markup/to_html_crossref"
211
- autoload :ToHtmlSnippet, "#{__dir__}/markup/to_html_snippet"
212
- autoload :ToLabel, "#{__dir__}/markup/to_label"
213
- autoload :ToMarkdown, "#{__dir__}/markup/to_markdown"
214
- autoload :ToRdoc, "#{__dir__}/markup/to_rdoc"
215
- autoload :ToTableOfContents, "#{__dir__}/markup/to_table_of_contents"
216
- autoload :ToTest, "#{__dir__}/markup/to_test"
217
- autoload :ToTtOnly, "#{__dir__}/markup/to_tt_only"
218
-
219
221
  end