Skip to content

Commit c762f10

Browse files
MarcMushmcabbott
andauthored
change julia to julia-repl in docstrings (JuliaLang#42824)
Co-authored-by: Michael Abbott <32575566+mcabbott@users.noreply.github.com>
1 parent 9f52ec0 commit c762f10

File tree

12 files changed

+24
-23
lines changed

12 files changed

+24
-23
lines changed

base/docs/basedocs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ then their contents are vertically concatenated together.
992992
In the standard REPL, typing `;` on an empty line will switch to shell mode.
993993
994994
# Examples
995-
```julia
995+
```jldoctest
996996
julia> function foo()
997997
x = "Hello, "; x *= "World!"
998998
return x

base/loading.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ or `nothing` if `m` was not imported from a package. Optionally further
358358
path component strings can be provided to construct a path within the
359359
package root.
360360
361-
```julia
361+
```julia-repl
362362
julia> pkgdir(Foo)
363363
"/path/to/Foo.jl"
364364

base/stream.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ julia> withenv("LINES" => 30, "COLUMNS" => 100) do
552552
553553
To get your TTY size,
554554
555-
```julia
555+
```julia-repl
556556
julia> displaysize(stdout)
557557
(34, 147)
558558
```
@@ -1328,7 +1328,7 @@ Possible values for each stream are:
13281328
* `io` an `IOStream`, `TTY`, `Pipe`, socket, or `devnull`.
13291329
13301330
# Examples
1331-
```julia
1331+
```julia-repl
13321332
julia> redirect_stdio(stdout="stdout.txt", stderr="stderr.txt") do
13331333
print("hello stdout")
13341334
print(stderr, "hello stderr")
@@ -1344,22 +1344,22 @@ julia> read("stderr.txt", String)
13441344
# Edge cases
13451345
13461346
It is possible to pass the same argument to `stdout` and `stderr`:
1347-
```julia
1347+
```julia-repl
13481348
julia> redirect_stdio(stdout="log.txt", stderr="log.txt", stdin=devnull) do
13491349
...
13501350
end
13511351
```
13521352
13531353
However it is not supported to pass two distinct descriptors of the same file.
1354-
```julia
1354+
```julia-repl
13551355
julia> io1 = open("same/path", "w")
13561356
13571357
julia> io2 = open("same/path", "w")
13581358
13591359
julia> redirect_stdio(f, stdout=io1, stderr=io2) # not suppored
13601360
```
13611361
Also the `stdin` argument may not be the same descriptor as `stdout` or `stderr`.
1362-
```julia
1362+
```julia-repl
13631363
julia> io = open(...)
13641364
13651365
julia> redirect_stdio(f, stdout=io, stdin=io) # not supported

base/twiceprecision.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ representation, even though it is exact from the standpoint of binary
6363
representation.
6464
6565
Example:
66-
```julia
66+
```julia-repl
6767
julia> 1.0 + 1.0001e-15
6868
1.000000000000001
6969
@@ -94,7 +94,7 @@ numbers. Mathematically, `zhi + zlo = x * y`, where `zhi` contains the
9494
most significant bits and `zlo` the least significant.
9595
9696
Example:
97-
```julia
97+
```julia-repl
9898
julia> x = Float32(π)
9999
3.1415927f0
100100
@@ -126,7 +126,7 @@ numbers. Mathematically, `zhi + zlo ≈ x / y`, where `zhi` contains the
126126
most significant bits and `zlo` the least significant.
127127
128128
Example:
129-
```julia
129+
```julia-repl
130130
julia> x, y = Float32(π), 3.1f0
131131
(3.1415927f0, 3.1f0)
132132

doc/src/devdocs/boundscheck.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ end
5454
Which quietly assumes 1-based indexing and therefore exposes unsafe memory access when used
5555
with [`OffsetArrays`](@ref man-custom-indice):
5656

57-
```julia
57+
```julia-repl
5858
julia> using OffsetArrays
59+
5960
julia> sum(OffsetArray([1,2,3], -10))
6061
9164911648 # inconsistent results or segfault
6162
```

doc/src/manual/functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ Instead of destructuring based on iteration, the right side of assignments can a
481481
This follows the syntax for NamedTuples, and works by assigning to each variable on the left a
482482
property of the right side of the assignment with the same name using `getproperty`:
483483

484-
```julia
484+
```jldoctest
485485
julia> (; b, a) = (a=1, b=2, c=3)
486486
(a = 1, b = 2, c = 3)
487487
@@ -498,7 +498,7 @@ The destructuring feature can also be used within a function argument.
498498
If a function argument name is written as a tuple (e.g. `(x, y)`) instead of just
499499
a symbol, then an assignment `(x, y) = argument` will be inserted for you:
500500

501-
```julia
501+
```julia-repl
502502
julia> minmax(x, y) = (y < x) ? (y, x) : (x, y)
503503
504504
julia> gap((min, max)) = max - min
@@ -512,7 +512,7 @@ would be a two-argument function, and this example would not work.
512512

513513
Similarly, property destructuring can also be used for function arguments:
514514

515-
```julia
515+
```julia-repl
516516
julia> foo((; x, y)) = x + y
517517
foo (generic function with 1 method)
518518

doc/src/manual/modules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ For example, `Base` exports the function name `read`, but the CSV.jl package als
205205
If we are going to invoke CSV reading many times, it would be convenient to drop the `CSV.` qualifier.
206206
But then it is ambiguous whether we are referring to `Base.read` or `CSV.read`:
207207

208-
```julia
208+
```julia-repl
209209
julia> read;
210210
211211
julia> import CSV: read
@@ -214,7 +214,7 @@ WARNING: ignoring conflicting import of CSV.read into Main
214214

215215
Renaming provides a solution:
216216

217-
```julia
217+
```julia-repl
218218
julia> import CSV: read as rd
219219
```
220220

doc/src/manual/workflow-tips.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ the following modifications:
104104

105105
Navigate to your temporary directory and launch Julia, then do the following:
106106

107-
```julia
107+
```julia-repl
108108
pkg> generate MyPkg # type ] to enter pkg mode
109109
julia> push!(LOAD_PATH, pwd()) # hit backspace to exit pkg mode
110110
```
@@ -123,7 +123,7 @@ the following modifications:
123123
Then navigate to the directory containing your test file (here
124124
assumed to be `"runtests.jl"`) and do the following:
125125

126-
```julia
126+
```julia-repl
127127
julia> using MyPkg
128128
129129
julia> include("runtests.jl")

stdlib/LibGit2/src/types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ distinct payload. Each callback, when called, will receive `Dict` which will hol
248248
callback's custom payload which can be accessed using the callback name.
249249
250250
# Examples
251-
```julia
251+
```julia-repl
252252
julia> c = LibGit2.Callbacks(:credentials => (LibGit2.credentials_cb(), LibGit2.CredentialPayload()));
253253
254254
julia> LibGit2.clone(url, callbacks=c);

stdlib/REPL/docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ v [ ] blueberry
669669

670670
can instead be rendered with Unicode selection and navigation characters with
671671

672-
```julia
672+
```julia-repl
673673
julia> menu = MultiSelectMenu(options, pagesize=5, charset=:unicode);
674674
675675
julia> request(menu)
@@ -683,7 +683,7 @@ julia> request(menu)
683683

684684
More fine-grained configuration is also possible:
685685

686-
```julia
686+
```julia-repl
687687
julia> menu = MultiSelectMenu(options, pagesize=5, charset=:unicode, checked="YEP!", unchecked="NOPE", cursor='⧐');
688688
689689
julia> request(menu)

stdlib/REPL/src/TerminalMenus/MultiSelectMenu.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A menu that allows a user to select a multiple options from a list.
88
99
# Sample Output
1010
11-
```julia
11+
```julia-repl
1212
julia> request(MultiSelectMenu(options))
1313
Select the fruits you like:
1414
[press: d=done, a=all, n=none]

stdlib/REPL/src/TerminalMenus/RadioMenu.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A menu that allows a user to select a single option from a list.
88
99
# Sample Output
1010
11-
```julia
11+
```julia-repl
1212
julia> request(RadioMenu(options, pagesize=4))
1313
Choose your favorite fruit:
1414
^ grape

0 commit comments

Comments
 (0)