rdoc 7.0.1 → 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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +9 -0
  3. data/README.md +70 -4
  4. data/doc/markup_reference/markdown.md +558 -0
  5. data/doc/markup_reference/rdoc.rdoc +1169 -0
  6. data/lib/rdoc/code_object/class_module.rb +49 -11
  7. data/lib/rdoc/code_object/context/section.rb +20 -1
  8. data/lib/rdoc/cross_reference.rb +30 -21
  9. data/lib/rdoc/generator/darkfish.rb +3 -1
  10. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +1 -1
  11. data/lib/rdoc/generator/template/aliki/class.rhtml +10 -8
  12. data/lib/rdoc/generator/template/aliki/css/rdoc.css +20 -1
  13. data/lib/rdoc/generator/template/aliki/index.rhtml +1 -1
  14. data/lib/rdoc/generator/template/aliki/js/aliki.js +24 -17
  15. data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +1 -1
  16. data/lib/rdoc/generator/template/aliki/js/search_controller.js +9 -0
  17. data/lib/rdoc/generator/template/aliki/page.rhtml +1 -1
  18. data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +1 -1
  19. data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +1 -1
  20. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +1 -1
  21. data/lib/rdoc/generator/template/darkfish/class.rhtml +8 -6
  22. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +19 -0
  23. data/lib/rdoc/markdown.kpeg +1 -5
  24. data/lib/rdoc/markdown.rb +1 -5
  25. data/lib/rdoc/markup/attribute_manager.rb +28 -1
  26. data/lib/rdoc/markup/blank_line.rb +25 -23
  27. data/lib/rdoc/markup/element.rb +21 -0
  28. data/lib/rdoc/markup/hard_break.rb +30 -27
  29. data/lib/rdoc/markup/heading.rb +166 -77
  30. data/lib/rdoc/markup/raw.rb +52 -55
  31. data/lib/rdoc/markup/table.rb +48 -40
  32. data/lib/rdoc/markup/to_html.rb +31 -11
  33. data/lib/rdoc/markup/to_html_crossref.rb +24 -5
  34. data/lib/rdoc/markup/to_label.rb +11 -1
  35. data/lib/rdoc/markup/verbatim.rb +1 -1
  36. data/lib/rdoc/markup.rb +3 -2
  37. data/lib/rdoc/parser/changelog.rb +8 -0
  38. data/lib/rdoc/text.rb +15 -0
  39. data/lib/rdoc/token_stream.rb +4 -8
  40. data/lib/rdoc/version.rb +1 -1
  41. data/rdoc.gemspec +2 -2
  42. metadata +6 -7
  43. data/ExampleMarkdown.md +0 -39
  44. data/ExampleRDoc.rdoc +0 -210
@@ -221,10 +221,15 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
221
221
 
222
222
  def accept_verbatim(verbatim)
223
223
  text = verbatim.text.rstrip
224
+ format = verbatim.format
224
225
 
225
226
  klass = nil
226
227
 
227
- content = if verbatim.ruby? or parseable? text then
228
+ # Apply Ruby syntax highlighting if
229
+ # - explicitly marked as Ruby (via ruby? which accepts :ruby or :rb)
230
+ # - no format specified but the text is parseable as Ruby
231
+ # Otherwise, add language class when applicable and skip Ruby highlighting
232
+ content = if verbatim.ruby? || (format.nil? && parseable?(text))
228
233
  begin
229
234
  tokens = RDoc::Parser::RipperStateLex.parse text
230
235
  klass = ' class="ruby"'
@@ -236,6 +241,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
236
241
  CGI.escapeHTML text
237
242
  end
238
243
  else
244
+ klass = " class=\"#{format}\"" if format
239
245
  CGI.escapeHTML text
240
246
  end
241
247
 
@@ -306,6 +312,13 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
306
312
  level = [6, heading.level].min
307
313
 
308
314
  label = heading.label @code_object
