mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
[DOC] Replace rdoc style codeblocks with markdown style backtick codeblocks in markdown documents (#15900)
This commit is contained in:
parent
43d879d3ac
commit
37c7ee536d
Notes:
git
2026-01-18 17:25:30 +00:00
Merged-By: tompng <tomoyapenguin@gmail.com>
@ -265,16 +265,16 @@ and _never_ when referring to the class itself.
|
||||
|
||||
When writing an explicit link, follow these guidelines.
|
||||
|
||||
#### +rdoc-ref+ Scheme
|
||||
#### `rdoc-ref` Scheme
|
||||
|
||||
Use the +rdoc-ref+ scheme for:
|
||||
Use the `rdoc-ref` scheme for:
|
||||
|
||||
- A link in core documentation to other core documentation.
|
||||
- A link in core documentation to documentation in a standard library package.
|
||||
- A link in a standard library package to other documentation in that same
|
||||
standard library package.
|
||||
|
||||
See section "+rdoc-ref+ Scheme" in [links].
|
||||
See section "`rdoc-ref` Scheme" in [links].
|
||||
|
||||
#### URL-Based Link
|
||||
|
||||
@ -297,7 +297,7 @@ The name of a variable (as specified in its call-seq) should be marked up as
|
||||
[monofont].
|
||||
|
||||
Also, use monofont text for the name of a transient variable
|
||||
(i.e., one defined and used only in the discussion, such as +n+).
|
||||
(i.e., one defined and used only in the discussion, such as `n`).
|
||||
|
||||
### HTML Tags
|
||||
|
||||
@ -491,10 +491,10 @@ Return types:
|
||||
|
||||
- If the method can return multiple different types,
|
||||
separate the types with "or" and, if necessary, commas.
|
||||
- If the method can return multiple types, use +object+.
|
||||
- If the method returns the receiver, use +self+.
|
||||
- If the method can return multiple types, use `object`.
|
||||
- If the method returns the receiver, use `self`.
|
||||
- If the method returns an object of the same class,
|
||||
prefix `new_` if and only if the object is not +self+;
|
||||
prefix `new_` if and only if the object is not `self`;
|
||||
example: `new_array`.
|
||||
|
||||
Aliases:
|
||||
|
||||
@ -504,18 +504,18 @@ These methods return backtrace information:
|
||||
By default, Ruby sets the backtrace of the exception to the location where it
|
||||
was raised.
|
||||
|
||||
The developer might adjust this by either providing +backtrace+ argument
|
||||
The developer might adjust this by either providing `backtrace` argument
|
||||
to Kernel#raise, or using Exception#set_backtrace.
|
||||
|
||||
Note that:
|
||||
|
||||
- by default, both +backtrace+ and +backtrace_locations+ represent the same backtrace;
|
||||
- by default, both `backtrace` and `backtrace_locations` represent the same backtrace;
|
||||
- if the developer sets the backtrace by one of the above methods to an array of
|
||||
Thread::Backtrace::Location, they still represent the same backtrace;
|
||||
- if the developer sets the backtrace to a string or an array of strings:
|
||||
- by Kernel#raise: +backtrace_locations+ become +nil+;
|
||||
- by Exception#set_backtrace: +backtrace_locations+ preserve the original
|
||||
- by Kernel#raise: `backtrace_locations` become `nil`;
|
||||
- by Exception#set_backtrace: `backtrace_locations` preserve the original
|
||||
value;
|
||||
- if the developer sets the backtrace to +nil+ by Exception#set_backtrace,
|
||||
+backtrace_locations+ preserve the original value; but if the exception is then
|
||||
reraised, both +backtrace+ and +backtrace_locations+ become the location of reraise.
|
||||
- if the developer sets the backtrace to `nil` by Exception#set_backtrace,
|
||||
`backtrace_locations` preserve the original value; but if the exception is then
|
||||
reraised, both `backtrace` and `backtrace_locations` become the location of reraise.
|
||||
|
||||
@ -640,7 +640,7 @@ Option `--encoding` is an alias for
|
||||
|
||||
Option `--external-encoding`
|
||||
sets the default external encoding for the invoked Ruby program;
|
||||
for values of +encoding+,
|
||||
for values of `encoding`,
|
||||
see {Encoding: Names and Aliases}[rdoc-ref:encodings.rdoc@Names+and+Aliases].
|
||||
|
||||
```console
|
||||
@ -662,7 +662,7 @@ For a shorter help message, use option `-h`.
|
||||
|
||||
Option `--internal-encoding`
|
||||
sets the default internal encoding for the invoked Ruby program;
|
||||
for values of +encoding+,
|
||||
for values of `encoding`,
|
||||
see {Encoding: Names and Aliases}[rdoc-ref:encodings.rdoc@Names+and+Aliases].
|
||||
|
||||
```console
|
||||
|
||||
14
file.c
14
file.c
@ -5557,7 +5557,7 @@ rb_thread_flock(void *data)
|
||||
* call-seq:
|
||||
* flock(locking_constant) -> 0 or false
|
||||
*
|
||||
* Locks or unlocks file +self+ according to the given `locking_constant`,
|
||||
* Locks or unlocks file `self` according to the given `locking_constant`,
|
||||
* a bitwise OR of the values in the table below.
|
||||
*
|
||||
* Not available on all platforms.
|
||||
@ -5567,10 +5567,10 @@ rb_thread_flock(void *data)
|
||||
*
|
||||
* | Constant | Lock | Effect
|
||||
* |-----------------|--------------|-----------------------------------------------------------------------------------------------------------------|
|
||||
* | +File::LOCK_EX+ | Exclusive | Only one process may hold an exclusive lock for +self+ at a time. |
|
||||
* | +File::LOCK_NB+ | Non-blocking | No blocking; may be combined with +File::LOCK_SH+ or +File::LOCK_EX+ using the bitwise OR operator <tt>\|</tt>. |
|
||||
* | +File::LOCK_SH+ | Shared | Multiple processes may each hold a shared lock for +self+ at the same time. |
|
||||
* | +File::LOCK_UN+ | Unlock | Remove an existing lock held by this process. |
|
||||
* | `File::LOCK_EX` | Exclusive | Only one process may hold an exclusive lock for `self` at a time. |
|
||||
* | `File::LOCK_NB` | Non-blocking | No blocking; may be combined with `File::LOCK_SH` or `File::LOCK_EX` using the bitwise OR operator <tt>\|</tt>. |
|
||||
* | `File::LOCK_SH` | Shared | Multiple processes may each hold a shared lock for `self` at the same time. |
|
||||
* | `File::LOCK_UN` | Unlock | Remove an existing lock held by this process. |
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
@ -5697,11 +5697,11 @@ test_check(int n, int argc, VALUE *argv)
|
||||
* | <tt>'z'</tt> | Whether the entity exists and is of length zero. |
|
||||
*
|
||||
* - This test operates only on the entity at `path0`,
|
||||
* and returns an integer size or +nil+:
|
||||
* and returns an integer size or `nil`:
|
||||
*
|
||||
* | Character | Test |
|
||||
* |:------------:|:---------------------------------------------------------------------------------------------|
|
||||
* | <tt>'s'</tt> | Returns positive integer size if the entity exists and has non-zero length, +nil+ otherwise. |
|
||||
* | <tt>'s'</tt> | Returns positive integer size if the entity exists and has non-zero length, `nil` otherwise. |
|
||||
*
|
||||
* - Each of these tests operates only on the entity at `path0`,
|
||||
* and returns a Time object;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user