From a24ba30002e3dea753685dd577ca0838ca9e6142 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Fri, 13 Oct 2023 15:33:00 -0400 Subject: [PATCH] add compat for Documenter v1 + fix makedocs syntax --- docs/Project.toml | 4 +++- docs/make.jl | 22 +++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index 377e2b2d..3c4560f4 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -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" \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl index 49a2aaa7..3a8c1a00 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -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" @@ -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