Skip to content

Commit 96fd74e

Browse files
authored
Use Documenter v0.27 (#253)
* Use Documenter v0.27 * Bugfixes in docs * fix interpolation of IdOffsetRange * import IdOffsetRange in axes doctests
1 parent 6cbc7f1 commit 96fd74e

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Adapt = "2, 3"
1010
Aqua = "0.5"
1111
CatIndices = "0.2"
1212
DistributedArrays = "0.6"
13-
Documenter = "0.26"
13+
Documenter = "0.27"
1414
EllipsisNotation = "1"
1515
FillArrays = "0.11"
1616
StaticArrays = "1"

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
44
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
55

66
[compat]
7-
Documenter = "0.26"
7+
Documenter = "0.27"
88
JSON = "0.21"

docs/src/internals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ This has a similar design to `Base.IdentityUnitRange` that `ax[x] == x` always h
5353
julia> ax[5]
5454
5
5555
julia> ax[1]
56-
ERROR: BoundsError: attempt to access 2-element Base.OneTo{Int64} at index [-3]
56+
ERROR: BoundsError: attempt to access 2-element OffsetArrays.IdOffsetRange{Int64, Base.OneTo{Int64}} with indices 5:6 at index [1]
5757
[...]
5858
```
5959

docs/src/reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ OffsetArrays.Origin
88
OffsetArrays.IdOffsetRange
99
OffsetArrays.no_offset_view
1010
OffsetArrays.AxisConversionStyle
11+
OffsetArrays.center
12+
OffsetArrays.centered
1113
```

src/axes.jl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,35 @@ i.e., it's the "identity," which is the origin of the "Id" in `IdOffsetRange`.
99
# Examples
1010
1111
The most common case is shifting a range that starts at 1 (either `1:n` or `Base.OneTo(n)`):
12-
```jldoctest; setup=:(import OffsetArrays)
13-
julia> ro = OffsetArrays.IdOffsetRange(1:3, -2)
14-
OffsetArrays.IdOffsetRange(values=-1:1, indices=-1:1)
12+
```jldoctest ior
13+
julia> using OffsetArrays: IdOffsetRange
14+
15+
julia> ro = IdOffsetRange(1:3, -2)
16+
IdOffsetRange(values=-1:1, indices=-1:1)
1517
1618
julia> axes(ro, 1)
17-
OffsetArrays.IdOffsetRange(values=-1:1, indices=-1:1)
19+
IdOffsetRange(values=-1:1, indices=-1:1)
1820
1921
julia> ro[-1]
2022
-1
2123
2224
julia> ro[3]
23-
ERROR: BoundsError: attempt to access 3-element OffsetArrays.$(IdOffsetRange{Int,UnitRange{Int}}) with indices -1:1 at index [3]
25+
ERROR: BoundsError: attempt to access 3-element $(IdOffsetRange{Int,UnitRange{Int}}) with indices -1:1 at index [3]
2426
```
2527
2628
If the range doesn't start at 1, the values may be different from the indices:
27-
```jldoctest; setup=:(import OffsetArrays)
28-
julia> ro = OffsetArrays.IdOffsetRange(11:13, -2)
29-
OffsetArrays.IdOffsetRange(values=9:11, indices=-1:1)
29+
```jldoctest ior
30+
julia> ro = IdOffsetRange(11:13, -2)
31+
IdOffsetRange(values=9:11, indices=-1:1)
3032
3133
julia> axes(ro, 1) # 11:13 is indexed by 1:3, and the offset is also applied to the axes
32-
OffsetArrays.IdOffsetRange(values=-1:1, indices=-1:1)
34+
IdOffsetRange(values=-1:1, indices=-1:1)
3335
3436
julia> ro[-1]
3537
9
3638
3739
julia> ro[3]
38-
ERROR: BoundsError: attempt to access 3-element OffsetArrays.$(IdOffsetRange{Int,UnitRange{Int}}) with indices -1:1 at index [3]
40+
ERROR: BoundsError: attempt to access 3-element $(IdOffsetRange{Int,UnitRange{Int}}) with indices -1:1 at index [3]
3941
```
4042
4143
# Extended help

0 commit comments

Comments
 (0)