Skip to content

Commit

Permalink
strict -> warnonly with reversed semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 17, 2023
1 parent cc68617 commit f39c60a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Documenter, Oscar

include(normpath(joinpath(Oscar.oscardir, "docs", "make_work.jl")))

BuildDoc.doit(Oscar; strict=true, local_build=false, doctest=false)
BuildDoc.doit(Oscar; warnonly=false, local_build=false, doctest=false)

deploydocs(
repo = "github.com/oscar-system/Oscar.jl.git",
Expand Down
4 changes: 2 additions & 2 deletions docs/make_work.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ end

function doit(
Oscar::Module;
strict::Bool=true,
warnonly=false,
local_build::Bool=false,
doctest::Union{Bool,Symbol}=true,
)
Expand Down Expand Up @@ -189,7 +189,7 @@ function doit(
modules=[Oscar, Oscar.Hecke, Oscar.Nemo, Oscar.AbstractAlgebra, Oscar.Singular],
clean=true,
doctest=false,
strict=strict,
warnonly=warnonly,
checkdocs=:none,
pages=doc,
)
Expand Down
17 changes: 9 additions & 8 deletions src/utils/docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function start_doc_preview_server(;open_browser::Bool = true, port::Int = 8000)
end

@doc raw"""
build_doc(; doctest=false, strict=false, open_browser=true, start_server=false)
build_doc(; doctest=false, warnonly=true, open_browser=true, start_server=false)
Build the manual of `Oscar.jl` locally and open the front page in a
browser.
Expand All @@ -149,9 +149,11 @@ doctests are run with >= 1.7. Using a different Julia version may produce
errors in some parts of Oscar, so please be careful, especially when setting
`doctest=:fix`.
The optional parameter `strict` is passed on to `makedocs` of `Documenter.jl`
and if set to `true` then according to the manual of `Documenter.jl` "a
The optional parameter `warnonly` is passed on to `makedocs` of `Documenter.jl`
and if set to `false` then according to the manual of `Documenter.jl` "a
doctesting error will always make makedocs throw an error in this mode".
Alternatively, one can pass a list of symbols to `warnonly` to suppress
errors for the given error types.
To prevent the opening of the browser at the end, set the optional parameter
`open_browser` to `false`.
Expand All @@ -177,19 +179,18 @@ using Revise, Oscar;
The first run of `build_doc` will take the usual few minutes, subsequent runs
will be significantly faster.
"""
function build_doc(; doctest::Union{Symbol, Bool} = false, strict::Bool = false, open_browser::Bool = true, start_server::Bool = false)
function build_doc(; doctest::Union{Symbol, Bool} = false, warnonly = true, open_browser::Bool = true, start_server::Bool = false)
versioncheck = (VERSION.major == 1) && (VERSION.minor >= 7)
versionwarn =
"The Julia reference version for the doctests is 1.7 or later, but you are using
$(VERSION). Running the doctests will produce errors that you do not expect."
versionwarn = """The Julia reference version for the doctests is 1.7 or later, but you are using
$(VERSION). Running the doctests will produce errors that you do not expect."""
if doctest != false && !versioncheck
@warn versionwarn
end
if !isdefined(Main, :BuildDoc)
doc_init()
end
Pkg.activate(docsproject) do
Base.invokelatest(Main.BuildDoc.doit, Oscar; strict=strict, local_build=true, doctest=doctest)
Base.invokelatest(Main.BuildDoc.doit, Oscar; warnonly=warnonly, local_build=true, doctest=doctest)
end
if start_server
start_doc_preview_server(open_browser = open_browser)
Expand Down

0 comments on commit f39c60a

Please sign in to comment.