Skip to content

Commit

Permalink
Fix doctest_fix for Documenter 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Sep 25, 2023
1 parent 1a11d14 commit 7b909e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,18 @@ Fixes all doctests for the file `n`, ie. all files in Oscar where
function doctest_fix(n::String; set_meta::Bool = false)
doc = get_document(set_meta)

if isdefined(Main.Documenter, :DocTests)
doctest = Main.Documenter.DocTests.doctest

Check warning on line 84 in src/utils/docs.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/docs.jl#L83-L84

Added lines #L83 - L84 were not covered by tests
else
doctest = Main.Documenter._doctest

Check warning on line 86 in src/utils/docs.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/docs.jl#L86

Added line #L86 was not covered by tests
end

#essentially inspired by Documenter/src/DocTests.jl
bm = Main.Documenter.DocSystem.getmeta(Oscar)
for (k, md) = bm
for s in md.order
if occursin(n, md.docs[s].data[:path])
Main.Documenter.DocTests.doctest(md.docs[s], Oscar, doc)
doctest(md.docs[s], Oscar, doc)

Check warning on line 94 in src/utils/docs.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/docs.jl#L94

Added line #L94 was not covered by tests
end
end
end
Expand Down

0 comments on commit 7b909e0

Please sign in to comment.