Skip to content

Commit 6e669fb

Browse files
Copilotlukem12345
andauthored
Guard docs Literate generation when examples/ is absent (#205)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lukem12345 <70283489+lukem12345@users.noreply.github.com>
1 parent 746abd9 commit 6e669fb

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

docs/make.jl

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,21 @@ end
1414
const literate_dir = joinpath(@__DIR__, "..", "examples")
1515
const generated_dir = joinpath(@__DIR__, "src", "examples")
1616

17-
for (root, dirs, files) in walkdir(literate_dir)
18-
out_dir = joinpath(generated_dir, relpath(root, literate_dir))
19-
for file in files
20-
f, l = splitext(file)
21-
if l == ".jl" && !startswith(f, "_")
22-
Literate.markdown(joinpath(root, file), out_dir;
23-
config=config, documenter=true, credit=false)
24-
Literate.notebook(joinpath(root, file), out_dir;
25-
execute=true, documenter=true, credit=false)
17+
if isdir(literate_dir)
18+
for (root, dirs, files) in walkdir(literate_dir)
19+
out_dir = joinpath(generated_dir, relpath(root, literate_dir))
20+
for file in files
21+
f, l = splitext(file)
22+
if l == ".jl" && !startswith(f, "_")
23+
Literate.markdown(joinpath(root, file), out_dir;
24+
config=config, documenter=true, credit=false)
25+
Literate.notebook(joinpath(root, file), out_dir;
26+
execute=true, documenter=true, credit=false)
27+
end
2628
end
2729
end
30+
else
31+
@info "Skipping Literate examples generation because examples directory is missing" literate_dir
2832
end
2933

3034
@info "Building Documenter.jl docs"

0 commit comments

Comments
 (0)