rdoc 6.3.4.1 → 8.0.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 +195 -0
- data/History.rdoc +65 -63
- data/LEGAL.rdoc +7 -1
- data/LICENSE.rdoc +6 -0
- data/README.md +236 -0
- data/RI.md +842 -0
- data/TODO.rdoc +8 -7
- data/doc/markup_reference/markdown.md +659 -0
- data/doc/markup_reference/rdoc.rdoc +1169 -0
- data/exe/rdoc +0 -1
- data/lib/rdoc/{alias.rb → code_object/alias.rb} +4 -18
- data/lib/rdoc/{any_method.rb → code_object/any_method.rb} +50 -24
- data/lib/rdoc/{attr.rb → code_object/attr.rb} +16 -14
- data/lib/rdoc/{class_module.rb → code_object/class_module.rb} +225 -58
- data/lib/rdoc/{constant.rb → code_object/constant.rb} +44 -10
- data/lib/rdoc/code_object/context/section.rb +182 -0
- data/lib/rdoc/{context.rb → code_object/context.rb} +78 -106
- data/lib/rdoc/{extend.rb → code_object/extend.rb} +0 -1
- data/lib/rdoc/{include.rb → code_object/include.rb} +0 -1
- data/lib/rdoc/{method_attr.rb → code_object/method_attr.rb} +46 -48
- data/lib/rdoc/{mixin.rb → code_object/mixin.rb} +6 -4
- data/lib/rdoc/{normal_class.rb → code_object/normal_class.rb} +2 -3
- data/lib/rdoc/{normal_module.rb → code_object/normal_module.rb} +2 -3
- data/lib/rdoc/{require.rb → code_object/require.rb} +1 -2
- data/lib/rdoc/{single_class.rb → code_object/single_class.rb} +5 -1
- data/lib/rdoc/{top_level.rb → code_object/top_level.rb} +60 -63
- data/lib/rdoc/code_object.rb +11 -39
- data/lib/rdoc/code_objects.rb +1 -2
- data/lib/rdoc/comment.rb +202 -99
- data/lib/rdoc/cross_reference.rb +75 -62
- data/lib/rdoc/encoding.rb +8 -24
- data/lib/rdoc/erb_partial.rb +1 -2
- data/lib/rdoc/erbio.rb +3 -8
- data/lib/rdoc/generator/aliki.rb +200 -0
- data/lib/rdoc/generator/darkfish.rb +156 -122
- data/lib/rdoc/generator/json_index.rb +8 -24
- data/lib/rdoc/generator/markup.rb +70 -34
- data/lib/rdoc/generator/pot/message_extractor.rb +7 -7
- data/lib/rdoc/generator/pot/po.rb +1 -1
- data/lib/rdoc/generator/pot/po_entry.rb +8 -8
- data/lib/rdoc/generator/pot.rb +1 -5
- data/lib/rdoc/generator/ri.rb +1 -2
- data/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
- data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
- data/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
- data/lib/rdoc/generator/template/aliki/_head.rhtml +163 -0
- data/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
- data/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +27 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +27 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
- data/lib/rdoc/generator/template/aliki/class.rhtml +230 -0
- data/lib/rdoc/generator/template/aliki/css/rdoc.css +2181 -0
- data/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
- data/lib/rdoc/generator/template/aliki/js/aliki.js +513 -0
- data/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
- data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
- data/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -0
- data/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
- data/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
- data/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
- data/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
- data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
- data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
- data/lib/rdoc/generator/template/darkfish/_footer.rhtml +3 -3
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +35 -14
- data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +1 -5
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +11 -9
- data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +11 -9
- data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +7 -6
- data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +20 -11
- data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +25 -5
- data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +4 -9
- data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +2 -1
- data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +4 -4
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +28 -7
- data/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
- data/lib/rdoc/generator/template/darkfish/class.rhtml +138 -90
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +420 -358
- data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/index.rhtml +14 -12
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +59 -3
- data/lib/rdoc/generator/template/darkfish/js/search.js +15 -5
- data/lib/rdoc/generator/template/darkfish/page.rhtml +7 -6
- data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +12 -9
- data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +24 -21
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +35 -21
- data/lib/rdoc/generator/template/json_index/js/navigation.js +8 -8
- data/lib/rdoc/generator/template/json_index/js/searcher.js +48 -6
- data/lib/rdoc/generator.rb +6 -5
- data/lib/rdoc/i18n/text.rb +3 -3
- data/lib/rdoc/i18n.rb +1 -1
- data/lib/rdoc/known_classes.rb +5 -4
- data/lib/rdoc/markdown/entities.rb +0 -1
- data/lib/rdoc/markdown/literals.kpeg +0 -2
- data/lib/rdoc/markdown/literals.rb +0 -1
- data/lib/rdoc/markdown.kpeg +140 -62
- data/lib/rdoc/markdown.rb +1015 -873
- data/lib/rdoc/markup/blank_line.rb +25 -24
- data/lib/rdoc/markup/block_quote.rb +1 -2
- data/lib/rdoc/markup/document.rb +10 -11
- data/lib/rdoc/markup/element.rb +21 -0
- data/lib/rdoc/markup/formatter.rb +134 -115
- data/lib/rdoc/markup/hard_break.rb +30 -28
- data/lib/rdoc/markup/heading.rb +163 -72
- data/lib/rdoc/markup/include.rb +3 -4
- data/lib/rdoc/markup/indented_paragraph.rb +4 -5
- data/lib/rdoc/markup/inline_parser.rb +312 -0
- data/lib/rdoc/markup/list.rb +6 -7
- data/lib/rdoc/markup/list_item.rb +6 -7
- data/lib/rdoc/markup/paragraph.rb +2 -3
- data/lib/rdoc/markup/parser.rb +29 -19
- data/lib/rdoc/markup/pre_process.rb +39 -18
- data/lib/rdoc/markup/raw.rb +52 -56
- data/lib/rdoc/markup/rule.rb +2 -3
- data/lib/rdoc/markup/table.rb +49 -32
- data/lib/rdoc/markup/to_ansi.rb +58 -8
- data/lib/rdoc/markup/to_bs.rb +47 -38
- data/lib/rdoc/markup/to_html.rb +343 -105
- data/lib/rdoc/markup/to_html_crossref.rb +143 -58
- data/lib/rdoc/markup/to_html_snippet.rb +78 -76
- data/lib/rdoc/markup/to_joined_paragraph.rb +3 -9
- data/lib/rdoc/markup/to_label.rb +34 -25
- data/lib/rdoc/markup/to_markdown.rb +74 -51
- data/lib/rdoc/markup/to_rdoc.rb +141 -82
- data/lib/rdoc/markup/to_table_of_contents.rb +4 -5
- data/lib/rdoc/markup/to_test.rb +10 -3
- data/lib/rdoc/markup/to_tt_only.rb +17 -31
- data/lib/rdoc/markup/verbatim.rb +5 -6
- data/lib/rdoc/markup.rb +59 -707
- data/lib/rdoc/options.rb +228 -101
- data/lib/rdoc/parser/c.rb +186 -184
- data/lib/rdoc/parser/changelog.rb +57 -13
- data/lib/rdoc/parser/markdown.rb +0 -2
- data/lib/rdoc/parser/rbs.rb +275 -0
- data/lib/rdoc/parser/rd.rb +0 -1
- data/lib/rdoc/parser/ruby.rb +963 -2024
- data/lib/rdoc/parser/ruby_colorizer.rb +253 -0
- data/lib/rdoc/parser/simple.rb +6 -23
- data/lib/rdoc/parser/text.rb +0 -1
- data/lib/rdoc/parser.rb +35 -14
- data/lib/rdoc/rbs_helper.rb +186 -0
- data/lib/rdoc/rd/block_parser.rb +659 -11
- data/lib/rdoc/rd/block_parser.ry +13 -9
- data/lib/rdoc/rd/inline.rb +4 -5
- data/lib/rdoc/rd/inline_parser.rb +646 -2
- data/lib/rdoc/rd.rb +4 -5
- data/lib/rdoc/rdoc.rb +234 -90
- data/lib/rdoc/ri/driver.rb +172 -172
- data/lib/rdoc/ri/paths.rb +3 -3
- data/lib/rdoc/{servlet.rb → ri/servlet.rb} +28 -27
- data/lib/rdoc/ri/store.rb +0 -1
- data/lib/rdoc/ri/task.rb +3 -3
- data/lib/rdoc/ri.rb +5 -5
- data/lib/rdoc/rubygems_hook.rb +106 -25
- data/lib/rdoc/server.rb +460 -0
- data/lib/rdoc/stats/normal.rb +1 -1
- data/lib/rdoc/stats/quiet.rb +1 -2
- data/lib/rdoc/stats/verbose.rb +3 -5
- data/lib/rdoc/stats.rb +158 -136
- data/lib/rdoc/store.rb +267 -48
- data/lib/rdoc/task.rb +54 -28
- data/lib/rdoc/text.rb +60 -120
- data/lib/rdoc/token_stream.rb +30 -45
- data/lib/rdoc/tom_doc.rb +9 -15
- data/lib/rdoc/version.rb +3 -1
- data/lib/rdoc.rb +90 -52
- data/lib/rubygems_plugin.rb +14 -0
- data/man/ri.1 +2 -0
- data/rdoc-logo.svg +43 -0
- data/rdoc.gemspec +25 -200
- metadata +120 -53
- data/CONTRIBUTING.rdoc +0 -220
- data/ExampleMarkdown.md +0 -37
- data/ExampleRDoc.rdoc +0 -208
- data/Gemfile +0 -12
- data/README.rdoc +0 -129
- data/RI.rdoc +0 -57
- data/Rakefile +0 -101
- data/bin/console +0 -7
- data/bin/setup +0 -6
- data/lib/rdoc/anon_class.rb +0 -11
- data/lib/rdoc/context/section.rb +0 -232
- data/lib/rdoc/generator/template/darkfish/.document +0 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +0 -19
- data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +0 -9
- data/lib/rdoc/generator/template/json_index/.document +0 -1
- data/lib/rdoc/ghost_method.rb +0 -7
- data/lib/rdoc/markup/attr_changer.rb +0 -23
- data/lib/rdoc/markup/attr_span.rb +0 -36
- data/lib/rdoc/markup/attribute_manager.rb +0 -409
- data/lib/rdoc/markup/attributes.rb +0 -71
- data/lib/rdoc/markup/regexp_handling.rb +0 -41
- data/lib/rdoc/meta_method.rb +0 -7
- data/lib/rdoc/parser/ripper_state_lex.rb +0 -590
- data/lib/rdoc/parser/ruby_tools.rb +0 -167
data/ExampleRDoc.rdoc
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
This document contains example output to show RDoc styling. This file was
|
|
2
|
-
created from a RDoc Markup file.
|
|
3
|
-
|
|
4
|
-
== Headings
|
|
5
|
-
|
|
6
|
-
You should not use headings beyond level 3, it is a sign of poor organization
|
|
7
|
-
of your code or documentation. It also becomes difficult for the user to
|
|
8
|
-
figure out what you are attempting to explain to them as they have to track
|
|
9
|
-
the multiple layers of nesting.
|
|
10
|
-
|
|
11
|
-
= Heading level 1
|
|
12
|
-
|
|
13
|
-
Above is a level one heading.
|
|
14
|
-
|
|
15
|
-
These paragraphs are filler that exist so you can see how the heading
|
|
16
|
-
interacts with paragraphs before and after the heading. As you can see each
|
|
17
|
-
different heading has a different amount of margin above and below.
|
|
18
|
-
|
|
19
|
-
This should be sufficient to give you a proper picture of how it will appear in
|
|
20
|
-
your documentation.
|
|
21
|
-
|
|
22
|
-
== Heading level 2
|
|
23
|
-
|
|
24
|
-
Above is a level two heading.
|
|
25
|
-
|
|
26
|
-
These paragraphs are filler that exist so you can see how the heading
|
|
27
|
-
interacts with paragraphs before and after the heading. As you can see each
|
|
28
|
-
different heading has a different amount of margin above and below.
|
|
29
|
-
|
|
30
|
-
This should be sufficient to give you a proper picture of how it will appear in
|
|
31
|
-
your documentation.
|
|
32
|
-
|
|
33
|
-
=== Heading level 3
|
|
34
|
-
|
|
35
|
-
Above is a level three heading.
|
|
36
|
-
|
|
37
|
-
These paragraphs are filler that exist so you can see how the heading
|
|
38
|
-
interacts with paragraphs before and after the heading. As you can see each
|
|
39
|
-
different heading has a different amount of margin above and below.
|
|
40
|
-
|
|
41
|
-
This should be sufficient to give you a proper picture of how it will appear in
|
|
42
|
-
your documentation.
|
|
43
|
-
|
|
44
|
-
==== Heading level 4
|
|
45
|
-
|
|
46
|
-
Above is a level four heading.
|
|
47
|
-
|
|
48
|
-
These paragraphs are filler that exist so you can see how the heading
|
|
49
|
-
interacts with paragraphs before and after the heading. As you can see each
|
|
50
|
-
different heading has a different amount of margin above and below.
|
|
51
|
-
|
|
52
|
-
This should be sufficient to give you a proper picture of how it will appear in
|
|
53
|
-
your documentation.
|
|
54
|
-
|
|
55
|
-
===== Heading level 5
|
|
56
|
-
|
|
57
|
-
Above is a level five heading.
|
|
58
|
-
|
|
59
|
-
These paragraphs are filler that exist so you can see how the heading
|
|
60
|
-
interacts with paragraphs before and after the heading. As you can see each
|
|
61
|
-
different heading has a different amount of margin above and below.
|
|
62
|
-
|
|
63
|
-
This should be sufficient to give you a proper picture of how it will appear in
|
|
64
|
-
your documentation.
|
|
65
|
-
|
|
66
|
-
====== Heading level 6
|
|
67
|
-
|
|
68
|
-
Above is a level six heading.
|
|
69
|
-
|
|
70
|
-
These paragraphs are filler that exist so you can see how the heading
|
|
71
|
-
interacts with paragraphs before and after the heading. As you can see each
|
|
72
|
-
different heading has a different amount of margin above and below.
|
|
73
|
-
|
|
74
|
-
This should be sufficient to give you a proper picture of how it will appear in
|
|
75
|
-
your documentation.
|
|
76
|
-
|
|
77
|
-
== Paragraphs
|
|
78
|
-
|
|
79
|
-
This is how a paragraph looks. Since it is difficult to generate good content
|
|
80
|
-
for paragraphs I have chosen to use {Riker Ipsum}[http://rikeripsum.com] for
|
|
81
|
-
nonsense filler content. In the previous sentence you can see how a link is
|
|
82
|
-
formatted.
|
|
83
|
-
|
|
84
|
-
Here is an example of *bold* and _emphasis_ styling. Try not to combine the
|
|
85
|
-
two or use them too often. Here is an example of <code>inline verbatim
|
|
86
|
-
text</code>. That should be enough of a taste of inline markup in paragraphs.
|
|
87
|
-
The Riker Ipsum filler follows:
|
|
88
|
-
|
|
89
|
-
Shields up! Rrrrred alert! Well, I'll say this for him - he's sure of himself.
|
|
90
|
-
and attack the Romulans. Worf, It's better than music. It's jazz. This should
|
|
91
|
-
be interesting. When has justice ever been as simple as a rule book? Flair is
|
|
92
|
-
what marks the difference between artistry and mere competence.
|
|
93
|
-
|
|
94
|
-
Sorry, Data. I think you've let your personal feelings cloud your judgement. We
|
|
95
|
-
finished our first sensor sweep of the neutral zone. Yes, absolutely, I do
|
|
96
|
-
indeed concur, wholeheartedly! Mr. Worf, you do remember how to fire phasers? A
|
|
97
|
-
lot of things can change in twelve years, Admiral. Your shields were failing,
|
|
98
|
-
sir.
|
|
99
|
-
|
|
100
|
-
== Verbatim sections
|
|
101
|
-
|
|
102
|
-
A verbatim section typically contains source code or example output. This is
|
|
103
|
-
how verbatim blocks of code looks:
|
|
104
|
-
|
|
105
|
-
def local responder
|
|
106
|
-
responder.ping do |value|
|
|
107
|
-
return value
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
def ping uri
|
|
112
|
-
@uri = uri
|
|
113
|
-
@remote = DRb::DRbObject.new_with_uri @uri
|
|
114
|
-
|
|
115
|
-
@remote.ping do |value|
|
|
116
|
-
return value
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
This is a paragraph following the verbatim block so you can see how leading and trailing paragraphs interact with it.
|
|
121
|
-
|
|
122
|
-
== Unordered lists
|
|
123
|
-
|
|
124
|
-
Here is an unordered list. As you can see it uses non-numeral markers for each list item:
|
|
125
|
-
|
|
126
|
-
* This is the top-most item in the list.
|
|
127
|
-
* This is a second item in the list.
|
|
128
|
-
|
|
129
|
-
Unlike the first item, this item has more than one paragraph so you can see
|
|
130
|
-
how they interact.
|
|
131
|
-
* This is a third item in the list. Like the item before it, this item has a
|
|
132
|
-
second paragraph.
|
|
133
|
-
|
|
134
|
-
Here is the second paragraph in the list item.
|
|
135
|
-
* A final list item.
|
|
136
|
-
|
|
137
|
-
== Ordered lists
|
|
138
|
-
|
|
139
|
-
Here is an ordered list. As you can see it uses numeral markers for each list
|
|
140
|
-
item:
|
|
141
|
-
|
|
142
|
-
1. This is the first item in the list.
|
|
143
|
-
1. This is the second item in the list.
|
|
144
|
-
|
|
145
|
-
Unlike the first item, this item has more than one paragraph so you can see
|
|
146
|
-
how they interact.
|
|
147
|
-
1. This is the third item in the list. Like the item before it, this item has
|
|
148
|
-
a second paragraph.
|
|
149
|
-
|
|
150
|
-
Here is the second paragraph in the third list item.
|
|
151
|
-
1. The fourth and final list item.
|
|
152
|
-
|
|
153
|
-
== Definition lists
|
|
154
|
-
|
|
155
|
-
=== "Note" list
|
|
156
|
-
|
|
157
|
-
The "note" syntax can be used to create a definition list:
|
|
158
|
-
|
|
159
|
-
note::
|
|
160
|
-
description
|
|
161
|
-
|
|
162
|
-
Here is such a definition list:
|
|
163
|
-
|
|
164
|
-
cat::
|
|
165
|
-
A cat is a small mammal that is commonly kept as a pet.
|
|
166
|
-
|
|
167
|
-
dog::
|
|
168
|
-
A dog is a mammal that is also kept as a pet. A dog may range in size from
|
|
169
|
-
smaller than a cat to larger than a human.
|
|
170
|
-
|
|
171
|
-
Typically dogs are easier to train to respond to commands than cats.
|
|
172
|
-
|
|
173
|
-
rabbit::
|
|
174
|
-
Rabbits are also mammals, but are infrequently kept as pets. Most rabbits
|
|
175
|
-
are wild.
|
|
176
|
-
|
|
177
|
-
=== "Label" list
|
|
178
|
-
|
|
179
|
-
The "label" syntax can be used to create a definition list:
|
|
180
|
-
|
|
181
|
-
[label]
|
|
182
|
-
description
|
|
183
|
-
|
|
184
|
-
Here is such a definition list:
|
|
185
|
-
|
|
186
|
-
[cat]
|
|
187
|
-
A cat is a small mammal that is commonly kept as a pet.
|
|
188
|
-
|
|
189
|
-
[dog]
|
|
190
|
-
A dog is a mammal that is also kept as a pet. A dog may range in size from
|
|
191
|
-
smaller than a cat to larger than a human.
|
|
192
|
-
|
|
193
|
-
Typically dogs are easier to train to respond to commands than cats.
|
|
194
|
-
|
|
195
|
-
[rabbit]
|
|
196
|
-
Rabbits are also mammals, but are infrequently kept as pets. Most rabbits
|
|
197
|
-
are wild.
|
|
198
|
-
|
|
199
|
-
== Rule
|
|
200
|
-
|
|
201
|
-
A rule is a horizontal divider between two paragraphs. Following this
|
|
202
|
-
paragraph is a rule.
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
In historic versions of RDoc you could control the height of the rule in HTML
|
|
207
|
-
output. This is no longer true as HTML 5 does not support this.
|
|
208
|
-
|
data/Gemfile
DELETED
data/README.rdoc
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
= \RDoc - Ruby Documentation System
|
|
2
|
-
|
|
3
|
-
home :: https://github.com/ruby/rdoc
|
|
4
|
-
rdoc :: https://ruby.github.io/rdoc
|
|
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]
|
|
7
|
-
|
|
8
|
-
== Description
|
|
9
|
-
|
|
10
|
-
RDoc produces HTML and command-line documentation for Ruby projects. RDoc
|
|
11
|
-
includes the +rdoc+ and +ri+ tools for generating and displaying documentation
|
|
12
|
-
from the command-line.
|
|
13
|
-
|
|
14
|
-
== Generating Documentation
|
|
15
|
-
|
|
16
|
-
Once installed, you can create documentation using the +rdoc+ command
|
|
17
|
-
|
|
18
|
-
$ rdoc [options] [names...]
|
|
19
|
-
|
|
20
|
-
For an up-to-date option summary, type
|
|
21
|
-
|
|
22
|
-
$ rdoc --help
|
|
23
|
-
|
|
24
|
-
A typical use might be to generate documentation for a package of Ruby
|
|
25
|
-
source (such as RDoc itself).
|
|
26
|
-
|
|
27
|
-
$ rdoc
|
|
28
|
-
|
|
29
|
-
This command generates documentation for all the Ruby and C source
|
|
30
|
-
files in and below the current directory. These will be stored in a
|
|
31
|
-
documentation tree starting in the subdirectory +doc+.
|
|
32
|
-
|
|
33
|
-
You can make this slightly more useful for your readers by having the
|
|
34
|
-
index page contain the documentation for the primary file. In our
|
|
35
|
-
case, we could type
|
|
36
|
-
|
|
37
|
-
% rdoc --main README.rdoc
|
|
38
|
-
|
|
39
|
-
You'll find information on the various formatting tricks you can use
|
|
40
|
-
in comment blocks in the documentation this generates.
|
|
41
|
-
|
|
42
|
-
RDoc uses file extensions to determine how to process each file. File names
|
|
43
|
-
ending +.rb+ and +.rbw+ are assumed to be Ruby source. Files
|
|
44
|
-
ending +.c+ are parsed as C files. All other files are assumed to
|
|
45
|
-
contain just Markup-style markup (with or without leading '#' comment
|
|
46
|
-
markers). If directory names are passed to RDoc, they are scanned
|
|
47
|
-
recursively for C and Ruby source files only.
|
|
48
|
-
|
|
49
|
-
To generate documentation using +rake+ see RDoc::Task[https://ruby.github.io/rdoc/RDocTask.html].
|
|
50
|
-
|
|
51
|
-
To generate documentation programmatically:
|
|
52
|
-
|
|
53
|
-
gem 'rdoc'
|
|
54
|
-
require 'rdoc/rdoc'
|
|
55
|
-
|
|
56
|
-
options = RDoc::Options.new
|
|
57
|
-
# see RDoc::Options
|
|
58
|
-
|
|
59
|
-
rdoc = RDoc::RDoc.new
|
|
60
|
-
rdoc.document options
|
|
61
|
-
# see RDoc::RDoc
|
|
62
|
-
|
|
63
|
-
== Writing Documentation
|
|
64
|
-
|
|
65
|
-
To write documentation for RDoc place a comment above the class, module,
|
|
66
|
-
method, constant, or attribute you want documented:
|
|
67
|
-
|
|
68
|
-
##
|
|
69
|
-
# This class represents an arbitrary shape by a series of points.
|
|
70
|
-
|
|
71
|
-
class Shape
|
|
72
|
-
|
|
73
|
-
##
|
|
74
|
-
# Creates a new shape described by a +polyline+.
|
|
75
|
-
#
|
|
76
|
-
# If the +polyline+ does not end at the same point it started at the
|
|
77
|
-
# first pointed is copied and placed at the end of the line.
|
|
78
|
-
#
|
|
79
|
-
# An ArgumentError is raised if the line crosses itself, but shapes may
|
|
80
|
-
# be concave.
|
|
81
|
-
|
|
82
|
-
def initialize polyline
|
|
83
|
-
# ...
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
The default comment markup format is the RDoc::Markup format.
|
|
89
|
-
TomDoc[rdoc-ref:RDoc::TomDoc], Markdown[rdoc-ref:RDoc::Markdown] and
|
|
90
|
-
RD[rdoc-ref:RDoc::RD] format comments are also supported. You can set the
|
|
91
|
-
default comment format for your entire project by creating a
|
|
92
|
-
<tt>.rdoc_options</tt> file. See RDoc::Options@Saved+Options for instructions
|
|
93
|
-
on creating one. You can also set the comment format for a single file
|
|
94
|
-
through the +:markup:+ directive, but this is only recommended if you wish to
|
|
95
|
-
switch markup formats. See RDoc::Markup@Other+directives.
|
|
96
|
-
|
|
97
|
-
Comments can contain directives that tell RDoc information that it cannot
|
|
98
|
-
otherwise discover through parsing. See RDoc::Markup@Directives to control
|
|
99
|
-
what is or is not documented, to define method arguments or to break up
|
|
100
|
-
methods in a class by topic. See RDoc::Parser::Ruby for directives used to
|
|
101
|
-
teach RDoc about metaprogrammed methods.
|
|
102
|
-
|
|
103
|
-
See RDoc::Parser::C for documenting C extensions with RDoc.
|
|
104
|
-
|
|
105
|
-
To determine how well your project is documented run <tt>rdoc -C lib</tt> to
|
|
106
|
-
get a documentation coverage report. <tt>rdoc -C1 lib</tt> includes parameter
|
|
107
|
-
names in the documentation coverage report.
|
|
108
|
-
|
|
109
|
-
== Bugs
|
|
110
|
-
|
|
111
|
-
See CONTRIBUTING@Bugs for information on filing a bug report. It's OK to file
|
|
112
|
-
a bug report for anything you're having a problem with. If you can't figure
|
|
113
|
-
out how to make RDoc produce the output you like that is probably a
|
|
114
|
-
documentation bug.
|
|
115
|
-
|
|
116
|
-
== License
|
|
117
|
-
|
|
118
|
-
RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers.
|
|
119
|
-
Portions (c) 2007-2011 Eric Hodel. Portions copyright others, see individual
|
|
120
|
-
files and LEGAL.rdoc for details.
|
|
121
|
-
|
|
122
|
-
RDoc is free software, and may be redistributed under the terms specified in
|
|
123
|
-
LICENSE.rdoc.
|
|
124
|
-
|
|
125
|
-
== Warranty
|
|
126
|
-
|
|
127
|
-
This software is provided "as is" and without any express or implied
|
|
128
|
-
warranties, including, without limitation, the implied warranties of
|
|
129
|
-
merchantability and fitness for a particular purpose.
|
data/RI.rdoc
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
= RI
|
|
2
|
-
|
|
3
|
-
+ri+ is a tool that allows Ruby documentation to be viewed on the command-line.
|
|
4
|
-
|
|
5
|
-
You can use +ri+ to look up information from either the command line or
|
|
6
|
-
interactively. When you run +ri+ without any arguments it will launch in
|
|
7
|
-
interactive mode. In interactive mode you can tab-complete class and method
|
|
8
|
-
names.
|
|
9
|
-
|
|
10
|
-
== Usage
|
|
11
|
-
|
|
12
|
-
To see information for a class, do:
|
|
13
|
-
ri ClassName
|
|
14
|
-
|
|
15
|
-
For example, for the Array class, do:
|
|
16
|
-
ri Array
|
|
17
|
-
|
|
18
|
-
To see information on a method on a class, do:
|
|
19
|
-
ri ClassName.method
|
|
20
|
-
|
|
21
|
-
This will show both instance and class methods. For example, the IO
|
|
22
|
-
class defines both IO::read and IO#read:
|
|
23
|
-
ri IO.read
|
|
24
|
-
|
|
25
|
-
To see information for an instance method, do:
|
|
26
|
-
ri ClassName#method_name
|
|
27
|
-
|
|
28
|
-
For example, for Array's +join+ method, do:
|
|
29
|
-
ri Array#join
|
|
30
|
-
|
|
31
|
-
To see information for a class method, do:
|
|
32
|
-
ri ClassName::method_name
|
|
33
|
-
|
|
34
|
-
For example, for Module's +private+ method, do:
|
|
35
|
-
ri Module::private
|
|
36
|
-
|
|
37
|
-
To read documentation for all +read+ methods, do:
|
|
38
|
-
ri read
|
|
39
|
-
|
|
40
|
-
== Options
|
|
41
|
-
|
|
42
|
-
+ri+ supports a variety of options, all of which can be viewed via +--help+.
|
|
43
|
-
Of particular interest, are:
|
|
44
|
-
|
|
45
|
-
[<tt>-f</tt>]
|
|
46
|
-
Outputs ri data using the selected formatter. You can see the available
|
|
47
|
-
formatters in <tt>ri --help</tt>
|
|
48
|
-
[<tt>-T</tt>]
|
|
49
|
-
Send output to stdout, rather than to a pager.
|
|
50
|
-
|
|
51
|
-
All options also can be specified through the +RI+ environment variable.
|
|
52
|
-
Command-line options always override those specified in the +RI+ environment
|
|
53
|
-
variable.
|
|
54
|
-
|
|
55
|
-
The +RI_PAGER+ environment variable allows you to choose a particular pager or
|
|
56
|
-
particular options for your pager.
|
|
57
|
-
|
data/Rakefile
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
$:.unshift File.expand_path 'lib'
|
|
2
|
-
require 'rdoc/task'
|
|
3
|
-
require 'bundler/gem_tasks'
|
|
4
|
-
require 'rake/testtask'
|
|
5
|
-
|
|
6
|
-
task :docs => :generate
|
|
7
|
-
task :test => [:normal_test, :rubygems_test]
|
|
8
|
-
|
|
9
|
-
PARSER_FILES = %w[
|
|
10
|
-
lib/rdoc/rd/block_parser.ry
|
|
11
|
-
lib/rdoc/rd/inline_parser.ry
|
|
12
|
-
lib/rdoc/markdown.kpeg
|
|
13
|
-
lib/rdoc/markdown/literals.kpeg
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
$rdoc_rakefile = true
|
|
17
|
-
|
|
18
|
-
task :default => :test
|
|
19
|
-
|
|
20
|
-
RDoc::Task.new do |doc|
|
|
21
|
-
doc.main = 'README.rdoc'
|
|
22
|
-
doc.title = "rdoc #{RDoc::VERSION} Documentation"
|
|
23
|
-
doc.rdoc_dir = 'html'
|
|
24
|
-
doc.rdoc_files = FileList.new %w[lib/**/*.rb *.rdoc] - PARSER_FILES
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
task ghpages: :rdoc do
|
|
28
|
-
`git checkout gh-pages`
|
|
29
|
-
require "fileutils"
|
|
30
|
-
FileUtils.rm_rf "/tmp/html"
|
|
31
|
-
FileUtils.mv "html", "/tmp"
|
|
32
|
-
FileUtils.rm_rf "*"
|
|
33
|
-
FileUtils.cp_r Dir.glob("/tmp/html/*"), "."
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
Rake::TestTask.new(:normal_test) do |t|
|
|
37
|
-
t.libs << "test/rdoc"
|
|
38
|
-
t.verbose = true
|
|
39
|
-
t.deps = :generate
|
|
40
|
-
t.test_files = FileList["test/**/test_*.rb"].exclude("test/rdoc/test_rdoc_rubygems_hook.rb")
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
Rake::TestTask.new(:rubygems_test) do |t|
|
|
44
|
-
t.libs << "test/rdoc"
|
|
45
|
-
t.verbose = true
|
|
46
|
-
t.deps = :generate
|
|
47
|
-
t.pattern = "test/rdoc/test_rdoc_rubygems_hook.rb"
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
path = "pkg/#{Bundler::GemHelper.gemspec.full_name}"
|
|
51
|
-
|
|
52
|
-
package_parser_files = PARSER_FILES.map do |parser_file|
|
|
53
|
-
name = File.basename(parser_file, File.extname(parser_file))
|
|
54
|
-
_path = File.dirname(parser_file)
|
|
55
|
-
package_parser_file = "#{path}/#{name}.rb"
|
|
56
|
-
parsed_file = "#{_path}/#{name}.rb"
|
|
57
|
-
|
|
58
|
-
file package_parser_file => parsed_file # ensure copy runs before racc
|
|
59
|
-
|
|
60
|
-
package_parser_file
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
parsed_files = PARSER_FILES.map do |parser_file|
|
|
64
|
-
ext = File.extname(parser_file)
|
|
65
|
-
parsed_file = "#{parser_file.chomp(ext)}.rb"
|
|
66
|
-
|
|
67
|
-
file parsed_file => parser_file do |t|
|
|
68
|
-
puts "Generating #{parsed_file}..."
|
|
69
|
-
case ext
|
|
70
|
-
when '.ry' # need racc
|
|
71
|
-
racc = Gem.bin_path 'racc', 'racc'
|
|
72
|
-
rb_file = parser_file.gsub(/\.ry\z/, ".rb")
|
|
73
|
-
ruby "#{racc} -l -o #{rb_file} #{parser_file}"
|
|
74
|
-
open(rb_file, 'r+') do |f|
|
|
75
|
-
newtext = "# frozen_string_literal: true\n#{f.read}"
|
|
76
|
-
f.rewind
|
|
77
|
-
f.write newtext
|
|
78
|
-
end
|
|
79
|
-
when '.kpeg' # need kpeg
|
|
80
|
-
kpeg = Gem.bin_path 'kpeg', 'kpeg'
|
|
81
|
-
rb_file = parser_file.gsub(/\.kpeg\z/, ".rb")
|
|
82
|
-
ruby "#{kpeg} -fsv -o #{rb_file} #{parser_file}"
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
parsed_file
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
task "#{path}.gem" => package_parser_files
|
|
90
|
-
desc "Generate all files used racc and kpeg"
|
|
91
|
-
task :generate => parsed_files
|
|
92
|
-
|
|
93
|
-
begin
|
|
94
|
-
require 'rubocop/rake_task'
|
|
95
|
-
rescue LoadError
|
|
96
|
-
else
|
|
97
|
-
RuboCop::RakeTask.new(:rubocop) do |t|
|
|
98
|
-
t.options = [*parsed_files]
|
|
99
|
-
end
|
|
100
|
-
task :build => [:generate]#, "rubocop:auto_correct"]
|
|
101
|
-
end
|
data/bin/console
DELETED
data/bin/setup
DELETED