Skip to content

Commit

Permalink
add compat for Documenter v1 + fix makedocs syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
navidcy committed Oct 13, 2023
1 parent 2ac11b9 commit a24ba30
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
4 changes: 3 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[deps]
DataDeps = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"

[compat]
Documenter = "1"
22 changes: 17 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ pushfirst!(LOAD_PATH, joinpath(@__DIR__, "..")) # add ClimaOcean to environment
using
Documenter,
Literate,
# CairoMakie, # so that Literate.jl does not capture precompilation output or warnings
Glob,
ClimaOcean

ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
Expand Down Expand Up @@ -50,14 +48,28 @@ makedocs(
format = format,
pages = pages,
doctest = true,
strict = true,
clean = true,
checkdocs = :exports
)

@info "Cleaning up temporary .jld2 and .nc files created by doctests..."
@info "Clean up temporary .jld2 and .nc output created by doctests or literated examples..."

for file in vcat(glob("docs/*.jld2"), glob("docs/*.nc"))
"""
recursive_find(directory, pattern)
Return list of filepaths within `directory` that contains the `pattern::Regex`.
"""
recursive_find(directory, pattern) =
mapreduce(vcat, walkdir(directory)) do (root, dirs, files)
joinpath.(root, filter(contains(pattern), files))
end

files = []
for pattern in [r"\.jld2", r"\.nc"]
global files = vcat(files, recursive_find(@__DIR__, pattern))
end

for file in files
rm(file)
end

Expand Down

0 comments on commit a24ba30

Please sign in to comment.