Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c026453

Browse files
[DOC] Add some links in intro; delimit rendered HTML output. (#904)
1 parent b00978b commit c026453

File tree

1 file changed

+79
-54
lines changed

1 file changed

+79
-54
lines changed

doc/rdoc/markup_reference.rb

Lines changed: 79 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,28 @@
99
#
1010
# = \RDoc Markup Reference
1111
#
12-
# [Note]
12+
# Notes:
1313
#
14-
# Examples in this reference are Ruby code and comments.
15-
# Certain differences among the sources are noted.
14+
# - Examples in this reference are Ruby code and comments;
15+
# certain differences from other sources
16+
# (such as C code and comments) are noted.
17+
# - An example that shows rendered HTML output
18+
# displays that output in a blockquote:
19+
#
20+
# Rendered HTML:
21+
# >>>
22+
# Some stuff
1623
#
1724
# \RDoc-generated documentation is derived from and controlled by:
1825
#
19-
# - Single-line or multi-line comments that precede certain definitions.
20-
# - \RDoc directives in trailing comments (on the same line as code).
21-
# - The Ruby code itself.
26+
# - Single-line or multi-line comments that precede certain definitions;
27+
# see {Markup in Comments}[rdoc-ref:RDoc::MarkupReference@Markup+in+Comments].
28+
# - \RDoc directives in trailing comments (on the same line as code);
29+
# see <tt>:nodoc:</tt>, <tt>:doc:</tt>, and <tt>:notnew</tt>.
30+
# - \RDoc directives in single-line comments;
31+
# see other {Directives}[rdoc-ref:RDoc::MarkupReference@Directives].
32+
# - The Ruby code itself;
33+
# see {Documentation Derived from Ruby Code}[rdoc-ref:RDoc::MarkupReference@Documentation+Derived+from+Ruby+Code]
2234
#
2335
# == Markup in Comments
2436
#
@@ -76,12 +88,12 @@
7688
# # You'll love it.
7789
#
7890
# Rendered HTML:
91+
# >>>
92+
# \RDoc produces HTML and command-line documentation for Ruby projects.
93+
# \RDoc includes the rdoc and ri tools for generating and displaying
94+
# documentation from the command-line.
7995
#
80-
# \RDoc produces HTML and command-line documentation for Ruby projects.
81-
# \RDoc includes the rdoc and ri tools for generating and displaying
82-
# documentation from the command-line.
83-
#
84-
# You'll love it.
96+
# You'll love it.
8597
#
8698
# A paragraph may contain nested blocks, including:
8799
#
@@ -113,16 +125,17 @@
113125
# # This is not verbatim text.
114126
#
115127
# Rendered HTML:
128+
# >>>
129+
# This is not verbatim text.
116130
#
117-
# This is not verbatim text.
118-
#
119-
# This is verbatim text.
120-
# Whitespace is honored. # See?
131+
# This is verbatim text.
121132
# Whitespace is honored. # See?
133+
# Whitespace is honored. # See?
122134
#
123-
# This is still the same verbatim text block.
135+
# This is still the same verbatim text block.
136+
#
137+
# This is not verbatim text.
124138
#
125-
# This is not verbatim text.
126139
# ==== Code Blocks
127140
#
128141
# A special case of verbatim text is the <em>code block</em>,
@@ -134,12 +147,24 @@
134147
# - Has a contrasting background color.
135148
# - Has syntax highlighting.
136149
#
137-
# Example:
150+
# Example input:
138151
#
139-
# def foo(name = '', value = 0)
140-
# @name = name # Whitespace is still honored.
141-
# @value = value
142-
# end
152+
# Consider this method:
153+
#
154+
# def foo(name = '', value = 0)
155+
# @name = name # Whitespace is still honored.
156+
# @value = value
157+
# end
158+
#
159+
#
160+
# Rendered HTML:
161+
# >>>
162+
# Consider this method:
163+
#
164+
# def foo(name = '', value = 0)
165+
# @name = name # Whitespace is still honored.
166+
# @value = value
167+
# end
143168
#
144169
# Pro tip: If your indented Ruby code does not get highlighted,
145170
# it may contain a syntax error.
@@ -180,14 +205,14 @@
180205
# # - Last one.
181206
#
182207
# Rendered HTML:
208+
# >>>
209+
# - An item.
210+
# - Another.
211+
# - An item spanning
212+
# multiple lines.
183213
#
184-
# - An item.
185-
# - Another.
186-
# - An item spanning
187-
# multiple lines.
188-
#
189-
# * Yet another.
190-
# - Last one.
214+
# * Yet another.
215+
# - Last one.
191216
#
192217
# ===== Numbered Lists
193218
#
@@ -206,14 +231,14 @@
206231
# # 1000. Last one.
207232
#
208233
# Rendered HTML:
234+
# >>>
235+
# 100. An item.
236+
# 10. Another.
237+
# 1. An item spanning
238+
# multiple lines.
209239
#
210-
# 100. An item.
211-
# 10. Another.
212-
# 1. An item spanning
213-
# multiple lines.
214-
#
215-
# 1. Yet another.
216-
# 1000. Last one.
240+
# 1. Yet another.
241+
# 1000. Last one.
217242
#
218243
# ===== Lettered Lists
219244
#
@@ -232,12 +257,12 @@
232257
# # a. Last one.
233258
#
234259
# Rendered HTML:
260+
# >>>
261+
# z. An item.
262+
# y. Another.
235263
#
236-
# z. An item.
237-
# y. Another.
238-
#
239-
# x. Yet another.
240-
# a. Last one.
264+
# x. Yet another.
265+
# a. Last one.
241266
#
242267
# ===== Labeled Lists
243268
#
@@ -257,14 +282,14 @@
257282
# # bam:: Last one.
258283
#
259284
# Rendered HTML:
285+
# >>>
286+
# [foo] An item.
287+
# bat:: Another.
288+
# [bag] An item spanning
289+
# multiple lines.
260290
#
261-
# [foo] An item.
262-
# bat:: Another.
263-
# [bag] An item spanning
264-
# multiple lines.
265-
#
266-
# [bar baz] Yet another.
267-
# bam:: Last one.
291+
# [bar baz] Yet another.
292+
# bam:: Last one.
268293
#
269294
# ===== Blocks Nested in Lists
270295
#
@@ -313,15 +338,15 @@
313338
# # ---
314339
#
315340
# Rendered HTML:
341+
# >>>
342+
# ------
343+
# Stuff between.
316344
#
317-
# ------
318-
# Stuff between.
319-
#
320-
# \--- Not a horizontal rule.
345+
# \--- Not a horizontal rule.
321346
#
322-
# -- Also not a horizontal rule.
347+
# -- Also not a horizontal rule.
323348
#
324-
# ---
349+
# ---
325350
#
326351
# ==== Directives
327352
#

0 commit comments

Comments
 (0)