315
+ legacy_label = heading.legacy_label @code_object
316
+
317
+ # Add legacy anchor before the heading for backward compatibility.
318
+ # This allows old links with label- prefix to still work.
319
+ if @options.output_decoration && !@options.pipe
320
+ @res << "\n<span id=\"#{legacy_label}\" class=\"legacy-anchor\"></span>"
321
+ end
309
322
 
310
323
  @res << if @options.output_decoration
311
324
  "\n<h#{level} id=\"#{label}\">"
@@ -362,14 +375,18 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
362
375
  end
363
376
 
364
377
  ##
365
- # Generate a link to +url+ with content +text+. Handles the special cases
366
- # for img: and link: described under handle_regexp_HYPERLINK
378
+ # Generates an HTML link or image tag for the given +url+ and +text+.
379
+ #
380
+ # - Image URLs (http/https/link ending in .gif, .png, .jpg, .jpeg, .bmp)
381
+ # become <img> tags
382
+ # - File references (.rb, .rdoc, .md) are converted to .html paths
383
+ # - Anchor URLs (#foo) pass through unchanged for GitHub-style header linking
384
+ # - Footnote links get wrapped in <sup> tags
367
385
 
368
386
  def gen_url(url, text)
369
387
  scheme, url, id = parse_url url
370
388
 
371
- if %w[http https link].include?(scheme) and
372
- url =~ /\.(gif|png|jpg|jpeg|bmp)$/ then
389
+ if %w[http https link].include?(scheme) && url =~ /\.(gif|png|jpg|jpeg|bmp)\z/
373
390
  "<img src=\"#{url}\" />"
374
391
  else
