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.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +1 -3
- data/RI.md +75 -75
- data/exe/rdoc +2 -2
- data/lib/rdoc/code_object/alias.rb +71 -69
- data/lib/rdoc/code_object/any_method.rb +305 -303
- data/lib/rdoc/code_object/attr.rb +150 -148
- data/lib/rdoc/code_object/class_module.rb +798 -792
- data/lib/rdoc/code_object/constant.rb +175 -173
- data/lib/rdoc/code_object/context/section.rb +142 -138
- data/lib/rdoc/code_object/context.rb +926 -958
- data/lib/rdoc/code_object/extend.rb +7 -5
- data/lib/rdoc/code_object/include.rb +7 -5
- data/lib/rdoc/code_object/method_attr.rb +326 -319
- data/lib/rdoc/code_object/mixin.rb +97 -95
- data/lib/rdoc/code_object/normal_class.rb +77 -78
- data/lib/rdoc/code_object/normal_module.rb +61 -59
- data/lib/rdoc/code_object/require.rb +23 -39
- data/lib/rdoc/code_object/single_class.rb +21 -19
- data/lib/rdoc/code_object/top_level.rb +212 -219
- data/lib/rdoc/code_object.rb +305 -303
- data/lib/rdoc/comment.rb +275 -273
- data/lib/rdoc/cross_reference.rb +192 -190
- data/lib/rdoc/encoding.rb +105 -103
- data/lib/rdoc/erb_partial.rb +13 -11
- data/lib/rdoc/erbio.rb +29 -27
- data/lib/rdoc/generator/aliki.rb +161 -153
- data/lib/rdoc/generator/darkfish.rb +645 -635
- data/lib/rdoc/generator/json_index.rb +233 -229
- data/lib/rdoc/generator/markup.rb +164 -146
- data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
- data/lib/rdoc/generator/pot/po.rb +52 -51
- data/lib/rdoc/generator/pot/po_entry.rb +138 -132
- data/lib/rdoc/generator/pot.rb +85 -81
- data/lib/rdoc/generator/ri.rb +23 -19
- data/lib/rdoc/generator/template/aliki/DESIGN.md +6 -4
- data/lib/rdoc/generator/template/aliki/_footer.rhtml +1 -1
- data/lib/rdoc/generator/template/aliki/_head.rhtml +10 -10
- data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
- data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +4 -4
- data/lib/rdoc/generator/template/aliki/css/rdoc.css +207 -178
- data/lib/rdoc/generator/template/aliki/js/aliki.js +60 -84
- data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
- data/lib/rdoc/generator.rb +48 -46
- data/lib/rdoc/i18n/locale.rb +99 -95
- data/lib/rdoc/i18n/text.rb +109 -105
- data/lib/rdoc/i18n.rb +7 -5
- data/lib/rdoc/markdown/byte_runtime.rb +80 -0
- data/lib/rdoc/markdown.kpeg +15 -11
- data/lib/rdoc/markdown.rb +40 -47
- data/lib/rdoc/markup/block_quote.rb +12 -8
- data/lib/rdoc/markup/document.rb +127 -123
- data/lib/rdoc/markup/formatter.rb +219 -215
- data/lib/rdoc/markup/include.rb +33 -29
- data/lib/rdoc/markup/indented_paragraph.rb +37 -33
- data/lib/rdoc/markup/inline_parser.rb +281 -277
- data/lib/rdoc/markup/list.rb +80 -88
- data/lib/rdoc/markup/list_item.rb +73 -85
- data/lib/rdoc/markup/paragraph.rb +23 -19
- data/lib/rdoc/markup/parser.rb +501 -497
- data/lib/rdoc/markup/pre_process.rb +283 -279
- data/lib/rdoc/markup/raw.rb +2 -2
- data/lib/rdoc/markup/rule.rb +16 -12
- data/lib/rdoc/markup/to_ansi.rb +143 -139
- data/lib/rdoc/markup/to_bs.rb +72 -68
- data/lib/rdoc/markup/to_html.rb +594 -565
- data/lib/rdoc/markup/to_html_crossref.rb +234 -230
- data/lib/rdoc/markup/to_html_snippet.rb +232 -227
- data/lib/rdoc/markup/to_joined_paragraph.rb +36 -32
- data/lib/rdoc/markup/to_label.rb +63 -59
- data/lib/rdoc/markup/to_markdown.rb +212 -208
- data/lib/rdoc/markup/to_rdoc.rb +336 -332
- data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
- data/lib/rdoc/markup/to_test.rb +60 -56
- data/lib/rdoc/markup/to_tt_only.rb +84 -80
- data/lib/rdoc/markup/verbatim.rb +62 -58
- data/lib/rdoc/markup.rb +198 -196
- data/lib/rdoc/options.rb +1063 -1061
- data/lib/rdoc/parser/c.rb +1039 -1037
- data/lib/rdoc/parser/changelog.rb +319 -315
- data/lib/rdoc/parser/markdown.rb +17 -13
- data/lib/rdoc/parser/rbs.rb +239 -235
- data/lib/rdoc/parser/rd.rb +17 -13
- data/lib/rdoc/parser/ruby.rb +1245 -1124
- data/lib/rdoc/parser/ruby_colorizer.rb +263 -213
- data/lib/rdoc/parser/simple.rb +31 -27
- data/lib/rdoc/parser/text.rb +12 -8
- data/lib/rdoc/parser.rb +228 -220
- data/lib/rdoc/rbs_helper.rb +1 -1
- data/lib/rdoc/rd/inline.rb +57 -53
- data/lib/rdoc/rd.rb +90 -88
- data/lib/rdoc/rdoc.rb +500 -491
- data/lib/rdoc/ri/driver.rb +1140 -1135
- data/lib/rdoc/ri/formatter.rb +7 -3
- data/lib/rdoc/ri/paths.rb +140 -136
- data/lib/rdoc/ri/servlet.rb +354 -350
- data/lib/rdoc/ri/store.rb +4 -2
- data/lib/rdoc/ri/task.rb +55 -51
- data/lib/rdoc/ri.rb +14 -12
- data/lib/rdoc/rubygems_hook.rb +183 -181
- data/lib/rdoc/server.rb +349 -347
- data/lib/rdoc/stats/normal.rb +46 -42
- data/lib/rdoc/stats/quiet.rb +39 -35
- data/lib/rdoc/stats/verbose.rb +35 -31
- data/lib/rdoc/stats.rb +365 -363
- data/lib/rdoc/store.rb +888 -902
- data/lib/rdoc/task.rb +260 -256
- data/lib/rdoc/text.rb +135 -133
- data/lib/rdoc/token_stream.rb +101 -93
- data/lib/rdoc/tom_doc.rb +203 -201
- data/lib/rdoc/version.rb +1 -1
- metadata +4 -5
- data/lib/rdoc/markdown/literals.kpeg +0 -21
- data/lib/rdoc/markdown/literals.rb +0 -454
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
|
-
#
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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 #{
|
|
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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|