rdoc 7.0.3 → 7.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/README.md +70 -4
- data/doc/markup_reference/markdown.md +558 -0
- data/doc/markup_reference/rdoc.rdoc +1169 -0
- data/lib/rdoc/code_object/class_module.rb +24 -3
- data/lib/rdoc/code_object/context/section.rb +20 -1
- data/lib/rdoc/cross_reference.rb +30 -21
- data/lib/rdoc/generator/template/aliki/class.rhtml +3 -1
- data/lib/rdoc/generator/template/aliki/css/rdoc.css +20 -0
- data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +1 -1
- data/lib/rdoc/generator/template/darkfish/class.rhtml +2 -0
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +19 -0
- data/lib/rdoc/markdown.kpeg +1 -5
- data/lib/rdoc/markdown.rb +1 -5
- data/lib/rdoc/markup/attribute_manager.rb +28 -1
- data/lib/rdoc/markup/heading.rb +99 -27
- data/lib/rdoc/markup/to_html.rb +31 -11
- data/lib/rdoc/markup/to_html_crossref.rb +24 -5
- data/lib/rdoc/markup/to_label.rb +11 -1
- data/lib/rdoc/markup/verbatim.rb +1 -1
- data/lib/rdoc/markup.rb +2 -2
- data/lib/rdoc/parser/changelog.rb +8 -0
- data/lib/rdoc/text.rb +15 -0
- data/lib/rdoc/token_stream.rb +4 -8
- data/lib/rdoc/version.rb +1 -1
- data/rdoc.gemspec +2 -2
- metadata +5 -7
- data/ExampleMarkdown.md +0 -39
- data/ExampleRDoc.rdoc +0 -210
data/lib/rdoc/markup.rb
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
#
|
|
17
17
|
# - +rdoc+:
|
|
18
18
|
# the +RDoc+ markup format;
|
|
19
|
-
# see RDoc
|
|
19
|
+
# see {RDoc Markup Reference}[rdoc-ref:doc/markup_reference/rdoc.rdoc]
|
|
20
20
|
# - +markdown+:
|
|
21
21
|
# The +markdown+ markup format as described in
|
|
22
22
|
# the {Markdown Guide}[https://www.markdownguide.org];
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
#
|
|
103
103
|
# = \RDoc Markup Reference
|
|
104
104
|
#
|
|
105
|
-
# See RDoc
|
|
105
|
+
# See {RDoc Markup Reference}[rdoc-ref:doc/markup_reference/rdoc.rdoc]
|
|
106
106
|
#
|
|
107
107
|
#--
|
|
108
108
|
# Original Author:: Dave Thomas, dave@pragmaticprogrammer.com
|
|
@@ -293,6 +293,10 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
|
|
|
293
293
|
end
|
|
294
294
|
|
|
295
295
|
def aref
|
|
296
|
+
commit
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
def legacy_aref
|
|
296
300
|
"label-#{commit}"
|
|
297
301
|
end
|
|
298
302
|
|
|
@@ -300,6 +304,10 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
|
|
|
300
304
|
aref
|
|
301
305
|
end
|
|
302
306
|
|
|
307
|
+
def legacy_label(context = nil)
|
|
308
|
+
legacy_aref
|
|
309
|
+
end
|
|
310
|
+
|
|
303
311
|
def text
|
|
304
312
|
case base
|
|
305
313
|
when nil
|
data/lib/rdoc/text.rb
CHANGED
|
@@ -319,4 +319,19 @@ module RDoc::Text
|
|
|
319
319
|
|
|
320
320
|
SPACE_SEPARATED_LETTER_CLASS = /[\p{Nd}\p{Lc}\p{Pc}]|[!-~&&\W]/
|
|
321
321
|
|
|
322
|
+
##
|
|
323
|
+
# Converts +text+ to a GitHub-style anchor ID:
|
|
324
|
+
# - Lowercase
|
|
325
|
+
# - Remove characters that aren't alphanumeric, space, or hyphen
|
|
326
|
+
# - Replace spaces with hyphens
|
|
327
|
+
#
|
|
328
|
+
# Examples:
|
|
329
|
+
# "Hello World" -> "hello-world"
|
|
330
|
+
# "Foo::Bar" -> "foobar"
|
|
331
|
+
# "What's New?" -> "whats-new"
|
|
332
|
+
|
|
333
|
+
module_function def to_anchor(text)
|
|
334
|
+
text.downcase.gsub(/[^a-z0-9 \-]/, '').gsub(' ', '-')
|
|
335
|
+
end
|
|
336
|
+
|
|
322
337
|
end
|
data/lib/rdoc/token_stream.rb
CHANGED
|
@@ -45,13 +45,7 @@ module RDoc::TokenStream
|
|
|
45
45
|
then 'ruby-identifier'
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
if :on_comment == t[:kind] or :on_embdoc == t[:kind] or :on_heredoc_end == t[:kind]
|
|
50
|
-
comment_with_nl = true if "\n" == t[:text][-1]
|
|
51
|
-
text = t[:text].rstrip
|
|
52
|
-
else
|
|
53
|
-
text = t[:text]
|
|
54
|
-
end
|
|
48
|
+
text = t[:text]
|
|
55
49
|
|
|
56
50
|
if :on_ident == t[:kind] && starting_title
|
|
57
51
|
starting_title = false
|
|
@@ -65,7 +59,9 @@ module RDoc::TokenStream
|
|
|
65
59
|
text = CGI.escapeHTML text
|
|
66
60
|
|
|
67
61
|
if style then
|
|
68
|
-
|
|
62
|
+
end_with_newline = text.end_with?("\n")
|
|
63
|
+
text = text.chomp if end_with_newline
|
|
64
|
+
"<span class=\"#{style}\">#{text}</span>#{"\n" if end_with_newline}"
|
|
69
65
|
else
|
|
70
66
|
text
|
|
71
67
|
end
|
data/lib/rdoc/version.rb
CHANGED
data/rdoc.gemspec
CHANGED
|
@@ -40,8 +40,8 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat
|
|
|
40
40
|
non_lib_files = [
|
|
41
41
|
"CONTRIBUTING.md",
|
|
42
42
|
"CVE-2013-0256.rdoc",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
43
|
+
"doc/markup_reference/markdown.md",
|
|
44
|
+
"doc/markup_reference/rdoc.rdoc",
|
|
45
45
|
"History.rdoc",
|
|
46
46
|
"LEGAL.rdoc",
|
|
47
47
|
"LICENSE.rdoc",
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rdoc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.0
|
|
4
|
+
version: 7.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Hodel
|
|
@@ -13,7 +13,7 @@ authors:
|
|
|
13
13
|
- ITOYANAGI Sakura
|
|
14
14
|
bindir: exe
|
|
15
15
|
cert_chain: []
|
|
16
|
-
date:
|
|
16
|
+
date: 2026-01-13 00:00:00.000000000 Z
|
|
17
17
|
dependencies:
|
|
18
18
|
- !ruby/object:Gem::Dependency
|
|
19
19
|
name: psych
|
|
@@ -75,8 +75,6 @@ extensions: []
|
|
|
75
75
|
extra_rdoc_files:
|
|
76
76
|
- CONTRIBUTING.md
|
|
77
77
|
- CVE-2013-0256.rdoc
|
|
78
|
-
- ExampleMarkdown.md
|
|
79
|
-
- ExampleRDoc.rdoc
|
|
80
78
|
- History.rdoc
|
|
81
79
|
- LEGAL.rdoc
|
|
82
80
|
- LICENSE.rdoc
|
|
@@ -86,14 +84,14 @@ extra_rdoc_files:
|
|
|
86
84
|
files:
|
|
87
85
|
- CONTRIBUTING.md
|
|
88
86
|
- CVE-2013-0256.rdoc
|
|
89
|
-
- ExampleMarkdown.md
|
|
90
|
-
- ExampleRDoc.rdoc
|
|
91
87
|
- History.rdoc
|
|
92
88
|
- LEGAL.rdoc
|
|
93
89
|
- LICENSE.rdoc
|
|
94
90
|
- README.md
|
|
95
91
|
- RI.md
|
|
96
92
|
- TODO.rdoc
|
|
93
|
+
- doc/markup_reference/markdown.md
|
|
94
|
+
- doc/markup_reference/rdoc.rdoc
|
|
97
95
|
- exe/rdoc
|
|
98
96
|
- exe/ri
|
|
99
97
|
- lib/rdoc.rb
|
|
@@ -325,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
325
323
|
- !ruby/object:Gem::Version
|
|
326
324
|
version: '2.2'
|
|
327
325
|
requirements: []
|
|
328
|
-
rubygems_version:
|
|
326
|
+
rubygems_version: 4.0.3
|
|
329
327
|
specification_version: 4
|
|
330
328
|
summary: RDoc produces HTML and command-line documentation for Ruby projects
|
|
331
329
|
test_files: []
|
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
|
-
|