rdoc 6.17.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 (169) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +193 -0
  3. data/LEGAL.rdoc +6 -0
  4. data/LICENSE.rdoc +4 -0
  5. data/README.md +132 -8
  6. data/RI.md +75 -75
  7. data/doc/markup_reference/markdown.md +659 -0
  8. data/doc/markup_reference/rdoc.rdoc +1169 -0
  9. data/exe/rdoc +2 -2
  10. data/lib/rdoc/code_object/alias.rb +70 -74
  11. data/lib/rdoc/code_object/any_method.rb +308 -293
  12. data/lib/rdoc/code_object/attr.rb +150 -142
  13. data/lib/rdoc/code_object/class_module.rb +802 -715
  14. data/lib/rdoc/code_object/constant.rb +181 -144
  15. data/lib/rdoc/code_object/context/section.rb +140 -130
  16. data/lib/rdoc/code_object/context.rb +925 -941
  17. data/lib/rdoc/code_object/extend.rb +7 -5
  18. data/lib/rdoc/code_object/include.rb +7 -5
  19. data/lib/rdoc/code_object/method_attr.rb +328 -315
  20. data/lib/rdoc/code_object/mixin.rb +97 -92
  21. data/lib/rdoc/code_object/normal_class.rb +77 -78
  22. data/lib/rdoc/code_object/normal_module.rb +61 -59
  23. data/lib/rdoc/code_object/require.rb +23 -39
  24. data/lib/rdoc/code_object/single_class.rb +21 -19
  25. data/lib/rdoc/code_object/top_level.rb +215 -202
  26. data/lib/rdoc/code_object.rb +305 -305
  27. data/lib/rdoc/comment.rb +274 -337
  28. data/lib/rdoc/cross_reference.rb +195 -206
  29. data/lib/rdoc/encoding.rb +105 -103
  30. data/lib/rdoc/erb_partial.rb +13 -11
  31. data/lib/rdoc/erbio.rb +29 -27
  32. data/lib/rdoc/generator/aliki.rb +196 -30
  33. data/lib/rdoc/generator/darkfish.rb +647 -629
  34. data/lib/rdoc/generator/json_index.rb +233 -229
  35. data/lib/rdoc/generator/markup.rb +165 -122
  36. data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
  37. data/lib/rdoc/generator/pot/po.rb +52 -51
  38. data/lib/rdoc/generator/pot/po_entry.rb +138 -132
  39. data/lib/rdoc/generator/pot.rb +85 -81
  40. data/lib/rdoc/generator/ri.rb +23 -19
  41. data/lib/rdoc/generator/template/aliki/DESIGN.md +538 -0
  42. data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +1 -1
  43. data/lib/rdoc/generator/template/aliki/_footer.rhtml +2 -2
  44. data/lib/rdoc/generator/template/aliki/_head.rhtml +15 -10
  45. data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
  46. data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +8 -6
  47. data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +8 -6
  48. data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +1 -1
  49. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +3 -3
  50. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +3 -3
  51. data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +1 -1
  52. data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +1 -1
  53. data/lib/rdoc/generator/template/aliki/class.rhtml +71 -61
  54. data/lib/rdoc/generator/template/aliki/css/rdoc.css +796 -323
  55. data/lib/rdoc/generator/template/aliki/index.rhtml +1 -1
  56. data/lib/rdoc/generator/template/aliki/js/aliki.js +119 -113
  57. data/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
  58. data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +1 -1
  59. data/lib/rdoc/generator/template/aliki/js/{search.js → search_controller.js} +16 -7
  60. data/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
  61. data/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
  62. data/lib/rdoc/generator/template/aliki/page.rhtml +1 -1
  63. data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +1 -1
  64. data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +2 -2
  65. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
  66. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +8 -6
  67. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +8 -6
  68. data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +1 -1
  69. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +2 -2
  70. data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +1 -1
  71. data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +5 -5
  72. data/lib/rdoc/generator/template/darkfish/class.rhtml +29 -32
  73. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +19 -1
  74. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +3 -3
  75. data/lib/rdoc/generator.rb +48 -46
  76. data/lib/rdoc/i18n/locale.rb +99 -95
  77. data/lib/rdoc/i18n/text.rb +109 -105
  78. data/lib/rdoc/i18n.rb +7 -5
  79. data/lib/rdoc/markdown/byte_runtime.rb +80 -0
  80. data/lib/rdoc/markdown.kpeg +52 -33
  81. data/lib/rdoc/markdown.rb +365 -177
  82. data/lib/rdoc/markup/blank_line.rb +25 -23
  83. data/lib/rdoc/markup/block_quote.rb +12 -8
  84. data/lib/rdoc/markup/document.rb +127 -123
  85. data/lib/rdoc/markup/element.rb +21 -0
  86. data/lib/rdoc/markup/formatter.rb +220 -203
  87. data/lib/rdoc/markup/hard_break.rb +30 -27
  88. data/lib/rdoc/markup/heading.rb +163 -77
  89. data/lib/rdoc/markup/include.rb +33 -29
  90. data/lib/rdoc/markup/indented_paragraph.rb +37 -33
  91. data/lib/rdoc/markup/inline_parser.rb +316 -0
  92. data/lib/rdoc/markup/list.rb +80 -88
  93. data/lib/rdoc/markup/list_item.rb +73 -85
  94. data/lib/rdoc/markup/paragraph.rb +23 -19
  95. data/lib/rdoc/markup/parser.rb +501 -497
  96. data/lib/rdoc/markup/pre_process.rb +284 -305
  97. data/lib/rdoc/markup/raw.rb +52 -55
  98. data/lib/rdoc/markup/rule.rb +16 -12
  99. data/lib/rdoc/markup/table.rb +48 -40
  100. data/lib/rdoc/markup/to_ansi.rb +143 -92
  101. data/lib/rdoc/markup/to_bs.rb +86 -102
  102. data/lib/rdoc/markup/to_html.rb +608 -506
  103. data/lib/rdoc/markup/to_html_crossref.rb +219 -210
  104. data/lib/rdoc/markup/to_html_snippet.rb +210 -205
  105. data/lib/rdoc/markup/to_joined_paragraph.rb +40 -41
  106. data/lib/rdoc/markup/to_label.rb +64 -51
  107. data/lib/rdoc/markup/to_markdown.rb +212 -184
  108. data/lib/rdoc/markup/to_rdoc.rb +341 -277
  109. data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
  110. data/lib/rdoc/markup/to_test.rb +62 -50
  111. data/lib/rdoc/markup/to_tt_only.rb +83 -92
  112. data/lib/rdoc/markup/verbatim.rb +62 -58
  113. data/lib/rdoc/markup.rb +196 -215
  114. data/lib/rdoc/options.rb +1063 -1076
  115. data/lib/rdoc/parser/c.rb +1039 -1036
  116. data/lib/rdoc/parser/changelog.rb +320 -287
  117. data/lib/rdoc/parser/markdown.rb +17 -13
  118. data/lib/rdoc/parser/rbs.rb +279 -0
  119. data/lib/rdoc/parser/rd.rb +17 -13
  120. data/lib/rdoc/parser/ruby.rb +1231 -2222
  121. data/lib/rdoc/parser/ruby_colorizer.rb +303 -0
  122. data/lib/rdoc/parser/simple.rb +31 -27
  123. data/lib/rdoc/parser/text.rb +12 -8
  124. data/lib/rdoc/parser.rb +230 -221
  125. data/lib/rdoc/rbs_helper.rb +186 -0
  126. data/lib/rdoc/rd/inline.rb +57 -53
  127. data/lib/rdoc/rd.rb +90 -88
  128. data/lib/rdoc/rdoc.rb +547 -366
  129. data/lib/rdoc/ri/driver.rb +1141 -1130
  130. data/lib/rdoc/ri/formatter.rb +7 -3
  131. data/lib/rdoc/ri/paths.rb +140 -136
  132. data/lib/rdoc/ri/servlet.rb +456 -0
  133. data/lib/rdoc/ri/store.rb +4 -2
  134. data/lib/rdoc/ri/task.rb +55 -51
  135. data/lib/rdoc/ri.rb +14 -11
  136. data/lib/rdoc/rubygems_hook.rb +194 -192
  137. data/lib/rdoc/server.rb +462 -0
  138. data/lib/rdoc/stats/normal.rb +46 -42
  139. data/lib/rdoc/stats/quiet.rb +39 -35
  140. data/lib/rdoc/stats/verbose.rb +35 -31
  141. data/lib/rdoc/stats.rb +363 -338
  142. data/lib/rdoc/store.rb +919 -725
  143. data/lib/rdoc/task.rb +260 -255
  144. data/lib/rdoc/text.rb +164 -240
  145. data/lib/rdoc/token_stream.rb +88 -106
  146. data/lib/rdoc/tom_doc.rb +203 -201
  147. data/lib/rdoc/version.rb +1 -1
  148. data/lib/rdoc.rb +35 -7
  149. data/lib/rubygems_plugin.rb +2 -11
  150. data/rdoc-logo.svg +43 -0
  151. data/rdoc.gemspec +9 -7
  152. metadata +46 -32
  153. data/CONTRIBUTING.rdoc +0 -219
  154. data/ExampleMarkdown.md +0 -39
  155. data/ExampleRDoc.rdoc +0 -210
  156. data/lib/rdoc/code_object/anon_class.rb +0 -10
  157. data/lib/rdoc/code_object/ghost_method.rb +0 -6
  158. data/lib/rdoc/code_object/meta_method.rb +0 -6
  159. data/lib/rdoc/markdown/literals.kpeg +0 -21
  160. data/lib/rdoc/markdown/literals.rb +0 -454
  161. data/lib/rdoc/markup/attr_changer.rb +0 -22
  162. data/lib/rdoc/markup/attr_span.rb +0 -35
  163. data/lib/rdoc/markup/attribute_manager.rb +0 -405
  164. data/lib/rdoc/markup/attributes.rb +0 -70
  165. data/lib/rdoc/markup/regexp_handling.rb +0 -40
  166. data/lib/rdoc/parser/prism_ruby.rb +0 -1100
  167. data/lib/rdoc/parser/ripper_state_lex.rb +0 -302
  168. data/lib/rdoc/parser/ruby_tools.rb +0 -163
  169. data/lib/rdoc/servlet.rb +0 -452
