Skip to content

Commit 6888da5

Browse files
nobuparacycle
authored andcommitted
[DOC] Extract repeated references
1 parent ee52a93 commit 6888da5

1 file changed

Lines changed: 71 additions & 48 deletions

File tree

doc/language/options.md

Lines changed: 71 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ nil
6161

6262
See also:
6363

64-
- {Option -a}[rdoc-ref:@-a+Split+Input+Lines+into+Fields]:
64+
- [Option `-a`][-a]:
6565
Split input lines into fields.
66-
- {Option -F}[rdoc-ref:@-F+Set+Input+Field+Separator]:
66+
- [Option `-F`][-F]:
6767
Set input field separator.
68-
- {Option -l}[rdoc-ref:@-l+Set+Output+Record+Separator+Chop+Lines]:
68+
- [Option `-l`][-l]:
6969
Set output record separator; chop lines.
70-
- {Option -n}[rdoc-ref:@-n+Run+Program+in+gets+Loop]:
70+
- [Option `-n`][-n]:
7171
Run program in `gets` loop.
72-
- {Option -p}[rdoc-ref:@-p+-n+with+Printing]:
72+
- [Option `-p`][-p]:
7373
`-n`, with printing.
7474

7575
### `-a`: Split Input Lines into Fields
@@ -91,15 +91,15 @@ and the default field separator is `$;`.
9191

9292
See also:
9393

94-
- {Option -0}[rdoc-ref:@-0+Set++Input+Record+Separator]:
94+
- [Option `-0`][-0]:
9595
Set `$/` (input record separator).
96-
- {Option -F}[rdoc-ref:@-F+Set+Input+Field+Separator]:
96+
- [Option `-F`][-F]:
9797
Set input field separator.
98-
- {Option -l}[rdoc-ref:@-l+Set+Output+Record+Separator+Chop+Lines]:
98+
- [Option `-l`][-l]:
9999
Set output record separator; chop lines.
100-
- {Option -n}[rdoc-ref:@-n+Run+Program+in+gets+Loop]:
100+
- [Option `-n`][-n]:
101101
Run program in `gets` loop.
102-
- {Option -p}[rdoc-ref:@-p+-n+with+Printing]:
102+
- [Option `-p`][-p]:
103103
`-n`, with printing.
104104

105105
### `-c`: Check Syntax
@@ -165,7 +165,7 @@ $ ruby -d -e 'p $DEBUG'
165165
true
166166
```
167167

168-
Option `--debug` is an alias for option `-d`.
168+
[Option `--debug`][--debug] is an alias for option `-d`.
169169

170170
### `-e`: Execute Given Ruby Code
171171

@@ -204,9 +204,9 @@ Whitespace between the option and its argument may be omitted.
204204

205205
See also:
206206

207-
- {Option --external-encoding}[rdoc-ref:@--external+encoding+Set+Default+External+Encoding]:
207+
- [Option `--external-encoding`][--external-encoding]:
208208
Set default external encoding.
209-
- {Option --internal-encoding}[rdoc-ref:@--internal+encoding+Set+Default+Internal+Encoding]:
209+
- [Option `--internal-encoding`][--internal-encoding]:
210210
Set default internal encoding.
211211

212212
Option `--encoding` is an alias for option `-E`.
@@ -239,15 +239,15 @@ The argument must immediately follow the option
239239

240240
See also:
241241

242-
- {Option -0}[rdoc-ref:@-0+Set++Input+Record+Separator]:
242+
- [Option `-0`][-0]:
243243
Set `$/` (input record separator).
244-
- {Option -a}[rdoc-ref:@-a+Split+Input+Lines+into+Fields]:
244+
- [Option `-a`][-a]:
245245
Split input lines into fields.
246-
- {Option -l}[rdoc-ref:@-l+Set+Output+Record+Separator+Chop+Lines]:
246+
- [Option `-l`][-l]:
247247
Set output record separator; chop lines.
248-
- {Option -n}[rdoc-ref:@-n+Run+Program+in+gets+Loop]:
248+
- [Option `-n`][-n]:
249249
Run program in `gets` loop.
250-
- {Option -p}[rdoc-ref:@-p+-n+with+Printing]:
250+
- [Option `-p`][-p]:
251251
`-n`, with printing.
252252

253253
### `-h`: Print Short Help Message
@@ -291,7 +291,7 @@ $ ruby -I my_lib -I some_lib -e 'p $LOAD_PATH.take(2)'
291291
$ popd
292292
```
293293

294-
This option and {option `-C`}[rdoc-ref:@-C+Set+Working+Directory] will
294+
This option and [option `-C`][-C] will
295295
be applied in the order in the command line; expansion of `-I` options
296296
are affected by preceeding `-C` options.
297297

