Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doctests and upgrade to Documenter v1 #115

Merged
merged 2 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "0.27"
Documenter = "1.0"
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Documenter, IterTools

DocMeta.setdocmeta!(IterTools, :DocTestSetup, :(using IterTools))
makedocs(
modules = [IterTools],
sitename = "IterTools",
pages = [
"Docs" => "index.md",
],
doctest=false,
doctest=true,
)

deploydocs(
Expand Down
6 changes: 0 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
```@meta
DocTestSetup = quote
using IterTools
end
```

# IterTools

## Installation
Expand Down
31 changes: 25 additions & 6 deletions src/IterTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1106,12 +1106,12 @@ Input:
```jldoctest
julia> collect(interleaveby(1:2:5, 2:2:6))
6-element Vector{Int64}:
1
2
3
4
5
6
1
2
3
4
5
6
```

If the predicate is `Base.isless` (the default) and both inputs are sorted, this produces the sorted output.
Expand Down Expand Up @@ -1215,6 +1215,25 @@ _zip_longest_promote_shape(a, b) = promote_shape(a, b)
For one or more iterable objects, return an iterable of tuples, where the `i`th tuple
contains the `i`th component of each input iterable if it is not finished, and `default`
otherwise. `default` can be a scalar, or a tuple with one default per iterable.

```jldoctest
julia> for t in zip_longest(1:2, 5:8)
@show t
end
t = (1, 5)
t = (2, 6)
t = (nothing, 7)
t = (nothing, 8)

julia> for t in zip_longest('a':'e', ['m', 'n']; default='x')
@show t
end
t = ('a', 'm')
t = ('b', 'n')
t = ('c', 'x')
t = ('d', 'x')
t = ('e', 'x')
```
"""
zip_longest(its...; default=nothing) = ZipLongest(Tuple(_Padded.(its, default)))

Expand Down