Skip to content

Commit 6084a57

Browse files
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent b150888 commit 6084a57

File tree

6 files changed

+47
-38
lines changed

6 files changed

+47
-38
lines changed

Diff for: .github/workflows/docs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ jobs:
2222
GKSwstype: nul # turn off GR's interactive plotting for notebooks
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
2424
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
25+
JULIA_DEBUG: Documenter # Print `@debug` statements (https://github.com/JuliaDocs/Documenter.jl/issues/955)
2526
run: julia --project=docs/ docs/make.jl

Diff for: docs/Manifest.toml

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
[[AbstractFFTs]]
44
deps = ["LinearAlgebra"]
5-
git-tree-sha1 = "051c95d6836228d120f5f4b984dd5aba1624f716"
5+
git-tree-sha1 = "485ee0867925449198280d4af84bdb46a2a404d0"
66
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
7-
version = "0.5.0"
7+
version = "1.0.1"
88

99
[[ArgTools]]
1010
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
@@ -73,19 +73,19 @@ version = "0.8.5"
7373

7474
[[Documenter]]
7575
deps = ["Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
76-
git-tree-sha1 = "621850838b3e74dd6dd047b5432d2e976877104e"
76+
git-tree-sha1 = "47f13b6305ab195edb73c86815962d84e31b0f48"
7777
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
78-
version = "0.27.2"
78+
version = "0.27.3"
7979

8080
[[Downloads]]
8181
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
8282
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
8383

8484
[[FillArrays]]
8585
deps = ["LinearAlgebra", "Random", "SparseArrays"]
86-
git-tree-sha1 = "31939159aeb8ffad1d4d8ee44d07f8558273120a"
86+
git-tree-sha1 = "a603e79b71bb3c1efdb58f0ee32286efe2d1a255"
8787
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
88-
version = "0.11.7"
88+
version = "0.11.8"
8989

9090
[[Functors]]
9191
deps = ["MacroTools"]
@@ -187,9 +187,9 @@ uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
187187

188188
[[NamedDims]]
189189
deps = ["AbstractFFTs", "LinearAlgebra", "Pkg", "Requires", "Statistics"]
190-
git-tree-sha1 = "e91d3ee8ac1514651b6e85686ca31257d17b1eb2"
190+
git-tree-sha1 = "572b7af3ee53328eec29392d3b133804925595a1"
191191
uuid = "356022a1-0364-5f58-8944-0da4b18d706f"
192-
version = "0.2.33"
192+
version = "0.2.34"
193193

194194
[[NetworkOptions]]
195195
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"

Diff for: docs/Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
77
[compat]
88
Documenter = "0.27"
99
KernelFunctions = "0.10"
10-
PDMats = "0.11"
1110
Kronecker = "0.4"
11+
PDMats = "0.11"
1212
julia = "1.3"

Diff for: docs/literate.jl

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# Retrieve filename of literate script
1+
# Retrieve name of example and output directory
22
if length(ARGS) != 2
3-
error("please specify the literate script and the output directory")
3+
error("please specify the name of the example and the output directory")
44
end
5-
const SCRIPTJL = ARGS[1]
5+
const EXAMPLE = ARGS[1]
66
const OUTDIR = ARGS[2]
77

88
# Activate environment
9-
using Pkg: Pkg
10-
Pkg.activate(dirname(SCRIPTJL))
119
# Note that each example's Project.toml must include Literate as a dependency
10+
using Pkg: Pkg
11+
const EXAMPLEPATH = joinpath(@__DIR__, "..", "examples", EXAMPLE)
12+
Pkg.activate(EXAMPLEPATH)
1213
Pkg.instantiate()
1314
using Literate: Literate
1415

@@ -38,10 +39,10 @@ function preprocess(content)
3839
end
3940

4041
# Convert to markdown and notebook
41-
name = basename(dirname(realpath(SCRIPTJL)))
42+
const SCRIPTJL = joinpath(EXAMPLEPATH, "script.jl")
4243
Literate.markdown(
43-
SCRIPTJL, OUTDIR; name=name, documenter=false, execute=true, preprocess=preprocess
44+
SCRIPTJL, OUTDIR; name=EXAMPLE, documenter=false, execute=true, preprocess=preprocess
4445
)
4546
Literate.notebook(
46-
SCRIPTJL, OUTDIR; name=name, documenter=false, execute=true, preprocess=preprocess
47+
SCRIPTJL, OUTDIR; name=EXAMPLE, documenter=false, execute=true, preprocess=preprocess
4748
)

Diff for: docs/make.jl

+27-20
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
11
### Process examples
2-
const EXAMPLES_SRC = joinpath(@__DIR__, "..", "examples")
3-
const EXAMPLES_OUT = joinpath(@__DIR__, "src", "examples")
4-
const LITERATEJL = joinpath(@__DIR__, "literate.jl")
5-
62
# Always rerun examples
3+
const EXAMPLES_OUT = joinpath(@__DIR__, "src", "examples")
74
ispath(EXAMPLES_OUT) && rm(EXAMPLES_OUT; recursive=true)
85
mkpath(EXAMPLES_OUT)
96

7+
# Install and precompile all packages
8+
# Workaround for https://github.com/JuliaLang/Pkg.jl/issues/2219
9+
examples = filter!(isdir, readdir(joinpath(@__DIR__, "..", "examples"); join=true))
10+
let script = "using Pkg; Pkg.activate(ARGS[1]); Pkg.instantiate()"
11+
for example in examples
12+
if !success(`$(Base.julia_cmd()) -e $script $example`)
13+
error(
14+
"project environment of example ",
15+
basename(example),
16+
" could not be instantiated",
17+
)
18+
end
19+
end
20+
end
1021
# Run examples asynchronously
11-
processes = map(filter!(isdir, readdir(EXAMPLES_SRC; join=true))) do example
12-
scriptjl = joinpath(example, "script.jl")
13-
return run(
14-
pipeline(
15-
`$(Base.julia_cmd()) $LITERATEJL $scriptjl $EXAMPLES_OUT`;
16-
stdin=devnull,
17-
stdout=devnull,
18-
stderr=stderr,
19-
);
20-
wait=false,
21-
)::Base.Process
22+
processes = let literatejl = joinpath(@__DIR__, "literate.jl")
23+
map(examples) do example
24+
return run(
25+
pipeline(
26+
`$(Base.julia_cmd()) $literatejl $(basename(example)) $EXAMPLES_OUT`;
27+
stdin=devnull,
28+
stdout=devnull,
29+
stderr=stderr,
30+
);
31+
wait=false,
32+
)::Base.Process
33+
end
2234
end
2335

2436
# Check that all examples were run successfully
@@ -30,11 +42,6 @@ using Documenter
3042
using KernelFunctions
3143
using PDMats, Kronecker # we have to load all optional packages to generate the full API documentation
3244

33-
# Print `@debug` statements (https://github.com/JuliaDocs/Documenter.jl/issues/955)
34-
if haskey(ENV, "GITHUB_ACTIONS")
35-
ENV["JULIA_DEBUG"] = "Documenter"
36-
end
37-
3845
# Doctest setup
3946
DocMeta.setdocmeta!(
4047
KernelFunctions,

Diff for: examples/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ julia> Literate.notebook("script.jl", "output_directory")
2828
```
2929
(see the [Literate.jl docs](https://fredrikekre.github.io/Literate.jl/v2/) for additional options) or run
3030
```shell
31-
julia docs/literate.jl examples/myexample/script.jl output_directory
31+
julia docs/literate.jl myexample output_directory
3232
```
3333
which also executes the code and generates embedded plots etc. in the same way as in building the KernelFunctions documentation.
3434

0 commit comments

Comments
 (0)