Skip to content

Commit

Permalink
[DOC] Exclude the word IRB from RDoc's autolinking (#1068)
Browse files Browse the repository at this point in the history
* Use RDoc 6.11.0's word exclusion feature

* Remove unnecessary escapes from documentation
  • Loading branch information
st0012 authored Jan 21, 2025
1 parent 6194111 commit cb15c29
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 69 deletions.
3 changes: 3 additions & 0 deletions .rdoc_options
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
page_dir: doc
warn_missing_rdoc_ref: true

autolink_excluded_words:
- IRB
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ gem "rubocop"
gem "tracer" if !is_truffleruby
gem "debug", github: "ruby/debug", platforms: [:mri, :mswin]

gem "rdoc", ">= 6.11.0"

if RUBY_VERSION >= "3.0.0" && !is_truffleruby
gem "repl_type_completor"
end
2 changes: 1 addition & 1 deletion doc/COMMAND_LINE_OPTIONS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Index of Command-Line Options

These are the \IRB command-line options, with links to explanatory text:
These are the IRB command-line options, with links to explanatory text:

- `-d`: Set `$DEBUG` and {$VERBOSE}[rdoc-ref:IRB@Verbosity]
to `true`.
Expand Down
32 changes: 16 additions & 16 deletions doc/Configurations.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Configure \IRB
# Configure IRB

## Configuration Sources

\IRB configurations can be set through multiple sources, each with its own precedence:
IRB configurations can be set through multiple sources, each with its own precedence:

1. **Command-Line Options**: When some options are specified when starting \IRB, they can override default settings.
2. **Configuration File**: If present, \IRB reads a configuration file containing Ruby code to set configurations.
3. **Environment Variables**: Certain environment variables influence \IRB's behavior.
1. **Command-Line Options**: When some options are specified when starting IRB, they can override default settings.
2. **Configuration File**: If present, IRB reads a configuration file containing Ruby code to set configurations.
3. **Environment Variables**: Certain environment variables influence IRB's behavior.
4. **Hash `IRB.conf`**: This hash holds the current configuration settings, which can be modified during a session.

### Configuration File Path Resolution

\IRB searches for a configuration file in the following order:
IRB searches for a configuration file in the following order:

1. `$IRBRC`
2. `$XDG_CONFIG_HOME/irb/irbrc`
Expand All @@ -28,7 +28,7 @@ Method `conf.rc?` returns `true` if a configuration file was read, `false` other

## Environment Variables

- `NO_COLOR`: Disables \IRB's colorization.
- `NO_COLOR`: Disables IRB's colorization.
- `IRB_USE_AUTOCOMPLETE`: Setting to `false` disables autocompletion.
- `IRB_COMPLETOR`: Configures auto-completion behavior (`regexp` or `type`).
- `IRB_COPY_COMMAND`: Overrides the default program used to interface with the system clipboard.
Expand All @@ -48,7 +48,7 @@ The initial entries in hash `IRB.conf` are determined by:

You can see the hash by typing `IRB.conf`. Below are the primary entries:

- `:AP_NAME`: \IRB {application name}[rdoc-ref:IRB@Application+Name];
- `:AP_NAME`: IRB {application name}[rdoc-ref:IRB@Application+Name];
initial value: `'irb'`.
- `:AT_EXIT`: Array of hooks to call
{at exit}[rdoc-ref:IRB@IRB];
Expand Down Expand Up @@ -76,7 +76,7 @@ You can see the hash by typing `IRB.conf`. Below are the primary entries:
initial value: `nil`, which would set `conf.echo_on_assignment` to `:truncate`.
- `:EVAL_HISTORY`: How much {evaluation history}[rdoc-ref:IRB@Evaluation+History]
is to be stored; initial value: `nil`.
- `:EXTRA_DOC_DIRS`: \Array of
- `:EXTRA_DOC_DIRS`: Array of
{RI documentation directories}[rdoc-ref:IRB@RI+Documentation+Directories]
to be parsed for the documentation dialog;
initial value: `[]`.
Expand All @@ -95,7 +95,7 @@ You can see the hash by typing `IRB.conf`. Below are the primary entries:

- <i>RUBY_DIR</i> is the Ruby installation dirpath.
- <i>RUBY_VER_NUM</i> is the Ruby version number.
- <i>IRB_VER_NUM</i> is the \IRB version number.
- <i>IRB_VER_NUM</i> is the IRB version number.

- `:IRB_NAME`: {IRB name}[rdoc-ref:IRB@IRB+Name];
initial value: `'irb'`.
Expand All @@ -104,7 +104,7 @@ You can see the hash by typing `IRB.conf`. Below are the primary entries:
- `:LC_MESSAGES`: {Locale}[rdoc-ref:IRB@Locale];
initial value: IRB::Locale object.
- `:LOAD_MODULES`: deprecated.
- `:MAIN_CONTEXT`: The {context}[rdoc-ref:IRB@Session+Context] for the main \IRB session;
- `:MAIN_CONTEXT`: The {context}[rdoc-ref:IRB@Session+Context] for the main IRB session;
initial value: IRB::Context object.
- `:MEASURE`: Whether to
{measure performance}[rdoc-ref:IRB@Performance+Measurement];
Expand All @@ -121,7 +121,7 @@ You can see the hash by typing `IRB.conf`. Below are the primary entries:
:STACKPROF=>#<Proc:0x0000556e271c6548 /var/lib/gems/3.0.0/gems/irb-1.8.3/lib/irb/init.rb:116>
}

- `:PROMPT`: \Hash of {defined prompts}[rdoc-ref:IRB@Prompt+and+Return+Formats];
- `:PROMPT`: Hash of {defined prompts}[rdoc-ref:IRB@Prompt+and+Return+Formats];
initial value:

{
Expand Down Expand Up @@ -158,7 +158,7 @@ You can see the hash by typing `IRB.conf`. Below are the primary entries:
initial value: `false`.
- `:VERBOSE`: Whether to print {verbose output}[rdoc-ref:IRB@Verbosity];
initial value: `nil`.
- `:__MAIN__`: The main \IRB object;
- `:__MAIN__`: The main IRB object;
initial value: `main`.

## Notes on Initialization Precedence
Expand Down Expand Up @@ -228,9 +228,9 @@ You can set the default initial value via:

Note that the configuration file entry overrides the command-line options.

## \IRB Name
## IRB Name

You can specify a name for \IRB.
You can specify a name for IRB.

The default initial value is `'irb'`:

Expand All @@ -247,7 +247,7 @@ IRB.conf[:IRB_NAME] = 'foo'

## Application Name

You can specify an application name for the \IRB session.
You can specify an application name for the IRB session.

The default initial value is `'irb'`:

Expand Down
Loading

0 comments on commit cb15c29

Please sign in to comment.