@@ -335,15 +335,15 @@ $ ruby -ln -e 'p $_' desiderata.txt
335335

336336
See also:
337337

338-
- {Option -0}[rdoc-ref:@-0+Set++Input+Record+Separator]:
338+
- [Option `-0`][-0]:
339339
Set `$/` (input record separator).
340-
- {Option -a}[rdoc-ref:@-a+Split+Input+Lines+into+Fields]:
340+
- [Option `-a`][-a]:
341341
Split input lines into fields.
342-
- {Option -F}[rdoc-ref:@-F+Set+Input+Field+Separator]:
342+
- [Option `-F`][-F]:
343343
Set input field separator.
344-
- {Option -n}[rdoc-ref:@-n+Run+Program+in+gets+Loop]:
344+
- [Option `-n`][-n]:
345345
Run program in `gets` loop.
346-
- {Option -p}[rdoc-ref:@-p+-n+with+Printing]:
346+
- [Option `-p`][-p]:
347347
`-n`, with printing.
348348

349349
### `-n`: Run Program in `gets` Loop
@@ -369,15 +369,15 @@ be on good terms with all persons.
369369

370370
See also:
371371

372-
- {Option -0}[rdoc-ref:@-0+Set++Input+Record+Separator]:
372+
- [Option `-0`][-0]:
373373
Set `$/` (input record separator).
374-
- {Option -a}[rdoc-ref:@-a+Split+Input+Lines+into+Fields]:
374+
- [Option `-a`][-a]:
375375
Split input lines into fields.
376-
- {Option -F}[rdoc-ref:@-F+Set+Input+Field+Separator]:
376+
- [Option `-F`][-F]:
377377
Set input field separator.
378-
- {Option -l}[rdoc-ref:@-l+Set+Output+Record+Separator+Chop+Lines]:
378+
- [Option `-l`][-l]:
379379
Set output record separator; chop lines.
380-
- {Option -p}[rdoc-ref:@-p+-n+with+Printing]:
380+
- [Option `-p`][-p]:
381381
`-n`, with printing.
382382

383383
### `-p`: `-n`, with Printing
@@ -398,15 +398,15 @@ be on good terms with all persons.
398398

399399
See also:
400400

401-
- {Option -0}[rdoc-ref:@-0+Set++Input+Record+Separator]:
401+
- [Option `-0`][-0]:
402402
Set `$/` (input record separator).
403-
- {Option -a}[rdoc-ref:@-a+Split+Input+Lines+into+Fields]:
403+
- [Option `-a`][-a]:
404404
Split input lines into fields.
405-
- {Option -F}[rdoc-ref:@-F+Set+Input+Field+Separator]:
405+
- [Option `-F`][-F]:
406406
Set input field separator.
407-
- {Option -l}[rdoc-ref:@-l+Set+Output+Record+Separator+Chop+Lines]:
407+
- [Option `-l`][-l]:
408408
Set output record separator; chop lines.
409-
- {Option -n}[rdoc-ref:@-n+Run+Program+in+gets+Loop]:
409+
- [Option `-n`][-n]:
410410
Run program in `gets` loop.
411411

412412
### `-r`: Require Library
@@ -425,9 +425,8 @@ $ ruby -r csv -r json -e 'p defined?(JSON); p defined?(CSV)'
425425
```
426426

427427
The library is loaded with the `Kernel#require` method, after the
428-
other options such as {`-C`}[rdoc-ref:@-C+Set+Working+Directory],
429-
{`-I`}[rdoc-ref:@-I+Add+to+LOADPATH], and "custom options" by
430-
{`-s`}[rdoc-ref:@-s+Define+Global+Variable], are applied:
428+
other options such as [`-C`][-C], [`-I`][-I], and "custom options" by
429+
[`-s`][-s], are applied:
431430

432431
Whitespace between the option and its argument may be omitted.
433432

@@ -610,7 +609,7 @@ ruby - Copyright (C) 1993-2024 Yukihiro Matsumoto
610609
### `--debug`: Alias for `-d`
611610

612611
Option `--debug` is an alias for
613-
{option -d}[rdoc-ref:@-d+Set+DEBUG+to+true].
612+
[option `-d`][-d].
614613

615614
### `--disable`: Disable Features
616615

@@ -629,7 +628,7 @@ The supported features:
629628
- `frozen-string-literal`: Freeze all string literals (default: disabled).
630629
- `jit`: JIT compiler (default: disabled).
631630

632-
See also {option --enable}[rdoc-ref:@--enable+Enable+Features].
631+
See also [option `--enable`][--enable].
633632

634633
### `--dump`: Dump Items
635634

