@@ -8,9 +8,9 @@ classes for each feature.
8
8
== Bugs
9
9
10
10
If you think you found a bug, file a ticket on the {issues
11
- tracker}[https://github.com/ruby/rdoc/issues] on github .
11
+ tracker}[https://github.com/ruby/rdoc/issues] on GitHub .
12
12
13
- If your bug involves an error RDoc produced please include a sample file that
13
+ If your bug involves an error RDoc produced, please include a sample file that
14
14
illustrates the problem or link to the repository or gem that is associated
15
15
with the bug.
16
16
@@ -28,19 +28,19 @@ RDoc uses bundler for development. To get ready to work on RDoc run:
28
28
[...]
29
29
$ bundle install
30
30
[...]
31
- $ rake
31
+ $ bundle exec rake
32
32
[...]
33
33
34
- This will install all the necessary dependencies for development with rake,
34
+ This will install all the necessary dependencies for development with + rake+ ,
35
35
generate documentation and run the tests for the first time.
36
36
37
- If the tests don't pass on the first run check the {GitHub Actions page}[https://github.com/ruby/rdoc/actions] to see if there are any known failures
38
- (there shouldn't be).
37
+ If the tests don't pass on the first run, check the {GitHub Actions page}[https://github.com/ruby/rdoc/actions]
38
+ to see if there are any known failures (there shouldn't be).
39
39
40
- You can now use ` rake` and ` autotest` to run the tests.
40
+ You can now use + rake+ and + autotest+ to run the tests.
41
41
42
- Note: the ` rake` command must be used first before running any tests, because
43
- it's used to generate various parsers implemented in RDoc. Also ` rake clean` is
42
+ Note: the + rake+ command must be used first before running any tests, because
43
+ it's used to generate various parsers implemented in RDoc. Also <tt> rake clean</tt> is
44
44
helpful to delete these generated files.
45
45
46
46
== Glossary
@@ -85,7 +85,7 @@ formatter::
85
85
86
86
== Plugins
87
87
88
- When ' rdoc/rdoc' is loaded RDoc looks for ' rdoc/discover' files in your
88
+ When + rdoc/rdoc+ is loaded, RDoc looks for + rdoc/discover+ files in your
89
89
installed gems. This can be used to load parsers, alternate generators, or
90
90
additional preprocessor directives. An rdoc plugin layout should look
91
91
something like this:
@@ -94,7 +94,7 @@ something like this:
94
94
lib/my/rdoc/plugin.rb
95
95
# etc.
96
96
97
- In your rdoc/discover.rb file you will want to wrap the loading of your plugin
97
+ In your + rdoc/discover.rb+ file, you will want to wrap the loading of your plugin
98
98
in an RDoc version check like this:
99
99
100
100
begin
@@ -105,19 +105,19 @@ in an RDoc version check like this:
105
105
106
106
=== Plugin Types
107
107
108
- In RDoc you can change the following behaviors:
108
+ In RDoc, you can change the following behaviors:
109
109
110
110
* Add a parser for a new file format
111
111
* Add a new output generator
112
112
* Add a new markup directive
113
113
* Add a new type of documentation markup
114
114
* Add a new type of formatter
115
115
116
- All of these are described below
116
+ All of these are described below.
117
117
118
118
== Option Parsing
119
119
120
- Option parsing is handled by RDoc::Options. When you're writing a generator
120
+ Option parsing is handled by RDoc::Options. When you're writing a generator,
121
121
you can provide the user with extra options by providing a class method
122
122
+setup_options+. The option parser will call this after your generator is
123
123
loaded. See RDoc::Generator for details.
@@ -126,20 +126,20 @@ loaded. See RDoc::Generator for details.
126
126
127
127
After options are parsed, RDoc parses files from the files and directories in
128
128
ARGV. RDoc compares the filename against what each parser claims it can parse
129
- via RDoc::Parser# parse_files_matching. For example, RDoc::Parser::C can parse
129
+ via RDoc::Parser. parse_files_matching. For example, RDoc::Parser::C can parse
130
130
C files, C headers, C++ files, C++ headers and yacc grammars.
131
131
132
- Once a matching parser class is found it is instantiated and +scan+ is called.
133
- The parser needs to extract documentation from the file and add it to the RDoc
132
+ Once a matching parser class is found, it is instantiated and +scan+ is called.
133
+ The parser needs to extract documentation from the file and adds it to the RDoc
134
134
document tree. Usually this involves starting at the root and adding a class
135
135
or a module (RDoc::TopLevel#add_class and RDoc::TopLevel#add_module) and
136
136
proceeding to add classes, modules and methods to each nested item.
137
137
138
- When the parsers are finished the document tree is cleaned up to remove
138
+ When the parsers are finished, the document tree is cleaned up to remove
139
139
dangling references to aliases and includes that were not found (and may exist
140
140
in a separate library) through RDoc::ClassModule#complete.
141
141
142
- To write your own parser for a new file format see RDoc::Parser.
142
+ To write your own parser for a new file format, see RDoc::Parser.
143
143
144
144
=== Documentation Tree
145
145
@@ -159,26 +159,26 @@ RDoc comes with an HTML generator (RDoc::Generator::Darkfish) and an RI
159
159
database generator (RDoc::Generator::RI). The output a generator creates does
160
160
not have to be human-readable.
161
161
162
- To create your own generator see RDoc::Generator.
162
+ To create your own generator, see RDoc::Generator.
163
163
164
164
=== Comments
165
165
166
- In RDoc 3.10 and newer the comment on an RDoc::CodeObject is now an
166
+ In RDoc 3.10 and newer, the comment on an RDoc::CodeObject is now an
167
167
RDoc::Comment object instead of a String. This is to support various
168
168
documentation markup formats like rdoc, TomDoc and rd. The comments are
169
- normalized to remove comment markers and remove indentation then parsed lazily
169
+ normalized to remove comment markers and indentation, and then parsed lazily
170
170
via RDoc::Comment#document to create a generic markup tree that can be
171
171
processed by a formatter.
172
172
173
- To add your own markup format see RDoc::Markup@Other+directives
173
+ To add your own markup format, see RDoc::Markup@Other+directives.
174
174
175
175
==== Formatters
176
176
177
177
To transform a comment into some form of output an RDoc::Markup::Formatter
178
178
subclass is used like RDoc::Markup::ToHtml. A formatter is a visitor that
179
179
walks a parsed comment tree (an RDoc::Markup::Document) of any format. To help
180
- write a formatter RDoc::Markup::FormatterTestCase exists for generic parsers,
181
- and RDoc::Markup::TextFormatterTestCase which contains extra test cases for
180
+ write a formatter, + RDoc::Markup::FormatterTestCase+ exists for generic parsers,
181
+ and + RDoc::Markup::TextFormatterTestCase+ which contains extra test cases for
182
182
text-type output (like +ri+ output).
183
183
184
184
RDoc ships with formatters that will turn a comment into HTML, rdoc-markup-like
@@ -193,23 +193,23 @@ length for a comment, for example.
193
193
194
194
==== Directives
195
195
196
- For comments in markup you can add new directives (:nodoc: is a directive).
196
+ For comments in markup you can add new directives (+ :nodoc:+ is a directive).
197
197
Directives may replace text or store it off for later use.
198
198
199
199
See RDoc::Markup::PreProcess::register for details.
200
200
201
- === JSONIndex
201
+ === JSON Index
202
202
203
- RDoc contains a special generator, RDoc::Generator::JSONIndex , which creates a
203
+ RDoc contains a special generator, RDoc::Generator::JsonIndex , which creates a
204
204
JSON-based search index and includes a search engine for use with HTML output.
205
205
This generator can be used to add searching to any HTML output and is designed
206
206
to be called from inside an HTML generator.
207
207
208
208
== Markup
209
209
210
210
Additional documentation markup formats can be added to RDoc. A markup
211
- parsing class must respond to \ ::parse and accept a String argument containing
212
- the markup format. An RDoc::Document containing documentation items
211
+ parsing class must respond to + ::parse+ and accept a String argument containing
212
+ the markup format. An RDoc::Markup:: Document containing documentation items
213
213
(RDoc::Markup::Heading, RDoc::Markup::Paragraph, RDoc::Markup::Verbatim, etc.)
214
214
must be returned.
215
215
0 commit comments