data/ExampleMarkdown.md DELETED
@@ -1,39 +0,0 @@
1
- # Example Markdown
2
-
3
- This document contains example output to show RDoc styling. This file was
4
- created from a Markdown file.
5
-
6
- For the following styles, see ExampleRDoc.rdoc for style examples:
7
-
8
- * Headings
9
- * Paragraphs
10
- * Code blocks (verbatim sections)
11
- * Definition lists
12
- * Ordered lists
13
- * Unordered lists
14
-
15
- These items all use the same styles as RDoc format files.
16
-
17
- ## Footnotes
18
-
19
- Footnotes are rendered at the bottom of the documentation section[^1]. For
20
- pages this will be at the bottom of the page. For method documentation this
21
- will be at the end of the current method.
22
-
23
- [^1]: Here is the footnote content. As you can see it is at the bottom of the
24
- page.
25
-
26
- ## Blockquotes
27
-
28
- Here is how a blockquote looks.
29
-
30
- > We finished our first sensor sweep of the neutral zone. Now, how the hell do
31
- > we defeat an enemy that knows us better than we know ourselves? and attack
32
- > the Romulans.
33
- >
34
- > > Sorry, Data. I guess it's better to be lucky than good. The unexpected is
35
- > > our normal routine. Could someone survive inside a transporter buffer for
36
- > > 75 years?
37
-
38
- This text is from [Riker Ipsum](http://rikeripsum.com)
39
-
data/ExampleRDoc.rdoc DELETED
@@ -1,210 +0,0 @@
1
- = Example \RDoc
2
-
3
- This document contains example output to show RDoc styling. This file was
4
- created from a RDoc Markup file.
5
-
6
- == Headings
7
-
8
- You should not use headings beyond level 3, it is a sign of poor organization
9
- of your code or documentation. It also becomes difficult for the user to
10
- figure out what you are attempting to explain to them as they have to track
11
- the multiple layers of nesting.
12
-
13
- = Heading level 1
14
-
15
- Above is a level one heading.
16
-
17
- These paragraphs are filler that exist so you can see how the heading
18
- interacts with paragraphs before and after the heading. As you can see each
19
- different heading has a different amount of margin above and below.
20
-
21
- This should be sufficient to give you a proper picture of how it will appear in
22
- your documentation.
23
-
24
- == Heading level 2
25
-
26
- Above is a level two heading.
27
-
28
- These paragraphs are filler that exist so you can see how the heading
29
- interacts with paragraphs before and after the heading. As you can see each
30
- different heading has a different amount of margin above and below.
31
-
32
- This should be sufficient to give you a proper picture of how it will appear in
33
- your documentation.
34
-
35
- === Heading level 3
36
-
37
- Above is a level three heading.
38
-
39
- These paragraphs are filler that exist so you can see how the heading
40
- interacts with paragraphs before and after the heading. As you can see each
41
- different heading has a different amount of margin above and below.
42
-
43
- This should be sufficient to give you a proper picture of how it will appear in
44
- your documentation.
45
-
46
- ==== Heading level 4
47
-
48
- Above is a level four heading.
49
-
50
- These paragraphs are filler that exist so you can see how the heading
51
- interacts with paragraphs before and after the heading. As you can see each
52
- different heading has a different amount of margin above and below.
53
-
54
- This should be sufficient to give you a proper picture of how it will appear in
55
- your documentation.
56
-
57
- ===== Heading level 5
58
-
59
- Above is a level five heading.
60
-
61
- These paragraphs are filler that exist so you can see how the heading
62
- interacts with paragraphs before and after the heading. As you can see each
63
- different heading has a different amount of margin above and below.
64
-
65
- This should be sufficient to give you a proper picture of how it will appear in
66
- your documentation.
67
-
68
- ====== Heading level 6
69
-
70
- Above is a level six heading.
71
-
72
- These paragraphs are filler that exist so you can see how the heading
73
- interacts with paragraphs before and after the heading. As you can see each
74
- different heading has a different amount of margin above and below.
75
-
76
- This should be sufficient to give you a proper picture of how it will appear in
77
- your documentation.
78
-
79
- == Paragraphs
80
-
81
- This is how a paragraph looks. Since it is difficult to generate good content
82
- for paragraphs I have chosen to use {Riker Ipsum}[http://rikeripsum.com] for
83
- nonsense filler content. In the previous sentence you can see how a link is
84
- formatted.
85
-
86
- Here is an example of *bold* and _emphasis_ styling. Try not to combine the
87
- two or use them too often. Here is an example of <code>inline verbatim
88
- text</code>. That should be enough of a taste of inline markup in paragraphs.
89
- The Riker Ipsum filler follows:
90
-
91
- Shields up! Rrrrred alert! Well, I'll say this for him - he's sure of himself.
92
- and attack the Romulans. Worf, It's better than music. It's jazz. This should
93
- be interesting. When has justice ever been as simple as a rule book? Flair is
94
- what marks the difference between artistry and mere competence.
95
-
96
- Sorry, Data. I think you've let your personal feelings cloud your judgement. We
97
- finished our first sensor sweep of the neutral zone. Yes, absolutely, I do
98
- indeed concur, wholeheartedly! Mr. Worf, you do remember how to fire phasers? A
99
- lot of things can change in twelve years, Admiral. Your shields were failing,
100
- sir.
101
-
102
- == Verbatim sections
103
-
104
- A verbatim section typically contains source code or example output. This is
105
- how verbatim blocks of code looks:
106
-
107
- def local responder
108
- responder.ping do |value|
109
- return value
110
- end
111
- end
112
-
113
- def ping uri
114
- @uri = uri
115
- @remote = DRb::DRbObject.new_with_uri @uri
116
-
117
- @remote.ping do |value|
118
- return value
119
- end
120
- end
121
-
122
- This is a paragraph following the verbatim block so you can see how leading and trailing paragraphs interact with it.
123
-
124
- == Unordered lists
125
-
126
- Here is an unordered list. As you can see it uses non-numeral markers for each list item:
127
-
128
- * This is the top-most item in the list.
129
- * This is a second item in the list.
130
-
131
- Unlike the first item, this item has more than one paragraph so you can see
132
- how they interact.
133
- * This is a third item in the list. Like the item before it, this item has a
134
- second paragraph.
135
-
136
- Here is the second paragraph in the list item.
137
- * A final list item.
138
-
139
- == Ordered lists
140
-
141
- Here is an ordered list. As you can see it uses numeral markers for each list
142
- item:
143
-
144
- 1. This is the first item in the list.
145
- 1. This is the second item in the list.
146
-
147
- Unlike the first item, this item has more than one paragraph so you can see
148
- how they interact.
149
- 1. This is the third item in the list. Like the item before it, this item has
150
- a second paragraph.
151
-
152
- Here is the second paragraph in the third list item.
153
- 1. The fourth and final list item.
154
-
155
- == Definition lists
156
-
157
- === "Note" list
158
-
159
- The "note" syntax can be used to create a definition list:
160
-
161
- note::
162
- description
163
-
164
- Here is such a definition list:
165
-
166
- cat::
167
- A cat is a small mammal that is commonly kept as a pet.
168
-
169
- dog::
170
- A dog is a mammal that is also kept as a pet. A dog may range in size from
171
- smaller than a cat to larger than a human.
172
-
173
- Typically dogs are easier to train to respond to commands than cats.
174
-
175
- rabbit::
176
- Rabbits are also mammals, but are infrequently kept as pets. Most rabbits
177
- are wild.
178
-
179
- === "Label" list
180
-
181
- The "label" syntax can be used to create a definition list:
182
-
183
- [label]
184
- description
185
-
186
- Here is such a definition list:
187
-
188
- [cat]
189
- A cat is a small mammal that is commonly kept as a pet.
190
-
191
- [dog]
192
- A dog is a mammal that is also kept as a pet. A dog may range in size from
193
- smaller than a cat to larger than a human.
194
-
195
- Typically dogs are easier to train to respond to commands than cats.
196
-
197
- [rabbit]
198
- Rabbits are also mammals, but are infrequently kept as pets. Most rabbits
199
- are wild.
200
-
201
- == Rule
202
-
203
- A rule is a horizontal divider between two paragraphs. Following this
204
- paragraph is a rule.
205
-
206
- ---
207
-
208
- In historic versions of RDoc you could control the height of the rule in HTML
209
- output. This is no longer true as HTML 5 does not support this.
210
-
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
- ##
3
- # An anonymous class like:
4
- #
5
- # c = Class.new do end
6
- #
7
- # AnonClass is currently not used.
8
-
9
- class RDoc::AnonClass < RDoc::ClassModule
10
- end
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
- ##
3
- # GhostMethod represents a method referenced only by a comment
4
-
5
- class RDoc::GhostMethod < RDoc::AnyMethod
6
- end
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
- ##
3
- # MetaMethod represents a meta-programmed method
4
-
5
- class RDoc::MetaMethod < RDoc::AnyMethod
6
- end
@@ -1,21 +0,0 @@
1
- %% name = RDoc::Markdown::Literals
2
-
3
- %% header {
4
- # coding: UTF-8
5
- # frozen_string_literal: true
6
- # :markup: markdown
7
-
8
- ##
9
- # This set of literals is for Ruby 1.9 regular expressions and gives full
10
- # unicode support.
11
- #
12
- # Unlike peg-markdown, this set of literals recognizes Unicode alphanumeric
13
- # characters, newlines and spaces.
14
- }
15
-
16
- Alphanumeric = /\p{Word}/
17
- AlphanumericAscii = /[A-Za-z0-9]/
18
- BOM = "\uFEFF"
19
- Newline = /\n|\r\n?|\p{Zl}|\p{Zp}/
20
- NonAlphanumeric = /\p{^Word}/
21
- Spacechar = /\t|\p{Zs}/