Skip to content

Commit

Permalink
Update make.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
0815Creeper committed Sep 17, 2024
1 parent 760b0be commit d75c724
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ for md in readdir("docs/src/examples")
end

#remove any example pages, for witch the example can not be found
# and remove svgs if md building failed
for (x, md) in deepcopy(example_pages)
if !(any([occursin(file, md) for file in readdir("docs/src/examples")]))
print(
Expand All @@ -49,6 +50,23 @@ for (x, md) in deepcopy(example_pages)
)
filter!(e -> e (x => md), example_pages)
end
# removal of svgs is here if there is xml data in the md
r = open(joinpath("docs", md), "r")
w = open(joinpath("docs", md, "tmp"), "w+")
s = read(f, String)
if occursin("<svg", s) && occursin("<\\svg>", s)
print(
string(
"::warning title=SVG-Warning::example-page \"",
md,
"\" has svg-xml text in it. Most likely, linking of support-files generated by jupyter is broken\"\r\n",
),
)
replace!(s, r"\<\?xml(?!<\\svg>)(.|\n)*?<\/svg>" => "")
end
write(w, s)
close(r)
close(w)
end

my_makedocs() = makedocs(
Expand Down

0 comments on commit d75c724

Please sign in to comment.