375
392
  if scheme != 'link' and %r%\A((?!https?:)(?:[^/#]*/)*+)([^/#]+)\.(rb|rdoc|md)(?=\z|#)%i =~ url
@@ -381,9 +398,11 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
381
398
 
382
399
  link = "<a#{id} href=\"#{url}\">#{text}</a>"
383
400
 
384
- link = "<sup>#{link}</sup>" if /"foot/ =~ id
385
-
386
- link
401
+ if /"foot/.match?(id)
402
+ "<sup>#{link}</sup>"
403
+ else
404
+ link
405
+ end
387
406
  end
388
407
  end
389
408
 
@@ -400,9 +419,10 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
400
419
  # Maps attributes to HTML tags
401
420
 
402
421
  def init_tags
403
- add_tag :BOLD, "<strong>", "</strong>"
404
- add_tag :TT, "<code>", "</code>"
405
- add_tag :EM, "<em>", "</em>"
422
+ add_tag :BOLD, "<strong>", "</strong>"
423
+ add_tag :TT, "<code>", "</code>"
424
+ add_tag :EM, "<em>", "</em>"
425
+ add_tag :STRIKE, "<del>", "</del>"
406
426
  end
407
427
 
408
428
  ##
@@ -169,14 +169,33 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
169
169
  end
170
170
 
171
171
  if label
172
+ # Convert label to GitHub-style anchor format
173
+ # First convert + to space (URL encoding), then apply GitHub-style rules
174
+ formatted_label = RDoc::Text.to_anchor(label.tr('+', ' '))
175
+
176
+ # Case 1: Path already has an anchor (e.g., method link)
177
+ # Input: C1#method@label -> path="C1.html#method-i-m"
178
+ # Output: C1.html#method-i-m-label
172
179
  if path =~ /#/
173
- path << "-label-#{label}"
174
- elsif ref&.sections&.any? { |section| label == section.title }
175
- path << "##{label}"
180
+ path << "-#{formatted_label}"
181
+
182
+ # Case 2: Label matches a section title
183
+ # Input: C1@Section -> path="C1.html", section "Section" exists
184
+ # Output: C1.html#section (uses section.aref for GitHub-style)
185
+ elsif (section = ref&.sections&.find { |s| label.tr('+', ' ') == s.title })
186
+ path << "##{section.aref}"
187
+
188
+ # Case 3: Ref has an aref (class/module context)
189
+ # Input: C1@heading -> path="C1.html", ref=C1 class
190
+ # Output: C1.html#class-c1-heading
176
191
  elsif ref.respond_to?(:aref)
177
- path << "##{ref.aref}-label-#{label}"
192
+ path << "##{ref.aref}-#{formatted_label}"
193
+
194
+ # Case 4: No context, just the label (e.g., TopLevel/file)
195
+ # Input: README@section -> path="README_md.html"
196
+ # Output: README_md.html#section
178
197
  else
179
- path << "#label-#{label}"
198
+ path << "##{formatted_label}"
180
199
  end
181
200
  end
182
201
 
@@ -28,11 +28,21 @@ class RDoc::Markup::ToLabel < RDoc::Markup::Formatter
28
28
  end
29
29
 
30
30
  ##
31
- # Converts +text+ to an HTML-safe label
31
+ # Converts +text+ to an HTML-safe label using GitHub-style anchor formatting.
32
32
 
33
33
  def convert(text)
34
34
  label = convert_flow @am.flow text
35
35
 
36
+ RDoc::Text.to_anchor(label)
37
+ end
38
+
39
+ ##
40
+ # Converts +text+ to an HTML-safe label using legacy RDoc formatting.
41
+ # Used for generating backward-compatible anchor aliases.
42
+
43
+ def convert_legacy(text)
44
+ label = convert_flow @am.flow text
45
+
36
46
  CGI.escape(label).gsub('%', '-').sub(/^-/, '')
37
47
  end
38
48
 
@@ -70,7 +70,7 @@ class RDoc::Markup::Verbatim < RDoc::Markup::Raw
70
70
 
71
71
  def ruby?
72
72
  @format ||= nil # TODO for older ri data, switch the tree to marshal_dump
73
- @format == :ruby
73
+ @format == :ruby || @format == :rb
74
74
  end
75
75
 
76
76
  ##
data/lib/rdoc/markup.rb CHANGED
@@ -16,7 +16,7 @@
16
16
  #
17
17
  # - +rdoc+:
18
18
  # the +RDoc+ markup format;
19
- # see RDoc::MarkupReference.
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::MarkupReference.
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
@@ -210,6 +210,7 @@ https://github.com/ruby/rdoc/issues
210
210
  autoload :BlankLine, "#{__dir__}/markup/blank_line"
211
211
  autoload :BlockQuote, "#{__dir__}/markup/block_quote"
212
212
  autoload :Document, "#{__dir__}/markup/document"
213
+ autoload :Element, "#{__dir__}/markup/element"
213
214
  autoload :HardBreak, "#{__dir__}/markup/hard_break"
214
215
  autoload :Heading, "#{__dir__}/markup/heading"
215
216
  autoload :Include, "#{__dir__}/markup/include"
@@ -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
@@ -45,13 +45,7 @@ module RDoc::TokenStream
45
45
  then 'ruby-identifier'
46
46
  end
47
47
 
48
- comment_with_nl = false
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
- "<span class=\"#{style}\">#{text}</span>#{"\n" if comment_with_nl}"
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
@@ -5,6 +5,6 @@ module RDoc
5
5
  ##
6
6
  # RDoc version you are using
7
7
 
8
- VERSION = '7.0.1'
8
+ VERSION = '7.1.0'
9
9
 
10
10
  end
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
- "ExampleMarkdown.md",
44
- "ExampleRDoc.rdoc",
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.1
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: 2025-12-18 00:00:00.000000000 Z
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
@@ -234,6 +232,7 @@ files:
234
232
  - lib/rdoc/markup/blank_line.rb
235
233
  - lib/rdoc/markup/block_quote.rb
236
234
  - lib/rdoc/markup/document.rb
235
+ - lib/rdoc/markup/element.rb
237
236
  - lib/rdoc/markup/formatter.rb
238
237
  - lib/rdoc/markup/hard_break.rb
239
238
  - lib/rdoc/markup/heading.rb
@@ -324,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
324
323
  - !ruby/object:Gem::Version
325
324
  version: '2.2'
326
325
  requirements: []
327
- rubygems_version: 3.6.9
326
+ rubygems_version: 4.0.3
328
327
  specification_version: 4
329
328
  summary: RDoc produces HTML and command-line documentation for Ruby projects
330
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
-