@@ -640,15 +639,15 @@ Some of the argument values cause the command to behave as if a different
640639
option was given:
641640

642641
- `--dump=copyright`:
643-
Same as {option \-\-copyright}[rdoc-ref:@--copyright+Print+Ruby+Copyright].
642+
Same as [option `--copyright`][--copyright].
644643
- `--dump=help`:
645-
Same as {option \-\-help}[rdoc-ref:@--help+Print+Help+Message].
644+
Same as [option `--help`][--help].
646645
- `--dump=syntax`:
647-
Same as {option -c}[rdoc-ref:@-c+Check+Syntax].
646+
Same as [option `-c`][-c].
648647
- `--dump=usage`:
649-
Same as {option -h}[rdoc-ref:@-h+Print+Short+Help+Message].
648+
Same as [option `-h`][-h].
650649
- `--dump=version`:
651-
Same as {option \-\-version}[rdoc-ref:@--version+Print+Ruby+Version].
650+
Same as [option `--version`][--version].
652651

653652
For other argument values and examples,
654653
see {Option --dump}[option_dump_md.html].
@@ -663,19 +662,19 @@ ruby --enable=gems,rubyopt t.rb
663662
```
664663

665664
For the features,
666-
see {option --disable}[rdoc-ref:@--disable+Disable+Features].
665+
see [option `--disable`][--disable].
667666

668667
### `--encoding`: Alias for `-E`.
669668

670669
Option `--encoding` is an alias for
671-
{option -E}[rdoc-ref:@-E+Set+Default+Encodings].
670+
[option `-E`][-E].
672671

673672
### `--external-encoding`: Set Default External \Encoding
674673

675674
Option `--external-encoding`
676675
sets the default external encoding for the invoked Ruby program;
677676
for values of `encoding`,
678-
see {Encoding: Names and Aliases}[rdoc-ref:encodings.rdoc@Names+and+Aliases].
677+
see [Encoding: Names and Aliases].
679678

680679
```console
681680
$ ruby -e 'puts Encoding::default_external'
@@ -697,7 +696,7 @@ For a shorter help message, use option `-h`.
697696
Option `--internal-encoding`
698697
sets the default internal encoding for the invoked Ruby program;
699698
for values of `encoding`,
700-
see {Encoding: Names and Aliases}[rdoc-ref:encodings.rdoc@Names+and+Aliases].
699+
see [Encoding: Names and Aliases].
701700

702701
```console
703702
$ ruby -e 'puts Encoding::default_internal.nil?'
@@ -719,3 +718,27 @@ and disables input from `$stdin`.
719718
### `--version`: Print Ruby Version
720719

721720
Option `--version` prints the version of the Ruby interpreter, then exits.
721+
722+
[-0]: rdoc-ref:@-0+Set++Input+Record+Separator
723+
[-C]: rdoc-ref:@-C+Set+Working+Directory
724+
[-E]: rdoc-ref:@-E+Set+Default+Encodings
725+
[-F]: rdoc-ref:@-F+Set+Input+Field+Separator
726+
[-I]: rdoc-ref:@-I+Add+to+LOADPATH
727+
[-a]: rdoc-ref:@-a+Split+Input+Lines+into+Fields
728+
[-c]: rdoc-ref:@-c+Check+Syntax
729+
[-d]: rdoc-ref:@-d+Set+DEBUG+to+true
730+
[-e]: rdoc-ref:@-e+Execute+Given+Ruby+Code
731+
[-h]: rdoc-ref:@-h+Print+Short+Help+Message
732+
[-l]: rdoc-ref:@-l+Set+Output+Record+Separator+Chop+Lines
733+
[-n]: rdoc-ref:@-n+Run+Program+in+gets+Loop
734+
[-p]: rdoc-ref:@-p+-n+with+Printing
735+
[-s]: rdoc-ref:@-s+Define+Global+Variable
736+
[--copyright]: rdoc-ref:@--copyright+Print+Ruby+Copyright
737+
[--debug]: rdoc-ref:@--debug+Alias+for+-d
738+
[--disable]: rdoc-ref:@--disable+Disable+Features
739+
[--enable]: rdoc-ref:@--enable+Enable+Features
740+
[--external-encoding]: rdoc-ref:@--external+encoding+Set+Default+External+Encoding
741+
[--internal-encoding]: rdoc-ref:@--internal+encoding+Set+Default+Internal+Encoding
742+
[--help]: rdoc-ref:@--help+Print+Help+Message
743+
[--version]: rdoc-ref:@--version+Print+Ruby+Version
744+
[Encoding: Names and Aliases]: rdoc-ref:encodings.rdoc@Names+and+Aliases

0 commit comments

Comments
 (0)